As part of porting my Table of contents extension to Firefox, I’d like to make sure its (monochrome) icon is legible in both light and dark modes.
As described on the MDN page for the action key, I tried specifying light and dark variants for the theme_icons
:
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "images/toolbar-icon-light-16.png",
"19": "images/toolbar-icon-light-19.png",
[…]
},
"theme_icons": [
{
"light": "images/toolbar-icon-light-16.png",
"dark": "images/toolbar-icon-dark-16.png",
"size": 16
},
{
"light": "images/toolbar-icon-light-19.png",
"dark": "images/toolbar-icon-dark-19.png",
"size": 19
},
[…]
But, Firefox seems to ignore the dark
key: even when I switch my OS to dark mode, and Firefox automatically adapts its theme, the light theme version of the icon still gets used:
(to make sure, I tried changing the URL specified in the light
key of the theme_icons
, and sure enough, that’s the one Firefox is displaying; both in light and dark mode)
This was tried in Firefox 112 on macOS 13.3.1, and in Firefox 112 on Windows 10 19044.2846.
I also first reproduced this issue a few months ago, mid-January, in the Firefox version that was current at the time.
I found some other topics here about the issue, but I can’t see differences between the code they end up successfully using, and mine. Does anyone know what I’m doing wrong?
You can see the full manifest on GitHub.
If you kindly want to reproduce the bug firsthand, you can clone the repo then load the Shared (Extension)/Resources/
folder as an extension.