removed old menu creation code

This commit is contained in:
mic 2025-04-11 23:11:25 +02:00
parent b707096ed8
commit e21b68c240

View file

@ -66,9 +66,9 @@ export class mzta_Menus {
} }
async reload(also_special = []) { async reload(also_special = []) {
await browser.menus.removeAll().catch(error => { // await browser.menus.removeAll().catch(error => {
console.error("[ThunderAI] ERROR removing the menus: ", error); // console.error("[ThunderAI] ERROR removing the menus: ", error);
}); // });
this.removeClickListener(); this.removeClickListener();
this.loadMenus(also_special); this.loadMenus(also_special);
} }
@ -314,16 +314,16 @@ export class mzta_Menus {
this.logger.log("addMenu: " + id); this.logger.log("addMenu: " + id);
await new Promise(resolve => // await new Promise(resolve =>
browser.menus.create({ // browser.menus.create({
id: id, // id: id,
title: this.getCustomTextAttribute(id) + is_default == 1 ? (browser.i18n.getMessage(id) || name) : name, // title: this.getCustomTextAttribute(id) + is_default == 1 ? (browser.i18n.getMessage(id) || name) : name,
contexts: this.getContexts(id), // contexts: this.getContexts(id),
parentId: root // parentId: root
}, // },
resolve // resolve
) // )
); // );
if (act) { if (act) {
this.menu_listeners[id] = act; this.menu_listeners[id] = act;