Is there a way to access the DOM from the event fired by DOMContentLoaded?
window.addEventListener("load", function() { myExtension.init(); }, false);
var myExtension = {
init: function() {
var appcontent = document.getElementById("appcontent"); // browser
if(appcontent)
appcontent.addEventListener("DOMContentLoaded", myExtension.onPageLoad, true);
},
onPageLoad: function(aEvent) {
//how to access to the DOM from aEvent??
},
}
From https://developer.mozilla.org/en/Code_snippets/On_page_load
Just the first line in
onPageLoadon the page you linked to shows how:This gives you the
documentelement of the website.