Nasty wmode bug in Firefox 2

Today at work one of our developers came to me and mentioned that he’d encountered a real head-scratcher of a bug: all of a sudden, the sIFR headlines on the site he was working on all had green backgrounds, and the drop-down menus on the site were now appearing underneath all Flash elements, sIFR or otherwise. This was only happening on Firefox 2.0.0.11, and on one other workstation as well, so it was not a localised/environmental bug.

wmode

Now, when someone mentions Flash elements breaking through layered DIVs, my first thought is “wmode”: the Flash embed setting that controls the “window mode” of an embedded Flash asset. “wmode=opaque” will instruct the Flash Player to use the background colour of the SWF, while “wmode=transparent” will instruct the Flash Player to make the background of the SWF transparent, so that the page below it shows through.

wmode also has implications for how a Flash asset interacts with other elements that may be placed on top of it. If you do not set wmode in your embed code, a Flash movie will always play above all other elements on the page. If you set wmode to be either transparent or opaque, elements will be able to hover above a Flash asset quite happily (Opera historically had some issues in this area, which are thankfully solved in the latest releases). See Adobe’s Technote on this issue.

wmode could also feasibly have been responsible for the green backgrounds in sIFR: I’m not sure why the colour would be green, but clearly the Flash was not rendering with a transparent background as is the default with sIFR, so something was definitely up.

We checked a few other workstations, all running the same version of Firefox, and none could replicate the issue. Since the codebase worked fine on most workstations, we could only deduce that there was some corruption or issue with either his version of Firefox, or his version of the Flash plugin, or an interoperability issue when the two are working together.

Culprit: the FireShot Add-On

After some Googling, I happened upon a useful post at Trevor Davis’ blog, discussing the green background issue with sIFR. It appears that many people started experiencing this issue - and other issues related to wmode - after installing or upgrading to FireShot 0.31. This is more about this in a discussion at the Firefox Add-Ons site.

So, it appears that FireShot 0.31 modifies a configuration setting called “general.useragent.extra.fireshot”, which appears to add some spam about FireShot into your browser’s user-agent string. What was most interesting was that the actual value of this setting included a URL, in the format “http://domain-name/”, which I believe might be the cause of the bug.

User-Agent Strings

I’m not sure if there is some globally-recognised standard for the formatting of user-agent strings, but Mozilla seems to adhere to a specification. A quick read will reveal something that seems intuitive to someone who has even seen a user-agent string: “/” and “:” characters are special character used to delimit or indicate certain data within the string.

Therefore, if a URL in the format “http://domain-name/” was appended to the Firefox user-agent, the “://” part of the string would quite likely invalidate the user-agent string, and cause issues with the way in which Firefox interprets it. How this in turn effects the way in which wmode is interpreted is unfortunately beyond me.

Undoubtedly Firefox should better sanitise the configuration values that may be included in the user-agent string. However, I also think that it’s quite cheeky for FireShot to try to include the URL of their website in the user-agent string as some sort of desperate publicity stunt.

The Solution

However, if you encounter this issue, it can be easily solved:

  1. Open up a new Firefox tab, and navigate to “about:config”. This will open the Firefox configuration registry.
  2. Type “general.useragent.extra” in the “Filter” box.
  3. Right-click on the “general.useragent.extra.fireshot” entry, and choose “reset” to clear it’s value
  4. Repeat the step above for any other add-ons who may be using your user-agent string as free advertising.
  5. Restart your browser, and the issue should be resolved
Share this post:
  • Digg
  • del.icio.us
  • Facebook
  • BlogMemes
  • Fark
  • Furl
  • Pownce
  • Reddit
  • StumbleUpon
  • TwitThis

About this entry