-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System Theme Detection doesn't work in Firefox #43
Comments
Interestingly, the system theme doesn't reach the DevTool either. (i have it set to automatic - it is dark on every page) For some pages ff just assumes dark, and never changes the theme - what a strange issue on their part |
This introduced a few changes in the architecture
Did you run this from the browser toolbox? |
On the bright side however that means my annoying-to-implement workaround wasn't invain |
my workaround has the disadvantage that it only works immediately if you are fcosing on a tab, that is not protected by firefox. but ig if you're not lurking on about:newtab, it kinda works |
and if there was a better one, i figure the dark reader folks would've caught on |
I mean, if you've just got the new tab page open, you're probably not really using the web browser anyway so I don't see this as too big of an issue tbh. It seems to be working fine for me on Linux. |
My patch? It probably will have broken the "only on startup thing" Something another global variable could fix |
Yeah, your patch works really well. I don't see why it needs to send the |
Yeah just for logging |
Sad thing is, Dark Reader only needs to run on unprotected tabs. So, Maybe we can refer to #31 |
It seems like Firefox has been struggling to deal with system colour theme for a while. Like, in this repo, “system theme detection” issue has come out and been fixed for some times already. |
Hmm... in Firefox (on macOS) native "system theme" seems to work fine, same goes for page colours. I just started using this theme and it seems great - it changed theme to the dark flavour last night but today it got stuck on dark one. For now I set fixed times (that maches my system) as a workaround and this seems to work... |
Description
![grafik](https://user-images.githubusercontent.com/56208328/234537640-753510d9-b786-4a78-a4a2-36b908f70df9.png)
In Firefox, changes to the System Theme do not reach the extension pages.
Even though:
This behaviour seems to be very related to issues the darkreader team had:
darkreader/darkreader#9582
darkreader/darkreader@29e9312
Their fix seems to be to collect the messages:
matchMedia('(prefers-color-scheme: dark)').addEventListener("change", ({matches}) => console.log(matches))
from all tabs, and then manage the resulting mayhem by filtering duplicate messages.
i can't say i've been able to fully parse their code into my brain, it's quite a lot.
the core mechanism of matching media queries seems to be the only way though, and it's unreliability must just be accounted for.
System Information
Steps To Reproduce
Steps to reproduce the behaviour:
matchMedia("(prefers-color-scheme: dark)").matches
Expected behaviour
It should return false in System Light Mode
The text was updated successfully, but these errors were encountered: