Skip to content

Instantly share code, notes, and snippets.

@BigBlueHat
Created August 7, 2014 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BigBlueHat/b8a61bbe04fbddaf8146 to your computer and use it in GitHub Desktop.
Save BigBlueHat/b8a61bbe04fbddaf8146 to your computer and use it in GitHub Desktop.
Firefox Add-on Tab Events
var tabs = require('sdk/tabs');
function onOpen(tab) {
console.log(tab.url + " is open");
tab.on("ready", function() {console.log(tab.url + " is ready")});
tab.on("loaded", function() {console.log(tab.url + " is loaded")});
tab.on("pageshow", function() {console.log(tab.url + " is pageshown")});
tab.on("activate", function() {console.log(tab.url + " is activate")});
tab.on("deactivate", function() {console.log(tab.url + " is deactivate")});
tab.on("close", function() {console.log(tab.url + " is close")});
}
tabs.on('open', onOpen);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment