Firefox addon Firefox ContextMenus.OnClick事件未触发,获取错误

Firefox addon Firefox ContextMenus.OnClick事件未触发,获取错误,firefox-addon,firefox-addon-webextensions,Firefox Addon,Firefox Addon Webextensions,舱单: { "manifest_version": 2, "name": "Copy As", "version": "1.0", "description": "Adds a right click option to quickly convert a macaddress and search ecoverage for an installat

舱单:

{
  "manifest_version": 2,
  "name": "Copy As",
  "version": "1.0",
  "description": "Adds a right click option to quickly convert a macaddress and search ecoverage for an installation address.",
  "background": {
    "scripts": ["background.js"]
  },
  "permissions": ["contextMenus","clipboardWrite"]
}
背景:

browser.contextMenus.create({
  id: "conMacProv",
  title: "ProvisionLink MAC",
  contexts: ["selection"]
});

browser.contextMenus.create({
  id: "conMacDev",
  title: "DevStat MAC",
  contexts: ["selection"]
});

browser.contextMenus.create({
  id: "conWimaxStarQ",
  title: "Wimax - StarQuality",
  contexts: ["selection"]
});

browser.contextMenus.create({
  id: "conHex",
  title: "Hex",
  contexts: ["selection"]
});

browser.contextMenus.onClicked.addListener(function (info, tab) {
  console.log(info);
  console.log("test");
});
菜单项已创建,但单击这些项不会生成控制台日志。 我使用的是FF 56.0.1

忽略以下内容:

此外,此脚本还会出现以下控制台错误:

传递给getElementById()的空字符串。main.7d260b3049ff.js:2:7526


尝试按如下方式添加您的侦听器:

browser.contextMenus.onClicked.addListener((info, tab) => {
    console.log("Item " + info.menuItemId + " clicked " +  "in tab " + tab.id);
});

好的,我现在明白了,这个错误只与在mozilla开发者网站上运行有关。因此,这可能与onClicked事件不起作用的原因无关