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_started_with_extension_development
我不明白这function(e) { Helloworld.onLoad(e);
部分。我认为它将一个事件参数传递e
给 onLoad 函数,但 onLoad 函数不必onLoad: function(e) {}
接收e
,那是怎么回事?