Add menu item "translate this page" to tab menu

This commit is contained in:
sienori 2018-06-02 23:47:41 +09:00
parent 2ccc55da0f
commit 9558bb49eb

View file

@ -27,6 +27,12 @@ function showMenu() {
//メニューを表示 //メニューを表示
function menuCreate() { function menuCreate() {
browser.contextMenus.create({
id: "translatePageOnTab",
title: browser.i18n.getMessage("translatePageMenu"),
contexts: ["tab"],
});
browser.contextMenus.create({ browser.contextMenus.create({
id: "translatePage", id: "translatePage",
title: browser.i18n.getMessage("translatePageMenu"), title: browser.i18n.getMessage("translatePageMenu"),
@ -56,6 +62,7 @@ function menuRemove() {
browser.contextMenus.onClicked.addListener(function (info, tab) { browser.contextMenus.onClicked.addListener(function (info, tab) {
switch (info.menuItemId) { switch (info.menuItemId) {
case "translatePage": case "translatePage":
case "translatePageOnTab":
translatePageMenu(info, tab); translatePageMenu(info, tab);
break; break;
case "translateText": case "translateText":