mirror of
https://github.com/zadam/trilium.git
synced 2026-02-03 20:34:24 +01:00
fix(web-clipper): context menu got broken on Firefox
This commit is contained in:
parent
a854b04300
commit
af6c54bac7
@ -31,12 +31,11 @@ const CONTEXT_MENU_ITEMS: Browser.contextMenus.CreateProperties[] = [
|
||||
}
|
||||
];
|
||||
|
||||
export default function setupContextMenu() {
|
||||
export default async function setupContextMenu() {
|
||||
// Context menu items need to be registered only once.
|
||||
// https://stackoverflow.com/questions/64318529/cannot-create-item-with-duplicate-context-menu-id-in-extension
|
||||
browser.runtime.onInstalled.addListener(() => {
|
||||
for (const item of CONTEXT_MENU_ITEMS) {
|
||||
browser.contextMenus.create(item);
|
||||
}
|
||||
});
|
||||
await browser.contextMenus.removeAll();
|
||||
for (const item of CONTEXT_MENU_ITEMS) {
|
||||
browser.contextMenus.create(item);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user