Files
webextensions-examples/open-my-page-button/background.js
2016-12-07 15:32:46 -10:00

17 lines
299 B
JavaScript

/*
Open a new tab, and load "my-page.html" into it.
*/
function openMyPage() {
console.log("injecting");
browser.tabs.create({
"url": "my-page.html"
});
}
/*
Add openMyPage() as a listener to clicks on the browser action.
*/
browser.browserAction.onClicked.addListener(openMyPage);