Skip to content

Instantly share code, notes, and snippets.

@rpl
Created March 15, 2017 16:54
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 rpl/f317752e2706734a8da49602e2972d1f to your computer and use it in GitHub Desktop.
Save rpl/f317752e2706734a8da49602e2972d1f to your computer and use it in GitHub Desktop.
tabTracker snippet
const {Management} = Cu.import("resource://gre/modules/Extension.jsm", {});
....
class API extends ExtensionAPI {
getAPI(context) {
const {tabTracker} = Management.global;
return {
mynamespace: {
mymethod(tabId) {
let tab = tabTracker.getTab(tabId);
...
},
},
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment