Move ifs to the bottom.

This commit is contained in:
Bauke 2022-03-21 10:43:24 +01:00
parent 1abab7f635
commit 4b9a890861
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 11 additions and 11 deletions

View File

@ -16,22 +16,11 @@ browser.runtime.onStartup.addListener(async () => {
await updateBadge(await Settings.fromSyncStorage());
});
if (import.meta.env.VITE_BROWSER === 'chromium') {
browser.action.onClicked.addListener(actionClicked);
} else {
browser.browserAction.onClicked.addListener(browserActionClicked);
void initializeContextMenus();
}
browser.runtime.onInstalled.addListener(async () => {
await initializeContextMenus();
await updateBadge(await Settings.fromSyncStorage());
});
if (import.meta.env.DEV) {
void browser.runtime.openOptionsPage();
}
browser.contextMenus.onClicked.addListener(async (info, tab) => {
const contextMenus = getContextMenus();
const contextMenuIds = new Set<string>(
@ -40,3 +29,14 @@ browser.contextMenus.onClicked.addListener(async (info, tab) => {
await contextClicked(contextMenuIds, info, tab);
});
if (import.meta.env.DEV) {
void browser.runtime.openOptionsPage();
}
if (import.meta.env.VITE_BROWSER === 'chromium') {
browser.action.onClicked.addListener(actionClicked);
} else {
browser.browserAction.onClicked.addListener(browserActionClicked);
void initializeContextMenus();
}