Do more on the web, with a fast and secure browser!

Download Opera browser with:

  • built-in ad blocker
  • battery saver
  • free VPN
Download Opera

JavaScript: blur event on window

  • I've implemented:

    window.addEventListener("blur", blurBodyHandler, false);

    in my JavaScript and when an element in IFrame takes focus my event handler is triggered. In WebKit browsers. Not so in Opera browser on my Smart TV. I've tried:

    window.onblur = function(){}

    to no avail. I've tried attaching "focus" event listener to IFrame but had no luck with that either.

    However, adding event listeners on "DOMContentLoaded" and "keydown" works just fine.