Closed Bug 625053 Opened 14 years ago Closed 14 years ago

Add-on builder incorrectly generates window "load" listeners.

Categories

(addons.mozilla.org Graveyard :: Add-on Builder, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 556754

People

(Reporter: kmag, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b9pre) Gecko/20110109 Firefox/4.0b9pre Build Identifier: I've rejected quite a lot of add-ons for this bug already. The "load" event listener generated by the add-on builder calls the event handler with its 'this' object bound to the global window rather than the namespace object in question, and thereby leaks the variables 'strings' and 'initialized' to the global namespace. Rather than: var fooAddon = { onLoad: function() { // initialization code this.initialized = true; this.strings = document.getElementById("foo-addon-strings"); }, ... }; window.addEventListener("load", fooAddon.onLoad, false); It should generate: var fooAddon = { onLoad: function() { // initialization code this.initialized = true; this.strings = document.getElementById("foo-addon-strings"); }, ... }; window.addEventListener("load", function (event) fooAddon.onLoad(event), false); Reproducible: Always
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.