WebExtensions theme API doesn't provide actual toolbar icons color
Categories
(WebExtensions :: Themes, defect)
Tracking
(firefox141 affected)
| Tracking | Status | |
|---|---|---|
| firefox141 | --- | affected |
People
(Reporter: teaschuldorf, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0
Steps to reproduce:
I have implemented an add-on with a toolbar icon, which should use the toolbar icons color.
Previously I was using (await browser.theme.getCurrent()).colors?.icons
Actual results:
Since the vertical tabs are implemented, the toolbar icons color can no longer be reliably queried.
It is either defined by the colors.icons or colors.tab_background_text
Expected results:
There should be an additional property which should always reflect the actual color of toolbar icons and fire browser.theme.onUpdated on enabling/disabling vertical tabs.
Comment 1•5 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Theme' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•5 months ago
|
||
Hello! I have tried to reproduce the issue with firefox 141.0a1(2025-06-11) on Windows 10, Unfortunately I wasn't able to reproduce the issue on my end.
Could you please answer the following questions in order to further investigate this issue?
- Does this issue happen with a new profile? Here is a link on how to create one: https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles
- Could you please attach a screen recording of the issue?
- Do you have any addons installed? If yes could you please list them?
Ok, I have created a new clean profile and installed Firefox Color as the only add-on and modified the toolbar color to pure red.
The color seems to be specified in toolbar_text.
As you can see, the toolbar color changes when switching to vertical tabs. However, the toolbar_text does not.
Here is a screen recording: http://filestorage.5fl.de/Aufzeichnung-2025-06-16-162631.mp4
At the end, this may be considered as a feature request to be able to easily create an add-on toolbar icon which matches the default toolbar icon color.
Currently, I'm tinting the icon manually, but if there would be a "monochrome" flag automatically using the default toolbar icon color, this would be perfectly fine as well. In fact, it's IMHO quite a pain that add-on developers are forced to invent ugly workarounds to create add-on icons which doesn't look completely off in the toolbar.
Updated•5 months ago
|
Comment 4•5 months ago
|
||
Hello! Thank you for the screen recording.
I have managed to reproduce the issue with firefox 141.0a1(2025-06-19) on Ubuntu 22.04, Windows 10 and MacOS 15.5.
Marking this issue as NEW in order to get our developers involved and provide a solution for this issue.
Have a nice day!
Comment 5•5 months ago
•
|
||
(In reply to Florian from comment #0)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0
Steps to reproduce:
I have implemented an add-on with a toolbar icon, which should use the toolbar icons color.
Previously I was using (await browser.theme.getCurrent()).colors?.icons
Actual results:
Since the vertical tabs are implemented, the toolbar icons color can no longer be reliably queried.
It is either defined by the colors.icons or colors.tab_background_text
(In reply to Florian from comment #3)
Ok, I have created a new clean profile and installed Firefox Color as the only add-on and modified the toolbar color to pure red.
The color seems to be specified in
toolbar_text.As you can see, the toolbar color changes when switching to vertical tabs. However, the
toolbar_textdoes not.
This is expected given the nature of the API. It's not meant to expose what color is used in any given surface, but rather what properties the theme specified. Firefox then takes these properties and decides where exactly it's going to use them. tab_background_text is the foreground color that's meant to be used on top of the frame background, which designers decided to use for toolbars in vertical tabs mode. Using icons on top of frame might make icons hard to see in that context, depending on the theme.
I'll move this to WebExtensions::Themes, but expect this will be closed as invalid.
This is expected given the nature of the API.
This may actually be the case :/
[...] but expect this will be closed as invalid.
Please don't just close it but at least track it as feature request if this is the expected behavior. We definitely need a way to style extention toolbar icons properly.
Comment 7•5 months ago
|
||
We are going to add a property to enable extensions to query whether vertical tabs are enabled (bug 1946600). Would that address your use case?
Adding a vertical tabs property is already a huge win and may allow to build workarounds.
Still this creates a huge mess of guessing the correct toolbar icon color, and I'm not sure if there are more cases where the color may be determined by different factors.
Ideally, the real toolbar icon color should just be exposed.
May we track that request here or should I open a new request for enhancement?
Comment 9•5 months ago
|
||
It is already a known issue that theme.getCurrent() does not return the effective colors (bug 1435216).
There is also a general issue that tracks support for themes in the sidebar, in bug 1946511.
If bug 1946600 addresses your issue, I'm inclined to close this bug and not file a new one.
Does that sounds good to you, or is there some other actionable task here that we can address before closing the bug?
| Reporter | ||
Comment 10•5 months ago
|
||
If bug 1946600 would mean I have to add the "browserSettings" permission just to theme the toolbar icon correctly, I believe this wouldn't be an ideal solution.
The more I think about it, having monochrome icon support for add-ons (add-on toolbar icon would color automatically to align to the rest of the toolbar) would be ideal.
However, can't estimate whether this is a realistic request :)
Comment 11•5 months ago
|
||
(In reply to Florian from comment #10)
The more I think about it, having monochrome icon support for add-ons (add-on toolbar icon would color automatically to align to the rest of the toolbar) would be ideal.
However, can't estimate whether this is a realistic request :)
That's bug 1367042 I believe.
| Reporter | ||
Comment 12•5 months ago
|
||
That's bug 1367042 I believe.
Yes, exactly. Very sad that it has not been considered yet though...
Description
•