var Helloworld = {
onLoad: function() {
// initialization code
this.initialized = true;
},
onMenuItemCommand: function() {
window.open("chrome://helloworld/content/hello.xul", "", "chrome");
}
};
window.addEventListener("load", function(e) { Helloworld.onLoad(e); }, false);
http://kb.mozillazine.org/Getting%5Fstarted%5Fwith%5Fextension%5Fdevelopment
I don't understand the function(e) { Helloworld.onLoad(e);
part. I think it passes an event parameter e
to the onLoad function, but the onLoad function doesn't have onLoad: function(e) {}
to receive e
, so what's going on?