/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function set_pageload(browser){browser.addEventListener("DOMContentLoaded", pageload, false)} function add_tab(e){set_pageload(e.target.linkedBrowser)} function pageload(){ var doc = this.contentWindow.document // modify page using "doc" as "document" } window.addEventListener("load", function(){ // Listen to first page/tab set_pageload(gBrowser.mPanelContainer.firstChild.firstChild) // Listen to other pages/tabs as they are opened gBrowser.tabContainer.addEventListener("TabOpen", add_tab, false) }, false)
Comments
