Firefox插件:扩展图标不显示 [英] Firefox add-on : extension icon not showing
问题描述
我正在使用附加SDK
开发Firefox附加组件。使用SDK时,我的扩展工作正常,但是当我创建 .xpi
文件手动添加到浏览器时,它不显示扩展名图标。
我试图改变 package.json
文件中的图标路径,但仍然没有显示图标。 p>
package.json文件:
{...
$用于显示图标的小部件面板:
icon:Phone-icon48.png,
icon64:Phone-icon64.png,
...}
WidgetPackage.Widget( {
label:Phone Dial,
id:phone_dial,
contentURL:data.url(images / Phone-icon19.png),
panel:panel_name
});
任何人都可以帮我解决这个问题吗?
感谢您。
解决方案这可能是一个持续的错误。 此线程报告类似的问题。 / p>
啊 - 这是解决方法。
你把你的图标放在你的插件目录根目录下的data
文件夹中,并把它们称为,就好像
{...
icon:{16:./icon- 16.png,32:./ icon-32.png,64:./icon-64.png},
...}
当我这样做的时候,图标显示在工具栏中。这是不是很清楚,但如果你一块东西放在一起,的你可能从这里推断出来。
I'm working on developing a Firefox add-on using the
Add-on SDK
. My extension is working fine when using SDK, but when I create the.xpi
file to add it manually to the browser, it does not show the extension icon.I tried to change the icon path in the
package.json
file, but still it didn't shows the icon.package.json file:
{... "icon" : "Phone-icon48.png", "icon64" : "Phone-icon64.png", ...}
Widget panel used to display icon:
WidgetPackage.Widget({ label: "Phone Dial", id: "phone_dial", contentURL: data.url("images/Phone-icon19.png"), panel: panel_name });
Can anyone help me resolve the issue?
Thank You.
解决方案This may be a persistent bug. This thread reports a similar problem.
Ah - here is the solution. You put your icons in a folder called
data
in the root of your addon's directory and call themas if
they were in root.{... icon: { "16": "./icon-16.png", "32":"./icon-32.png", "64": "./icon-64.png" }, ...}
When I did this then the icons show up in the toolbars. It isn't very clear, but if you piece things together, you might deduce that from here.
这篇关于Firefox插件:扩展图标不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!