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)
addons.mozilla.org Graveyard
Add-on Builder
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
Updated•14 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Updated•11 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•