window.matchMedia('(prefers-color-scheme: dark)') returns incorrect result for new tab
Categories
(Core :: Widget: Cocoa, defect, P3)
Tracking
()
People
(Reporter: ericchen098, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0
Steps to reproduce:
Note: This only happens (but always happens) for the first new tab that is opened.
I'm on a Macbook (MacOS Catalina v10.15.2).
- Go to Mac System Preferences -> General.
- If Appearance is set to "Light", change it to "Dark". If the Appearance is set to "Dark", change it to "Light".
- Open a new tab in Firefox.
- Go to youtube.com and open the developer console there.
- Run the javascript
window.matchMedia('(prefers-color-scheme: dark)').matches.
Actual results:
Running the code in step (5) will always yield the incorrect result.
If you switched your Appearance to "Dark", then the result will be false.
If you switched your Appearance to "Light", then the result will be true.
Expected results:
If you switched your Appearance to "Dark", then the result should be true.
If you switched your Appearance to "Light", then the result should be false.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Works fine on Ubuntu 20.04, it seems like an issue in the Cocoa backend.
Updated•6 years ago
|
Comment 2•6 years ago
|
||
Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)
Updated•6 years ago
|
Updated•6 years ago
|
Comment 3•4 years ago
|
||
This works fine now afaict, on all platforms. Please reopen and ni? me if that's not the case.
Comment 4•3 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)
This works fine now afaict, on all platforms. Please reopen and ni? me if that's not the case.
See bug 1815764
Comment 5•3 years ago
|
||
That doesn't seem the same issue. Will comment there.
Description
•