It should work in all sizes/HiDPI-compatible, i.e. I want to use an SVG.
The style guide says I should use colors with transparency. How can I do that in my extension?
The design is a simple one (i.e. no borders, which would just be distracting). The problem is that I either have to make it black or white. In any case is not visible in one of the (Firefox default) themes.
I know I can set it with browserAction.setIcon, but for this I need two icons now and need to detect the theme/color of the theme and whether it is rather light or dark.
Is not there a better/recommend way?
As for the last thing I tried to set the SVG to context-fill, hoping it would automatically use the correct color, but it did not do so.
It’s already stupid to have to specify a size for the SVG, but well… Firefox should fall back to that file for any size then.
However as MDN says “You need to supply an ThemeIcons in size 16 and one in size 32 (for retina display).” (which, BTW, kinda is contrary to the statement that the key is “an array containing at least one ThemeIcons object”), so I also tried this (without any luck) for “theme_icons”:
For default_icons you can just omit the object for SVGs. theme_icons sadly doesn’t properly support just about anything currently (and was looked at as a stop-gap, which is also why it’s only supported on browser_actions).
However, now there are sad news as I just noticed: The theme_icons is not available for the page_action.
So this is strange: You can correctly apply the browser action icon (/color), but not the page icon?
IMHO that makes no sense, as your own guide also explains that you should use different colors there, too, for the icon depending on the theme. So when add-ons cannot do this, this is bad.