Reader mode auto dark vs light theme mode doesn't always stay in automatic mode / doesn't follow future system theme changes
Categories
(Toolkit :: Reader Mode, defect)
Tracking
()
People
(Reporter: nekohayo, Unassigned, NeedInfo)
References
Details
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0
Steps to reproduce:
As per bug #1594828, in about:config :
reader.improvements_H12022.enabled = True
reader.color_scheme = auto
(or set it using the Auto button in the reader mode settings UI)
Actual results:
It works... most of the time. For some reason I don't quite understand, sometimes when my system/firefox theme changes again, reader.color_scheme gets set to "dark" or "light" and remains so.
Expected results:
If set to "auto", reader.color_scheme should stick/remain at "auto" under all circumstances and the reader style should switch to reflect the latest changes.
I'm not sure what triggers this bug / why it happens for me sometimes, but it may have something to do with suspend/resume. I'm running Firefox on Fedora Linux with GNOME 41, and have been using this extension to switch between the "Adwaita" and "Adwaita-dark" themes (so I'm not yet running GNOME 42+ with its different dark mode implementation), and it works fine if I switch between light/dark theme right now, so I'm suspecting that the issue has something to do with suspend/resume or timing somehow.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•2 years ago
|
||
I haven't been able to repro this but if the pref is changing this is in the wrong component.
Comment 4•2 years ago
|
||
It looks like it may have something to do with this code? https://searchfox.org/mozilla-central/rev/dc09246dfbfd8dafeb6d55ebee18a6294d525443/toolkit/components/reader/AboutReader.jsm#186-202
Micah / Niklas, since you reviewed this code could you take a look and see if it is performing as intended?
Comment 5•2 years ago
|
||
The "auto" theme reads the content theme of the browser so if you're switching between a light and dark theme that could explain Reader Mode switching between light and dark. But that shouldn't set reader.color_scheme
to something other than "auto".
If you flip reader.improvements_H12022.enabled
to false it will switch reader.color_scheme
to light theme though.
I don't know how reader.color_scheme
would be changed other than that though.
Comment 6•2 years ago
|
||
(In reply to Niklas Baumgardner [:niklas] from comment #5)
The "auto" theme reads the content theme of the browser so if you're switching between a light and dark theme that could explain Reader Mode switching between light and dark. But that shouldn't set
reader.color_scheme
to something other than "auto".If you flip
reader.improvements_H12022.enabled
to false it will switchreader.color_scheme
to light theme though.I don't know how
reader.color_scheme
would be changed other than that though.
The code that I linked to does change the reader.color_scheme
code, specifically lines 192, 202, and 811 on https://searchfox.org/mozilla-central/rev/dc09246dfbfd8dafeb6d55ebee18a6294d525443/toolkit/components/reader/AboutReader.jsm. Can you take another look that this is as we intended?
Comment 7•2 years ago
|
||
I'm unable to reproduce this so I'm not seeing anything unusual on lines 192, 202, and 811.
Comment 8•2 years ago
|
||
Hey apologies for the delay looking at this, adding this to my queue
Comment 9•2 years ago
|
||
Looking into this a bit, I don't immediately see why the reader.color_scheme
pref would change to something other than "auto" unless:
- the user is setting light/dark theme themselves from the reader mode toolbar/about:config
reader.improvements_H12022.enabled
is turned off when reader mode is initialized
We have a listener for the "change" event whenever the color scheme media query changes. But this only sets the color scheme of the document and not the preference itself.
Jeff Fortin, are you still seeing this issue on your end? Are you able to report any messages in the browser console when this issue occurs?
Comment 10•2 years ago
|
||
Unfortunately without more details there isn't much we can do here.
Description
•