Move initialization to the bottom of the file.

This commit is contained in:
Bauke 2022-11-16 12:15:04 +01:00
parent a0a11e3647
commit 9f414731b9
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 7 additions and 7 deletions

View File

@ -12,13 +12,6 @@ async function browserActionClicked() {
await browser.runtime.openOptionsPage(); await browser.runtime.openOptionsPage();
} }
if (import.meta.env.VITE_BROWSER === 'chromium') {
browser.action.onClicked.addListener(browserActionClicked);
} else {
browser.browserAction.onClicked.addListener(browserActionClicked);
void initializeContextMenus();
}
browser.runtime.onInstalled.addListener(async () => { browser.runtime.onInstalled.addListener(async () => {
await initializeContextMenus(); await initializeContextMenus();
await updateBadge(); await updateBadge();
@ -94,3 +87,10 @@ browser.contextMenus.onClicked.addListener(async (info, tab) => {
await contextClicked(contextMenuIds, info, tab); await contextClicked(contextMenuIds, info, tab);
}); });
if (import.meta.env.VITE_BROWSER === 'chromium') {
browser.action.onClicked.addListener(browserActionClicked);
} else {
browser.browserAction.onClicked.addListener(browserActionClicked);
void initializeContextMenus();
}