From 9558bb49eb7e5e9a02b828881db91a2ae98caaa7 Mon Sep 17 00:00:00 2001 From: sienori Date: Sat, 2 Jun 2018 23:47:41 +0900 Subject: [PATCH] Add menu item "translate this page" to tab menu --- simple-translate/background.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/simple-translate/background.js b/simple-translate/background.js index fd7ef31..9b83317 100644 --- a/simple-translate/background.js +++ b/simple-translate/background.js @@ -27,6 +27,12 @@ function showMenu() { //メニューを表示 function menuCreate() { + browser.contextMenus.create({ + id: "translatePageOnTab", + title: browser.i18n.getMessage("translatePageMenu"), + contexts: ["tab"], + }); + browser.contextMenus.create({ id: "translatePage", title: browser.i18n.getMessage("translatePageMenu"), @@ -56,6 +62,7 @@ function menuRemove() { browser.contextMenus.onClicked.addListener(function (info, tab) { switch (info.menuItemId) { case "translatePage": + case "translatePageOnTab": translatePageMenu(info, tab); break; case "translateText":