无法创建Firefox上下文菜单

时间:2017-12-12 13:34:01

标签: javascript firefox-addon mozilla

我一直在尝试创建一个Firefox插件,从Instagram下载图片/视频/画廊。想法是右键单击 - >上下文菜单 - >下载媒体。到目前为止,我还没有能够创建(上下文)菜单。

borderify.js(主脚本)

function mcreated(){
console.log("maybe it worked");
}

console.log("HELLOHELLO");

browser.menus.create({
    id: "contextDownloadMenu",
    title: "DOWNLOADHERE",
    contexts: ["all"]
}, mcreated());

console.log(browser.runtime.lastError);

的manifest.json

{

  "manifest_version": 2,
  "name": "Borderify",
  "version": "1.0",

  "description": "please no",

  "content_scripts": [
    {
      "matches": ["*://*.instagram.com/*"],
      "js": ["borderify.js"]
    }
  ],

  "permissions": ["menus"]

}

我进入控制台的输出是" HELLOHELLO",没有别的。没有错误或其他任何错误。

我已经完成了所有操作,如mozillas指南https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus所示

0 个答案:

没有答案
相关问题