How can I make a tab in Firefox falsely believe that it still has the focus?

37,076

Solution 1

Since you have not provided details of the website, here is one solution you can try.

  • Install the Greasemonkey extension to allow you to run user JavaScripts on websites of your choice.
  • Install the Always on focus userscript.

    Script Summary: Some pages check the document.hidden property and won't render content unless the page is in focus. This script will trick them to think they are in focus so you can preload them in a tab and visit them when they have finished loading.

  • Configure the script for specific websites, as desired, while installing (or later).

Solution 2

You need to create a User Script. These are javascripts that run within Firefox (or Chrome) and manipulate specific websites.

Tools such as Greasemonkey (http://www.greasespot.net) can be used for this. There may be one already available at http://userscripts.org.

But as @harrymc has already commented, an example URL would be useful.

Solution 3

The Grease/Tamper-monkey answer doesn't work on Facebook watchparties, but manually removing the blur event handlers works in Chrome 75:

Chrome event handler removal

In Firefox the same should be achievable using the Inspector as well:

enter image description here

Solution 4

I don't know if this will work for anyone who might still come to this page, but I found a Firefox extension called, "Always active Window - Always Visible." This came about because I was trying to record multiple windows in OBS Studio 26.1 (a screen recorder), and OBS was not recording the browser windows that were minimized (or that I was not actively viewing at the time). This occurred because Firefox was not rendering the activity (in this case, a live auction) in the windows that were minimized or that I was not actively viewing.

Solution 5

I'm going to answer the question I think you're meaning to ask.

What you want to do is have Flash run in the background when you've lost focus. This is a big problem with Flash-based idle games, and the following are some bits from Adobe's Flash Administration Manual that should make stuff run when you aren't focused.

mms.cfg file location Assuming a default Windows installation, Flash Player looks for the mms.cfg file in the following system directories:

• 32-bit Windows - %WINDIR%\System32\Macromed\Flash

• 64-bit Windows - %WINDIR%\SysWow64\Macromed\Flash

What you want to do is create this mms.cfg file (you'll need admin access, natch) with the following lines in it:

ProtectedMode=0

FullFramerateWhenInvisible=true

I recall disabling protected mode being necessary, even though its stated purpose is sandboxing Flash apps - for whatever reason, the other option didn't work without it. YMMV, of course - try it without disabling protected mode first - it's been a long while since I've configured this on my computers.

FullFramerateWhenInvisible is the option that makes it so Flash runs when the window doesn't have focus.

Once again, this isn't the specific question you asked, but if it isn't the right answer, it'll at least send you in the right direction. :)

Reference: Admin guide: http://www.adobe.com/devnet/flashplayer/articles/flash_player_admin_guide.html

Framerate trick: http://tukkun.webs.com/ (#3 on that webpage, currently)

Share:
37,076

Related videos on Youtube

alecail
Author by

alecail

Updated on September 18, 2022

Comments

  • alecail
    alecail over 1 year

    In Firefox I would like to pass to another tab while an ad is playing in the current tab, but the pesky thing will pause when its tab loses the focus.

    I would like to trick the ad to believe that it still has the focus, for it to keep on playing so I don't have to wait for it to finish.

    How can I make a Firefox tab falsely believe that it still has the focus ?

    You can make the assumption that the page is using techniques described here. window.onfocus and window.onblur are probably used. I don't remember where exactly I needed this when I asked the question; this is not necessarily used to trick ads. I'm looking for a generic solution.

    • alecail
      alecail over 10 years
      @harrymc Javascript only is ok.
    • harrymc
      harrymc over 10 years
      Need a demo url for giving useful advice.
    • Gabriel Fair
      Gabriel Fair almost 4 years
  • Vijay Prakash Desetty
    Vijay Prakash Desetty over 10 years
    As a sidenote the mms.cfg path on linux is /etc/adobe/ and /Library/Application Support/Macromedia on OSX.
  • Paul
    Paul about 7 years
  • David Lopez
    David Lopez over 6 years
    I've tested Aways on focus with this other script that console logs if the screen in being focused (using jquery): jsfiddle.net/ScKbk It doesn't work, correct me if I'm wrong. Currently testing on Chrome v63 MacOS Sierra