I just read, I think all the thread that deals with this subject, and I can\'t find a real solution to my problem. I need to detect when the browser window loses its focus, i.e.
I tried both:
document.addEventListener('blur', function(){console.log('blur')});
and
window.addEventListener('blur', function(){console.log('blur')});
and they both worked in my version of FF (33.1).
Here's the jsfiddle: http://jsfiddle.net/hzdd06eh/
Click inside the "run" window and then click outside it to trigger the effect.