alice0775/userChrome.js — Issue #11: popupTranslate
Author: gorgelot
Created: 2012-01-19 10:23:59+00:00
State: open

HI
You can add that extra code to have an option to call the function from context menu:

/*context menu element start*/

(function (){
var contextMenu = document.getElementById("contentAreaContextMenu");
var translate = document.createElement("menuitem");
translate.setAttribute("id", "context-translate");
translate.setAttribute("label", "popup translate EN");
translate.setAttribute("oncommand","popupTranslate.onCommand(false);");

contextMenu.insertBefore(translate, document.getElementById("context-stop"));
})();

(function (){
var contextMenu = document.getElementById("contentAreaContextMenu");
var translate = document.createElement("menuitem");
translate.setAttribute("id", "context-translateJ");
translate.setAttribute("label", "popup translate JA");
translate.setAttribute("oncommand","popupTranslate.onCommand(true);");

contextMenu.insertBefore(translate, document.getElementById("context-stop"));
})();

/*context menu element end*/