#4443 closed bug (invalid)
Causes conflict with other addons when used in a Firefox extension
Reported by: | acoder | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When used in a Firefox extension jQuery 1.3.2 cause incompatibilities with other extensions. This problem was not present in 1.2.6. To replicate:
1) Install Google Toolbar (https://addons.mozilla.org/en-US/firefox/addon/6249) 2) Install Smarter Wikipedia 1.1.1 (https://addons.mozilla.org/en-US/firefox/addons/versions/9825#version-1.1.1) 3) Notice that some buttons are now missing from Google Toolbar.
If you go to the jQuery file included within Smarter Wikipedia and comment out this line "Array.prototype.slice.call( document.documentElement.childNodes );" everything works again. I'm not sure what is happening -- any insight into this behavior would be appreciated.
Change History (4)
comment:1 Changed 14 years ago by
comment:3 Changed 13 years ago by
Component: | unfiled → core |
---|
comment:4 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
References: #4865, #4443 (duplicates)
Both tickets describe jQuery as being the source of a compatibility issue within XUL-based FireFox extensions. This was a known issue with FireFox which was sourced back to the way it handles the document.documentElement element from within these extensions. As it transpires, there are actually conventions in the way jQuery should be loaded for extensions (this isn't a core bug).
A common practice to correctly use jQuery in extensions was to until after 'load' (using a DOMContentLoaded listener) to execute any further code as this prevented further issues related to this bug from appearing.
Ok, I discovered that calling "Array.prototype.slice.call( document.documentElement.childNodes );" in a script tag in an XUL overlay caused problems but calling it in a function triggered after the "load" event did not cause problems. Thus, it is possible that the reason it caused problems is that some stuff were still initializing when that piece of code was executed by jQuery.