Fix contextMenus not working on chromium
This commit is contained in:
parent
0ac4e71445
commit
a2c9d1f50c
@ -24,7 +24,7 @@
|
|||||||
"webRequestBlocking",
|
"webRequestBlocking",
|
||||||
"storage",
|
"storage",
|
||||||
"cookies",
|
"cookies",
|
||||||
"menus",
|
"contextMenus",
|
||||||
"<all_urls>"
|
"<all_urls>"
|
||||||
],
|
],
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
|
@ -253,19 +253,19 @@ browser.commands.onCommand.addListener(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
browser.menus.create({
|
browser.contextMenus.create({
|
||||||
id: "settings",
|
id: "settings",
|
||||||
title: browser.i18n.getMessage("Settings"),
|
title: browser.i18n.getMessage("Settings"),
|
||||||
contexts: ["browser_action"]
|
contexts: ["browser_action"]
|
||||||
});
|
});
|
||||||
|
|
||||||
browser.menus.create({
|
browser.contextMenus.create({
|
||||||
id: "switchInstance",
|
id: "switchInstance",
|
||||||
title: chrome.i18n.getMessage("switchInstance"),
|
title: chrome.i18n.getMessage("switchInstance"),
|
||||||
contexts: ["browser_action"]
|
contexts: ["browser_action"]
|
||||||
});
|
});
|
||||||
|
|
||||||
browser.menus.onClicked.addListener((info, tab) => {
|
browser.contextMenus.onClicked.addListener((info, tab) => {
|
||||||
if (info.menuItemId == 'switchInstance') {
|
if (info.menuItemId == 'switchInstance') {
|
||||||
let url;
|
let url;
|
||||||
try { url = new URL(tab.url); }
|
try { url = new URL(tab.url); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user