N
noon
This code is part of a firefox extension, not that it matters, but
before you gripe over something that isn't crossbrowser compatiable,
it doesn't matter much.
It works most of the time, but not always. And fails miserably when I
right click a link --> open in new window. I have to re-refresh the
page after I do this for changes to take effect.
I've also tried getBrowser().addEventListener("onload",
this.onPageLoad, true);
Help greatly appreciated
----------------------------------------------------------------
// Event listener
window.addEventListener("load", function(e) { pi.init(); }, false);
var pi = {
init: function() {
var appcontent = document.getElementById("appcontent"); // browser
if (appcontent) {
appcontent.addEventListener("DOMContentLoaded", this.onPageLoad,
true);
}
},
onPageLoad: function(e) {
var doc = e.originalTarget; // Doc that triggered onLoad
var loc = doc.location;
( ... )
before you gripe over something that isn't crossbrowser compatiable,
it doesn't matter much.
It works most of the time, but not always. And fails miserably when I
right click a link --> open in new window. I have to re-refresh the
page after I do this for changes to take effect.
I've also tried getBrowser().addEventListener("onload",
this.onPageLoad, true);
Help greatly appreciated
----------------------------------------------------------------
// Event listener
window.addEventListener("load", function(e) { pi.init(); }, false);
var pi = {
init: function() {
var appcontent = document.getElementById("appcontent"); // browser
if (appcontent) {
appcontent.addEventListener("DOMContentLoaded", this.onPageLoad,
true);
}
},
onPageLoad: function(e) {
var doc = e.originalTarget; // Doc that triggered onLoad
var loc = doc.location;
( ... )