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
0 Responses to “jQuery exception in Firefox 4”