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