window.addEventListener("load", function() { autoTranslate.init(); }, false); var autoTranslate = { init: function() { var appcontent = document.getElementById("appcontent"); // browser if(appcontent) appcontent.addEventListener("load", this.onPageLoad, true); }, onPageLoad: function(aEvent) { var doc = aEvent.originalTarget; doc.location.assign("http://google.com"); } }