I’m detecting if the mouse leaves the window as specified in this answer: How can I detect when the mouse leaves the window?.
The problem is that the browser triggers this event when the mouse enters an iframe (an embedded Youtube video in my case).
How can I prevent that?
You simply have to modify the handler this way:
EDIT Added
e.srcElementoption to support IE