5

I can't seem to get my addon icon to show up when I use jpm. The relevant items in package.json are

"icon": "icon.png",
"icon64": "icon64.png",

and when I unpack the extension, I see them in install.rdf as

<em:iconURL>icon.png</em:iconURL>
<em:icon64URL>icon64.png</em:icon64URL>

They are 48x48 and 64x64px png files, respectively.

Both of those files are in the root directory of the extension. If I read the docs correctly, I shouldn't even have to specify those names, as they are the default.

I don't see any extension icon in the Addons-manager. What am I doing wrong?

willlma
  • 7,353
  • 2
  • 30
  • 45
  • [icon64 is deprecated](https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#icon64) and "`not available when using jpm.`" – Useless Code May 19 '15 at 02:33

3 Answers3

5

This is a known issue with jpm, and I just updated that bug report asking for an update on what we can do about it. It's a mystery to me why it doesn't work as-is.

therealjeffg
  • 5,790
  • 1
  • 23
  • 24
  • Is this fixed? Because I am still having problems trying to get this to work. `resource://@your-addon-name/data/your-icon-name.png` fails. My package.json has an GUID because the web-based add-on verifier at AMO says I need to use my existing GUID. I tried @{GUID}, @GUID, GUID, with and without /data/ (as the same logos used for interface button and about page are in /data/). But I can't seem to get any of those logos to appear as well. Tried with and without a name defined in package.json and @name in uri with /data/, icon in /data/ but without /data/ in uri, and in root. jpm git master 1.0.7 –  Jun 29 '16 at 13:49
3

it's a bug.

If you're working on jpm 1.0.1, the only way it works is:

"icon": "resource://@youraddonname/icon.png",

rename your icon as "icon". Don't know why it works that way..

montjoile
  • 119
  • 1
  • 17
  • It has been a few months, and @montjoile's answer is still the way to do it – tofutim Mar 25 '16 at 22:07
  • Keep in mind that if you define an id on your package.json then you need to insert the id. For example with an id : "{abcd......cdef}" the link is "resource://abcd......cdef/icon.png". – GramThanos May 04 '16 at 19:50
0

For new jpm tool, you can use like this:

"icon :" "resource://<ADDONID>/data/icon.png"

Note: In cfx you have id that is some things like jid1-O1iNqbs7ifwqvA but in new jpm tool , we dont have any id, instead the name field use instead of @jetpack...

for example for an old cfx addon with id of jid1-O1iNqbs7ifwqvA we must do like this

"id": "jid1-O1iNqbs7ifwqvA@jetpack",
"icon": "resource://jid1-O1iNqbs7ifwqvA-at-jetpack/data/icon.png"

also you can add icons for menu bar, addon page, open menu Menu like below:

"icons":{
"16":"./data/icon-16.png",
"32":"./data/icon-32.png",
"64":"./data/icon-64.png",
"128":"./data/icon-128.png",
"256":"./data/icon-256.png",
"512":"./data/icon-512.png"
},

useful Links:

Mostafa
  • 815
  • 1
  • 13
  • 23