Extension sidebar themed background missing [web accessible resources]
Categories
(WebExtensions :: Frontend, defect, P1)
Tracking
(firefox-esr91 unaffected, firefox-esr102 unaffected, firefox104 unaffected, firefox105 verified, firefox106 verified)
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox-esr102 | --- | unaffected |
firefox104 | --- | unaffected |
firefox105 | --- | verified |
firefox106 | --- | verified |
People
(Reporter: TheOne, Assigned: mixedpuppy)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [addons-jira])
Attachments
(7 files)
In 105, the extension sidebar background is no longer styled according to the installed theme.
STR:
- Install TreeStyleTab https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/
- Go to its preferences, under Appearance select the "Proton" style
- Install the official Firefox Alpenglow theme https://addons.mozilla.org/en-US/firefox/addon/firefox-alpenglow/
- Open the TreeStyleTab sidebar
Expected results:
Themed background color, see before image.
Actual results:
Solid light-grey background color, see after image.
Reporter | ||
Comment 1•3 years ago
|
||
Comment 2•3 years ago
|
||
Set release status flags based on info from the regressing bug 1773115
:mixedpuppy, since you are the author of the regressor, bug 1773115, could you take a look?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 3•3 years ago
|
||
It appears to style with other themes, like https://addons.mozilla.org/en-US/firefox/addon/plum-torte
It is accessing an image from alpenglow to figure out a color. We'll have to decide what we want to do about addons accessing theme resources like that, but for now I think it's low priority.
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
Comment 5•3 years ago
|
||
(In reply to Shane Caraveo (:mixedpuppy) from comment #3)
It appears to style with other themes, like https://addons.mozilla.org/en-US/firefox/addon/plum-torte
It is accessing an image from alpenglow to figure out a color. We'll have to decide what we want to do about addons accessing theme resources like that, but for now I think it's low priority.
That looks like a reasonable use case for accessing (third-party) theme images from an extension.
I already identified the discrepancy between the theme.getCurrent
and theme.update
API in bug 1618563. Relevant part copied from https://bugzilla.mozilla.org/show_bug.cgi?id=1618563#c2 is:
The definition of the
theme.Theme
type (i.e. the parameter passed totheme.update
and returned bytheme.getCurrent
) is here: https://searchfox.org/mozilla-central/rev/13b081a62d3f3e3e3120f95564529257b0bf451c/toolkit/components/extensions/schemas/theme.json#85,90,95,99The
ImageDataOrExtensionURL
means that the value should be a data-URL or a relative URL.This issue could be fixed by either ensuring that
theme.getCurrent()
returns relative URLs,
or by relaxing the type to support absolute moz-extension:-URLs.If absolute
moz-extension:
-URLs were to be supported, we also need to account for the fact that amoz-extension:
-URLs can point to another extension. At least initially, I would rejectmoz-extension:
-URLs from other extensions until there is demand for the ability to read and modify a theme from another extension. If we do need to support themes from other extensions, then we need to apply logic similar to what we have for thefavIconUrl
property in thebrowser.search.get
API.
So... do we want to go down the route of converting to data:-URLs? If yes, then we would have to relax the data:-URL validation to permit other (image) types besides PNG/JPG (bug 1491790).
An alternative way to solve this specific use case is to allow extensions with the "theme" permission to load non-web-accessible theme resources. I can imagine the logic getting too complicated, so a more general fix may be more desirable.
Comment 6•3 years ago
|
||
Updating regressed-by. The two bugs were resolved by one patch stack that landed together*, but the first in the stack looks like the most likely cause of the regression.
Comment 7•3 years ago
|
||
Hi Rob, is this something we're planning to address in Fx105 before it goes to RC in a couple weeks?
Comment 8•3 years ago
|
||
After discussing this bug today, we decided to go for the following approach:
- When a moz-extension to moz-extension request is blocked (i.e. this logic does not cover requests from web content),
- and the requesting extension has the "theme" permission,
- and the receiving extension is a static theme *,
- and the requested resource is an image (e.g. image file extension, or even the registered images in the manifest.json file),
- allow the load to proceed.
* The above logic would solve the issue for common cases. It does not fix the bug for dynamic themes, because we did not want to dynamically change the set of extension-accessible content at runtime in response to browser.theme.update
calls from the source extension.
Assigning to Shane, Luca said that he can pick it up if Shane cannot get to it.
Comment 9•3 years ago
|
||
Hey [:mixedpuppy], just checking to see if there are any updates on this and if he have some hope of pushing a bug in the next few days. Thanks!
Assignee | ||
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Patch is about to land. We'll request an uplift after that.
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
Comment 14•3 years ago
|
||
The patch landed in nightly and beta is affected.
:mixedpuppy, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox105
towontfix
.
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 15•3 years ago
|
||
Comment on attachment 9293388 [details]
Bug 1786564 allow access to static theme resources in extensions
Beta/Release Uplift Approval Request
- User impact if declined: A feature of addons allows them to query the current theme so they can retheme themselves to be similar to the browser. Sometimes this involves access to e.g. images in a theme extension. This regression prevents that use case, resulting in e.g. sidebar addons like tab managers being unable to match the browser theme. Depending on how well an addon is written it should recover, however this could otherwise result in additional breakage in an addon.
I am not aware of normally visible UI on android that would have a highly visible affect that users would see, thus I am unsure if android is affected in any meaningful way.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: Steps are in the bug but this is the simple version
- install tree style tab
- install alpenglow theme
expected:
tree style tab sidebar matches alpenglow theme
actual:
tree style tab remains themed per prior theme
- List of other uplifts needed: None
- Risk to taking this patch: Medium
- Why is the change risky/not risky? (and alternatives if risky): I've chosen medium because it is c++ code, however the change in minimal
- String changes made/needed: none
- Is Android affected?: Unknown
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 16•3 years ago
•
|
||
QE: I did forget a step in the beta request, refer to comment 0 for the full STR
Comment 17•3 years ago
|
||
Comment on attachment 9293388 [details]
Bug 1786564 allow access to static theme resources in extensions
Fixes a user-facing regression in the common case. Approved for 105.0b9.
Comment 18•3 years ago
|
||
bugherder uplift |
Comment 19•3 years ago
|
||
Verified as Fixed on the latest Nightly (106.0a1/20220908213354) and Beta (105.0b9/20220908185813) under Windows 10 x64 and Ubuntu 16.04 LTS.
The background of the sidebar is now styled according to the installed theme, confirming the fix.
For further details, see the attached screenshots.
Updated•3 years ago
|
Comment 20•3 years ago
|
||
Comment 21•3 years ago
|
||
Comment 22•3 years ago
|
||
Update:
It seems that the theme sidebar styling is not applied in Private Windows.
STR:
- Install Tree Style Tab: https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/
- Go to its preferences, under Appearance select the "Proton" style
- Install, for example, this theme: https://addons.mozilla.org/en-US/firefox/addon/orchidestra/ OR this one https://addons.mozilla.org/en-US/firefox/addon/american-style-4th-of-july/
- Notice that the styling of the sidebar is in accordance to the applied theme
- Grant Tree Style Tab access to Private Windows
- Open a Private Window
- Open the Tree Style Tab sidebar in the Private Window
- Notice the color of the sidebar background is a solid color instead of the theme styling as in the Normal Window
Both the latest Nightly (106.0a1/20220908213354) and Beta (105.0b9/20220908185813) are affected by this.
Latest Release (104.0.2/20220902153754) is not affected.
Comment 23•3 years ago
|
||
Comment 24•3 years ago
|
||
Description
•