14
Dec
10

jQuery exception in Firefox 4

If jQuery is used as a part of a browser extension in Firefox, it will work for FF3 but not necessarily in FF4. In particular, when jQuery is loaded using loadSubScript() passing a window (a wrappedJSObject object) to it as a context, it will throw an exception in eventSupported():

“Component is not available” nsresult: “0×80040111 (NS_ERROR_NOT_AVAILABLE)”
FF4 throws this exception if the event that is being checked is not supported on these lines:

var isSupported = (eventName in el);

isSupported = typeof el[eventName] === “function”;
This problem seems to be specific to loading jQuery using loadSubScript() since I cannot reproduce it in the console.

A workaround is a simple try/catch block. I created a pull request for the jQuery team here: https://github.com/jquery/jquery/pull/128

Advertisement

0 Responses to “jQuery exception in Firefox 4”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.