39

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.

3

7 Answers 7

20
+75

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).
2
5

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

3

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.

2

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.

1

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)

2
  • 5
    I don't use Windows, and the question is unrelated to Flash.
    – alecail
    Oct 16, 2013 at 6:50
  • As a sidenote the mms.cfg path on linux is /etc/adobe/ and /Library/Application Support/Macromedia on OSX.
    – Shadok
    Oct 17, 2013 at 14:40
0

One simple (and expensive) trick: run the browser in a dedicated virtual machine. That way, you can keep the program running as if it was the sole purpose of the computer. This works with any application, including browsers.

-2

Well i don't think you really can do anything to keep the focus
You can try to modify the website or you can try to open the page in a new window see if it works
If you know how to code in C++/C# you can try to give firefox focus for like each time it losing focus or just give it focus none stop it's not that hard and if you want the code i can write one for you.
also there is a way to modify the registry but i don't know if it really will work for you or not
Here is the instructions:

  1. Open regedit by Win + R or just type it in start menu's search box
  2. In regedit go to HKEY_CURRENT_USER > Control Panel > Desktop
  3. Edit "ForegroundLockTimeout" the key type is DWORD (Hexadecimal) the default is 30d40 (200000) milliseconds

don't forget to export the key to make a backup before editing it

or you can use this program called Tweak UI but i am not sure it work correctly since it was made for Windows XP

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .