【发布时间】:2016-01-13 13:43:20
【问题描述】:
我正在尝试为 Firefox 编写插件。为此,我使用 Mozilla“Addon-SDK”。
当我使用“jpm run”功能时一切正常。但是一旦我将它打包到 xpi 并安装它,图标就不会出现在工具栏中。这似乎是 SDK 中的一个错误。
我已经尝试了其他博客文章中的各种解决方法。
- 编辑 package.json
- 重命名为“图标”
- 移动到数据
- 将图标移至根目录
- 绝对路径
- 在 rdf 中编辑 firefox 版本
- 正在调试 Index.js...
这里最有用:
Firefox add-on : extension icon not showing
https://github.com/mozilla-jetpack/jpm/issues/197
由于 Firefox 43 插件必须经过验证。我这样做了。我还禁用了 about:config 中的功能,以便我可以更快地尝试新版本。仍然没有运气。
这是我在 index.js 中的代码:根据答案进行了编辑,但仍然无法正常工作
var button = buttons.ActionButton(
{
id: "MorastLink",
label: "In den Morast",
icon:
{
"16": "./images/icon16.png",
"32": "./images/icon32.png",
"64": "./images/icon64.png"
},
onClick: CopyToMorast
});
这里我也试过了,移动路径,改名字,使用绝对路径……
这是我的 package.json
{
"title": "Morast",
"name": "morastaddon",
"version": "0.1.4",
"description": "An Addon to insert a \"Add to Morast\" button on distributer sites.",
"main": "index.js",
"author": "Lisa Austen",
"icon": "ressource://@morastaddon/data/images/icon16.png",
"icon64": "ressource://@morastaddon/data/images/icon64.png",
"engines": {
"firefox": ">=38.0a1",
"fennec": ">=38.0a1" },
"license": "MIT",
"keywords": [
"jetpack"
]
}
【问题讨论】:
-
我试过了。它没有工作
标签: javascript firefox firefox-addon firefox-addon-sdk jpm