How Does MS AJAX Manage to Crash Firefox?
Posted in Development
Another day, another idiosyncrasy. I’m implementing the
IScriptControl interface and have the following line which crashes Firefox upon page unload:
public IEnumerable<ScriptReference> GetScriptReferences () { yield return new ScriptReference ( "MyNamespace.MyScriptControl.Panelbar.js", this.GetType ().Asembly.FullName); }
Firefox crashes cold with this:

By trial and error, I figured that the following line does not cause crashes:
public IEnumerable<ScriptReference> GetScriptReferences () { yield return new ScriptReference ( Page.ClientScript.GetWebResourceUrl ( typeof (MyControl), "MyNamespace.MyScriptControl.Panelbar.js")); }
}
Go figure. On a scale of 1 (a hiccup) to 10 (absolutely weird), this issue scores a 10.
5 comments
Milan Negovan
on March 17, 2008
No, C# is not involved here. It's something about disposing of script controls that causes the crash.
Petr Snobelt
on March 18, 2008
Every software has bugs ...
Report it bck to MS or to Scott Hanselman and hope it will be fixed in next release.
serializer
on March 20, 2008
@Milan: do you have any further knowledge of this?
I am having a nightmare making FCKeditor work properly as an IScriptControl. The component is *not* being disposed properly on postback, ultimately causing me lots of errors. Even if I work around the errors, it's surely destined for memory leaks since all the "disposed" components are still hanging around somewhere.
Do you know of any way to fix this?
Regards
Milan Negovan
on March 23, 2008
Unfortunately, I don't. My suspicion is that something was going very wrong during page unload. If I put a delay in the dispose function, Firefox shut down nice and clean. Without a delay it was crashing every single time. I still don't understand how that one line of code caused such a serious issue.

RichB
on March 13, 2008
Crikey. Firefox can execute C# natively? That's impressive.