matchMedia event listener won't fire on OS color theme change
Categories
(Firefox :: Theme, defect)
Tracking
()
People
(Reporter: mashy426, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0
Steps to reproduce:
- Run a script that uses
matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (event) => console.log(event.matches));
to output a boolean to the web console that indicates whether the OS color theme is dark (true) or light (false) upon change. - Change the OS color theme.
Actual results:
The event listener does not fire in Firefox Developer Edition 95.0b6 on macOS. However, it does in Firefox 94.0.1 on macOS.
Expected results:
The event listener should have fired in Firefox Developer Edition 95.0b6, as it has in previous versions.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Theme' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment hidden (obsolete) |
Comment 3•3 years ago
|
||
Expected change from: "Bug 1529323 - Make prefers-color-scheme respect the Firefox theme rather than the system theme"
Updated•3 years ago
|
How can this be resolved?
By preventing this event just to prevent the firefox theme from changing its against convention of the event.
The event should be fired so the site / app loaded in the window can respond and change their style etc if desired regardless of whether the firefox UI chooses to do so or not.
Description
•