MurzNN/TST-Colored-tabs

Separate out "dark settings" and "light settings", for themes that automatically switch between dark/light settings based on OS

ELLIOTTCABLE opened this issue · 0 comments

The built-in "System theme" FireFox theme ('Follow the system theme …'), along with a few others (such as Firefox Alpenglow include a dark_theme manifest-entry; which is then used whenever the operating-system is set to "dark mode":

Screen Shot 2021-09-30 at 1 47 37 PM

Unfortunately, since TST-Colored-Tabs only supports one set of colour settings, you're pretty much guaranteed for those settings to look terrible on whichever background they're not catering to:

Screen Shot 2021-09-30 at 1 48 17 PM

There's not currently an API to explicitly determine whether the theme is "dark" mode or "light" mode; but you can use browser.theme.getCurrent() to extract the current settings, and add a listener to browser.theme.onUpdated to be notified whenever the system-theme changes; there's a good example of this in the firefox-audio-compressor addon:

https://github.com/vatara/firefox-audio-compressor/blob/91312ccd46eaf588295316b83301b6f280a41f12/src/background.js#L36-L64

Further reading: https://bugzilla.mozilla.org/show_bug.cgi?id=1542044