install.rdf should support relative uris for iconURL and icon64URL

RESOLVED WONTFIX

Status

()

Toolkit
Add-ons Manager
RESOLVED WONTFIX
3 years ago
5 months ago

People

(Reporter: erikvold, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

At the moment it appears that the iconURL only supports absolute paths and the default path:

https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIProvider.jsm#6710-6719

we should also support relative paths.
Blocks: 1034413

Comment 1

3 years ago
I did a bit of searching and came across a comment in XPIProvider.jsm, which claims that using a relative URL causes issues on Windows:

https://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIProvider.jsm#5206-5210

That seems like an odd claim seeing as a direct reference to "icon.png" is OK in the code referenced by evold. Further research is needed.

Comment 2

3 years ago
The release of Firefox 38 and therefore the adoption of jpm is getting really close now, but the last comment here was over a month ago. TBH this seems a much too important and ridiculously easily solved bug to go unfixed when the release happens. How is progress on this going? I'd really rather not keep redundant copies of my icon files in the root of my addon when I use the same files from the data dir for notifications and such too.
(In reply to marnick.leau from comment #2)
> The release of Firefox 38 and therefore the adoption of jpm is getting
> really close now, but the last comment here was over a month ago. TBH this
> seems a much too important and ridiculously easily solved bug to go unfixed
> when the release happens. How is progress on this going? I'd really rather
> not keep redundant copies of my icon files in the root of my addon when I
> use the same files from the data dir for notifications and such too.

As a workaround I would suggest using the default icon locations and getting that location with this little hack:

    var iconURL = require.resolve("package.json").replace(/package\.json$/, "icon.png");
> I did a bit of searching and came across a comment in XPIProvider.jsm, which claims that using a relative URL causes issues on Windows:

I guess Daniel Jost is talking about this comment?

https://dxr.mozilla.org/mozilla-central/rev/91100de4f2ad/toolkit/mozapps/extensions/internal/XPIProvider.jsm#5206-5210

This comment comes from bug568480. That bug does not look like a relative path issue for me.
Pinging Mossop, he might know more. If someone were to take this on do you think we could find a way to finally fix this?
Flags: needinfo?(dtownsend)
(In reply to Johann Hofmann [:johannh] from comment #5)
> Pinging Mossop, he might know more. If someone were to take this on do you
> think we could find a way to finally fix this?

Yes that comment is talking about bug 568480, it only applies to the icon used before the add-on is finally installed.
Flags: needinfo?(dtownsend)
Created attachment 8739847 [details] [diff] [review]
A possible fix

Here's a possible fix. Just like what I've done in jpm - wrap the icon URL if it's a relative one.

Comment 8

5 months ago
We no longer support install.rdf
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.