I'm trying to develop a addon that involves addEventListener wich should triggered after the page loaded. On my linux build of Pale-Moon it works fine but on the windows build of Pale-Moon nothing happends.
Here is the code I tried:
Code: Select all
var test_ext = function () {
var prefManager = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
return {
init : function () {
gBrowser.addEventListener("load", function () {
alert('Yes tap load complete..');
}, false);
},
run : function () {
alert('Yes, button works nicely.');
}
};
}();
window.addEventListener("load", test_ext.init, false);
Windows build: Version: 27.4.1 (64-bit)
Is there something wrong with the code?