• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    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?

    Opera for Windows
    html5 javascript
    1
    2
    1790
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Former User
      A Former User last edited by

      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.

      Reply Quote 0
        A Former User 1 Reply Last reply
      • A Former User
        A Former User @Guest last edited by

        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?

        Reply Quote 0
          1 Reply Last reply
        • First post
          Last post

        Computer browsers

        • Opera for Windows
        • Opera for Mac
        • Opera for Linux
        • Opera beta version
        • Opera USB

        Mobile browsers

        • Opera for Android
        • Opera Mini
        • Opera Touch
        • Opera for basic phones

        • Add-ons
        • Opera account
        • Wallpapers
        • Opera Ads

        • Help & support
        • Opera blogs
        • Opera forums
        • Dev.Opera

        • Security
        • Privacy
        • Cookies Policy
        • EULA
        • Terms of Service

        • About Opera
        • Press info
        • Jobs
        • Investors
        • Become a partner
        • Contact us

        Follow Opera

        • Opera - Facebook
        • Opera - Twitter
        • Opera - YouTube
        • Opera - LinkedIn
        • Opera - Instagram

        © Opera Software 1995-