[PALEMOON] [DevTools] Added support of the appmenu for DevTools menuitems (follow up)

Issue #96
Issue #102
This commit is contained in:
janekptacijarabaci 2018-04-08 21:55:44 +02:00 committed by Roy Tam
commit c166a0abd4
3 changed files with 87 additions and 20 deletions

View file

@ -133,10 +133,11 @@ function attachKeybindingsToBrowser(doc, keys) {
*/
function createToolMenuElements(toolDefinition, doc) {
let id = toolDefinition.id;
let appmenuId = "appmenuitem_" + id;
let menuId = "menuitem_" + id;
// Prevent multiple entries for the same tool.
if (doc.getElementById(menuId)) {
if (doc.getElementById(appmenuId) || doc.getElementById(menuId)) {
return;
}
@ -321,6 +322,7 @@ function addTopLevelItems(doc) {
doc,
id: "app" + id,
label: l10n(l10nKey + ".label"),
accesskey: null,
isCheckbox: item.checkbox
});
let menuitem = createMenuItem({