addon-compatibility-reporter
addon-compatibility-reporter copied to clipboard
Support SVG icons
The add-on icons in the pop-up-panel are linked as data:image/png;base64,...
.
That doesn't work for SVG-icons (which are otherwise supported by Firefox).
Changing the mime-type fixes that. To determine a better mimetype than just assuming image/png
, I'd suggest something like:
const mimeType = ({
bmp: 'image/bmp',
gif: 'image/gif',
ico: 'image/x-icon',
jpeg: 'image/jpeg',
jpg: 'image/jpeg',
png: 'image/png',
svg: 'image/svg+xml',
})[iconPath.split('.').pop()] || 'image/png';
Nice! Would you mind submitting a PR?
Not at all. Is there a reason why this isn't using blob:
URLs?
I think if garbage collected on unload, they only have advantages.
If that's fine with you, I'd use those instead.
I don't know what the reason for that is, or if there is even a reason.
So, should I try it, or is this a "don't fix it if it ain't broke" thing?
Feel free to give it a try, but please test it extensively, too. The add-on has a lot of users, and we need to make sure it doesn't break :)
Ok. I'll do that