我已经实现了示例Mozilla Firefox扩展在工具栏上显示Firefox图标(动作按钮),它将打开“http://www.mozilla.org/”。 它在jpm运行中工作正常,然后我创建了使用jpm xpi的包并创建了xpi文件。然后我已经安装在我的Firefox浏览器,并成功安装,但没有工作。 它不能在工具栏上添加Firefox图标(动作按钮)(控制台中没有错误)。Firefox扩展没有显示图标
以下是代码。
index.js
var buttons = require('sdk/ui/button/action');
var tabs = require("sdk/tabs");
var button = buttons.ActionButton({
id: "mozilla-link",
label: "Visit Mozilla",
icon: {
"16": "./icon-16.png",
"32": "./icon-32.png",
"64": "./icon-64.png"
},
onClick: handleClick
});
function handleClick(state) {
tabs.open("http://www.mozilla.org/");
}
的package.json
{
"title": "Sample",
"name": "sample",
"version": "0.0.1",
"description": "Sample AddOn",
"main": "index.js",
"author": "Sample",
"engines": {
"firefox": ">=30.0a1",
"fennec": ">=30.0a1"
},
"license": "MIT"
}
我已经实施使用 - https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_Started_%28jpm%29
请帮助。
感谢
是否使用了设置为永不雷默轮廓mber历史记录(选项 - >隐私 - >历史记录),或以[隐私浏览模式](https://www.mozilla.org/en-US/firefox/private-browsing/)进行。如果是这样,请参阅[Firefox附加组件使用“jpm run”,但不使用“jpm xpi”](http://stackoverflow.com/a/38793196/3773011)生成的随附.xpi文件。 – Makyen