10

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.

LondonAppDev
  • 8,501
  • 8
  • 60
  • 87
Dhiraj Rode
  • 101
  • 1
  • 7
  • Not sure what you mean - is the icon missing for the widget, in the addon manager, both? For the widget icon, does the file actually exist in your add-on project at 'data/images/Phone-icon19.png'??? – therealjeffg Oct 15 '13 at 17:34
  • Yes, the icon is missing for the widget, but it is missing only when the extension is added using the .xpi file. when I run extension using the 'cfx run' the icon is showing. The phone icon image is exist in the data directory. – Dhiraj Rode Oct 16 '13 at 05:40
  • I have the same problem. And the icon do shows in the add-ons manager. –  Sep 02 '14 at 15:59

3 Answers3

3

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 them as 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.

Community
  • 1
  • 1
bgmCoder
  • 6,205
  • 8
  • 58
  • 105
2

According to Addon SDK docs:

The relative path from the root of the add-on to a PNG file containing the icon for the add-on. Defaults to "icon.png".

So your package.json should look like this:

{...
  "icon"        : "data/images/Phone-icon48.png",
  "icon64"      : "data/images/Phone-icon64.png",
...}
matagus
  • 6,136
  • 2
  • 26
  • 39
0

A seemingly related issue was closed earlier, yet it happens to me today

A workaround with jpm 1.1.4 and Firefox 48/50:

  • Name the icon icon.png and place it in root dir of addon.
  • Write no "icon": ... entry in package.json (thus no <em:icon> in install.rdf)
Jokester
  • 5,501
  • 3
  • 31
  • 39