Fixed bug on chromium browsers where creating toggle redirects context menu would fail

This commit is contained in:
Hygna 2022-10-13 22:09:24 +01:00
parent 4709a6667d
commit 11b42fb9dc
No known key found for this signature in database
1 changed files with 13 additions and 5 deletions

View File

@ -164,11 +164,19 @@ browser.contextMenus.create({
contexts: ["browser_action"],
})
browser.contextMenus.create({
id: "toggleTab",
title: browser.i18n.getMessage("toggleTab"),
contexts: ["page", "tab"],
})
try {
browser.contextMenus.create({
id: "toggleTab",
title: browser.i18n.getMessage("toggleTab"),
contexts: ["page", "tab"],
})
} catch {
browser.contextMenus.create({
id: "toggleTab",
title: browser.i18n.getMessage("toggleTab"),
contexts: ["page"],
})
}
browser.contextMenus.create({
id: "redirectLink",