Silverlight 2 (beta 2) and Firefox 3... so happy together...

Silverlight loves the Fox like Joanie loves Chachi!If you've been holding off on using Silverlight 2 or Firefox 3 because they weren't playing well together, it's safe to come out now. One of the best "undocumented" features in Silverlight 2 Beta 2 is that it now works with Firefox 3.

I've been following this issue on Bugzilla (Bug 421217) for a few months. It reads innocently enough: "NPRuntime object reference counting is violated by NPObjWrapperPluginDestroyedCallback causing Silverlight 2.0 beta: crashes when closing tab/window [@ JS_SetPrivate - NPObjWrapperPluginDestroyedCallback]". Here's what that means in plain English:

You could view Silverlight 2 (Beta 1) objects in Firefox 3, but when you closed the tab, it would crash the entire browser process.

There's a lot of back and forth on the Bugzilla thread. It appears that something changed in the way that Firefox disposes objects on the move from Firefox 2 to 3, as Wilco Bauwer's comment indicates:

...the problem is that we're calling ReleaseObject from a call to DeallocateObject (which is called by FF). Apparently FF3's ReleaseObject implementation crashes when an object is passed in that FF3 believes to be dead. The reason why we do this is related to how reference counting works in FF2. In our experience, FF2 calls DeallocateObject on our NPObjects when *it* no longer references that NPObject. It ignores the reference count.

The Firefox team clearly didn't want to be bothered with this issue, despite the fact that it was near the top of the list of topcrash bugs for Firefox 3. After a bit of back and forth, it was apparent that the Silverlight team would be the ones making modifications so that they'd handle both Firefox 2 and 3's different behaviors. So we've been waiting on a Silverlight 2 update for it to run Firefox 3. That didn't prevent the (futile) flurry of questions on every Firefox 3 release: "Does this one work with Silverlight 2?"

So we're good now. Silverlight 2 Beta 2 works on Firefox 3.

But, about that crashy thing...

Note that Wilco raised some questions for the Firefox team which don't really sound like they've been solved:

For us it's important that the reference counting rules are followed strictly for our NPObjects, because we allow you to pass them from one plugin to another. Unless we'd rip out our entire HTML/JS bridge, this would be an easy way for developers to write apps that crash a browser or cause other type of unexpected behavior.

And it's not a Silverlight specific issue. As I read the Bugzilla thread Firefox 3 has kind of broken reference counting in a way that makes it easy for any plugin to (accidentally or maliciously) crash the browser by calling ReleaseObject on a null or destroyed object. That seems like a problem, because Firefox 2, Safari (and all other WebKit based browsers), Opera, and IE apparently implement the Netscape Plugin API in a way that respects reference counting, and now Firefox 3 no longer follows that. Presumably Silverlight's doing some internal reference counting or checking to work around this issue, and anyone else that wants to write a plugin that allows for communication between instances in a page (or communication with other plugins on a page) will need to do the same. I guess it's not my problem, and clearly the Firefox team has decided it's not theirs, either.

18 Comments

  • wow, that bugzilla report reads like a soap opera "no you fix, no you fix it...we're not going to fix it regardless of how many people say it is our fault" -- close the bug because someone made a workaround instead of fixing the core issue...yikes...good times.

  • Don't worry its only FF3 rc2, they still have time to break it yet again. Now the real question is if it wasn't Microsoft 's product would they care a little more?

  • @Aaron Fischer

    Or the question should be, how vilified would MS be if it was IE and a FF branded plugin.

  • I have Silverlight 2.0.30523.6 + Firefox 3 (Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0) installed and Firefox is still crashing for me - all the time! MSN.com, for example. I'm sure it's related to this issue, but this issue is supposedly resolved? No, it's not!

  • The real funny thing is that when a hacker uses this to crash Firefox with a Silverlight application, who do you think will get blamed? FF or MSFT? :)

  • Well, I certainly won't be helping them with their record breaking attempt.

    It would appear that they have now entered the arrogance stage that MS have just come out of the other side of....

    C

  • It seems like a few people on the FF3 team are taking it seriously...but there are some obvious trolls in there who seem to just want to pass it over for no good reason, except possibly that it's involving MSFT.

  • Now the silverlight 2 (background) sound doesn't work - very nice.

  • Crashes for me every single time. Silverlight 2 Beta 2 and Firefox 3 official release. How freaking annoying.

  • Hmmm, justice :)

    MS just got a taste of it's own medicine, the kings of creating 'features' in IE that cause my web apps to break because they don't follow standards, they make their own.

    But, glad to see it's working, Silverlight is pretty cool

  • @inhahe, @skain Can you let me know which site is still causing crashes for you? I'm not seeing any Silverlight related crashes in FF3.

    @inhahae Those "Get Silverlight" icons are from sites which haven't updated their code from Silverlight 1.0 to Silverlight 2 yet. That only requires replacing Silverlight.js with an updated version; it's a very simple fix.

  • Jon Galloway-

    FWIW, FF3 crashed on me today everytime I try to open video from NBCOlympics.com

    IE obviously works fine with this site.

  • Short of pulling my hair out. Silverlight is refusing to work on ITV.com
    Anyone know what the problem is?

  • Silverlight 2 Beta 2 for Firefox 3. will NOT work on itv.com in any way shape or form.

    I get no crashes but keep being told to install.

  • Silverlight.... runs in circles..

    Install it try to use it says exit browser and restart nbcolympics.som

    Sliverlight 10 for 10 nogo...

    rename product Silverloop and you would be fine.

  • read the faq at website "wicrosoft will support firefox". I just hate those "will" (remember the framework on linux).

  • You must be a microsoft guy. Silverlight 2 still crashes Firefox 3

  • Hey are using Wordpress for your site platform? I'm new to the blog world but I'm trying to get started
    and create my own. Do you need any coding expertise to make
    your own blog? Any help would be really appreciated!

Comments have been disabled for this content.