Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
@harrymc Javascript only is ok. –  Antoine Lecaille Oct 12 '13 at 10:53
1  
Need a demo url for giving useful advice. –  harrymc Oct 12 '13 at 10:55

4 Answers 4

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

share|improve this answer

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.

share|improve this answer

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|improve this answer
    
I don't use Windows, and the question is unrelated to Flash. –  Antoine Lecaille Oct 16 '13 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 '13 at 14:40

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

share|improve this answer
    
I don't use Windows but I'm curious: what would your " C++/C# code" do ? Simulate clicks on the tab ? –  Antoine Lecaille Oct 16 '13 at 6:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.