1
Fork 0
tildes-reextended/source/background/setup.ts

18 lines
439 B
TypeScript
Raw Normal View History

2023-06-23 10:52:03 +00:00
import browser from "webextension-polyfill";
if ($browser === "firefox") {
browser.browserAction.onClicked.addListener(openOptionsPage);
} else if ($browser === "chromium") {
browser.action.onClicked.addListener(openOptionsPage);
}
browser.runtime.onInstalled.addListener(async () => {
if ($dev) {
await openOptionsPage();
}
});
async function openOptionsPage(): Promise<void> {
await browser.runtime.openOptionsPage();
}