Mozilla has a fix for Flash causing Firefox’s window to lose focus

A bug was discovered back in mid 2012 that caused the Firefox browser window to lose focus under certain circumstances when Flash contents were played in it.

What this meant is that Firefox users had to click on the browser window to make it the active window on the system again even if it was the active window before.

The system the bug was encountered on was a x86 Windows 7 operating system with Flash 11.3 initially but other systems such as Windows 8.1 are also affected by it according to user reports.

According to Mozilla, it is a bug in Flash and not in Firefox that is causing the issue for users of the browser.

The issue was quickly linked to Flash's Protected Mode. Users who disabled the mode or ran operating systems were it was not available did not experience the issue.

Reproduce the issue

flash player bug firefox

To reproduce the issue you need to visit a web page that runs Flash contents, e.g. http://www.adobe.com/software/flash/about.

You will notice that Flash processes are loaded when you open the Task Manager of the system with Ctrl-Shift-Esc.

It is then necessary to close all windows that play Flash contents again and wait until the Flash process is terminated automatically.

When you then open a web page with Flash again, Firefox will lose focus.

Other bugs may be related to the issue, for instance that new windows open in the background and not foreground on the system.

Fixing the issue

Mozilla cooperated with Adobe on the bug but a solution was nowhere in sight.

Yesterday, Aaron Klotz published a comment on the Bugzilla but report that confirmed that a possible patch for the issue has been found.

Possible patch using LockSetForegroundWindow

This patch wraps out of process NP_Initialize calls with LockSetForegroundWindow. This appears to do the right thing.

The implementation is currently being tested but it looks promising so far. If no issues are discovered during tests, it may find its way into Firefox Nightly quickly and from there on all the way down to the stable version of the browser.

Update:  It appears that Adobe has fixed the bug as well in Flash Player 15 which you can see on this page.

Firefox will now retain focus when Flash Player processes are launched (3223393)

Summary
Article Name
Mozilla has a fix for Flash causing Firefox's window to lose focus
Author
Description
Mozilla found a fix for a longstanding issue in Firefox that caused the browser window to lose focus under certain circumstances related to Flash.
Please share this article

facebooktwittergoogle_plusredditlinkedinmail


Responses to Mozilla has a fix for Flash causing Firefox’s window to lose focus

  1. CHEF-KOCH August 30, 2014 at 3:16 pm #

    Patch from CHEF-KOCH:
    Not use flash, end of story and works with every system and every os.

    I use the ViewTube_GM script from Greasefork/Userscripts which provide support for known platforms such as YouTube, Facebook, Vimeo, dailymotion, metacafe and many more. Some sites e.g. YouTube also use nativ Html5 which is enabled for never browser by default. From what I know every flash player frame can be converted to html5 video frame, there are several examples/scripts on the net how to do that (e.g. golem html5 script is an example to show on a flash site html5 videos).

    • Martin Brinkmann August 30, 2014 at 3:25 pm #

      While that is sound advice, it is not always possible to do so, especially in work environments.

  2. Dwight Stegall August 30, 2014 at 3:27 pm #

    I wish someone would tell me why I can't load any of Cnet How-To videos in any browser. Half of CNN's embedded videos on Facebook won't load either. The message says this video is no longer available. But it plays fine on their website. :(

    Today the Cnet videos are loading some of the time in Opera 23. But still not in Chrome or Firefox.

    I'm using Windows 8.1 but was also having the same trouble in Windows 7.

    • Dwight Stegall August 30, 2014 at 3:40 pm #

      I'm using the same extensions in Opera 23 and Chrome 64-bit

      Above I said I can't load Cnet How To Videos. I meant to say I can't load any of their videos

    • greg August 30, 2014 at 4:03 pm #

      I can never get CNET videos to play either.

      I wish everyone would stop using FLASH. It would force websites to do away with it. Nothing is more frustrating than going to a website that REQUIRES you have flash and then a few feet away some guy is on an iPad on the same website. This pisses me off that flash is required because I'm using a laptop instead of iPad/iPhone.

      I don't use Flash. Don't have it installed.

  3. CHEF-KOCH August 30, 2014 at 4:01 pm #

    > While that is sound advice, it is not always possible to do so, especially in work environments.

    I disagree, it's a security risk to use flash in a such environments because it's no secret that flash often gets hacked (because almost every page use it) and that should be the first reason to not use popular products that are often compromised if there are better alternatives.

    I'm now 4 years without flash and there was never a problem or I need waste my time to update such product, and I never understand why Firefox/IE not native implement it in there browser and force the user with every patch tuesday/update to really get the latest updates/fixes, because from what I know most people/environments not get updates as often as they should.

  4. Dwight Stegall August 30, 2014 at 4:23 pm #

    I removed Adblock Plus in Firefox 31 and they still won't play

    I reset Firefox 31 settings in about:support. Now with no addons installed the Cnet videos play fine.

    • Dwight Stegall August 30, 2014 at 5:01 pm #

      Sorry I bothered you with this. I finally figured it out on my own. The Disconnect addon in Firefox and Chrome was blocking Cnet Videos. But not in Opera 23.

  5. fokka August 30, 2014 at 10:26 pm #

    thanks for the info, martin! really annoying bug...

  6. FX September 1, 2014 at 7:53 pm #

    http://download.mozilla.org/?product=firefox-32.0&os=win&lang=en-US

    Firefox 32 with GGC and Public Key Pinning.

Leave a Reply