Ticket #7785 (closed bug: wontfix)
jQuery throws exception if used inside an extension in FF4
|Reported by:||evgeny.shadchnev@…||Owned by:|
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 wrappedJSObject as a context, it will throw an exception in eventSupported():
"Component is not available" nsresult: "0x80040111 (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 but there must be a better solution. I've seen this behaviour on 1.4.2, 1.4.4 and on the 1.4.5pre.
A test case is here: https://github.com/shadchnev/jquery-exception-testcase