1
Fork 0
webextension-template/source/background-scripts/initialize.ts

14 lines
351 B
TypeScript
Raw Normal View History

2022-03-02 12:17:15 +00:00
import browser from 'webextension-polyfill';
browser.browserAction.onClicked.addListener(async () => {
await browser.runtime.openOptionsPage();
});
browser.runtime.onInstalled.addListener(async () => {
console.debug('WebExtension Template has been installed!');
if (import.meta.env.DEV) {
await browser.runtime.openOptionsPage();
}
});