Neat-URL
Neat-URL copied to clipboard
Support adaptive theming for icon
Firefox uses adaptive theming which can change depending on the system theme or time of day. Manually changing the icon is tedious and results in the icon hard to see when the opposite theme is used.
For example, light theme with the light icon is very hard to see (theme: the new Firefox Alpenglow):
Thank you for your idea.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/theme/getCurrent browser.theme.getCurrent() seems to return an object with a color code, for example
"theme": {
"images": {
"theme_frame": "images/sun.jpg"
},
"colors": {
"frame": "#CF723F",
"tab_background_text": "#000"
}
}
Using theme.colors.tab_background_text is probably the easiest.
Option two: perceived brightness (based on theme.colors.frame) might help as well. https://stackoverflow.com/questions/12043187/how-to-check-if-hex-color-is-too-black
@Smile4ever I haven't worked on addons, but it looks like you can declare your icons for the two different themes types in your manifest.json: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action#Syntax