addon-compatibility-reporter icon indicating copy to clipboard operation
addon-compatibility-reporter copied to clipboard

Support SVG icons

Open NiklasGollenstede opened this issue 7 years ago • 6 comments

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';

NiklasGollenstede avatar Apr 05 '17 22:04 NiklasGollenstede

Nice! Would you mind submitting a PR?

wagnerand avatar Apr 11 '17 13:04 wagnerand

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.

NiklasGollenstede avatar Apr 11 '17 17:04 NiklasGollenstede

I don't know what the reason for that is, or if there is even a reason.

wagnerand avatar Apr 11 '17 17:04 wagnerand

So, should I try it, or is this a "don't fix it if it ain't broke" thing?

NiklasGollenstede avatar Apr 11 '17 17:04 NiklasGollenstede

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 :)

wagnerand avatar Apr 11 '17 17:04 wagnerand

Ok. I'll do that

NiklasGollenstede avatar Apr 11 '17 17:04 NiklasGollenstede