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

how to trick a tab into thinking it has focus?

  • I have an app running in one tab (target), and other apps running in other tabs. The target app refuses to update itself unless it has focus. I think it uses the HTML DOM method document.hasFocus() . Is there a way to trick an app running in a tab into thinking it has focus although it hasn't? It would be very annoying to give it focus every time it is about to update because I'm working in other tabs. What can I do? I can't remove the check for focus in target.

  • Can you redefine html dom methods in Opera? So that the redef only is valid for the target document? win.document.hasFocus = function(){ return true; };

    Would that work?

Log in to reply