#7785 closed bug (wontfix)
jQuery throws exception if used inside an extension in FF4
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.6 |
Component: | unfiled | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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
We don’t fix bugs in beta browsers; too much of a moving target. Please reopen if this is still an issue when Fx4 final is released.