Ce site disposera de fonctionnalités limitées pendant que nous effectuons des opérations de maintenance en vue de vous proposer un meilleur service. Si un article ne règle pas votre problème et que vous souhaitez poser une question, notre communauté d’assistance est prête à vous répondre via @FirefoxSupport sur Twitter, et /r/firefox sur Reddit.

Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

En savoir plus

Auto Dark Mode feature on websites does not work

more options

Somehow, the prefers-color-scheme: dark media query does not seem to behave correctly in my browser. I am using Firefox 89.0.2 on Windows 10 21H1 and even though I have set the system theme to dark (which Firefox's System Theme adapts to, the browser UI is dark), websites which usually adapt to it (like YouTube when set to follow the device theme) do not do so and are using the light theme regardless. This issue persists even in troubleshooting mode, so it does not seem to be related to any add-on I have installed.

Testing the same websites on Firefox Nightly (91.0a1) and Developer Edition (90.0b12), they behave as expected, adapting to my system's dark theme. The same had been the case when I had been using Firefox 88 (where it did not work as expected), while websites on Nightly and Developer Edition (versions 90 and 89, respectively) did behave as expected.

Is there some fix for this issue, some setting that is supposed to be tweaked, or can a fix be expected in an upcoming release?

Somehow, the prefers-color-scheme: dark media query does not seem to behave correctly in my browser. I am using Firefox 89.0.2 on Windows 10 21H1 and even though I have set the system theme to dark (which Firefox's System Theme adapts to, the browser UI is dark), websites which usually adapt to it (like YouTube when set to follow the device theme) do not do so and are using the light theme regardless. This issue persists even in troubleshooting mode, so it does not seem to be related to any add-on I have installed. Testing the same websites on Firefox Nightly (91.0a1) and Developer Edition (90.0b12), they behave as expected, adapting to my system's dark theme. The same had been the case when I had been using Firefox 88 (where it did not work as expected), while websites on Nightly and Developer Edition (versions 90 and 89, respectively) did behave as expected. Is there some fix for this issue, some setting that is supposed to be tweaked, or can a fix be expected in an upcoming release?

Solution choisie

Hmm, your Firefox user agent string indicates that you're running version 78.0, which can indicate that you turned on privacy.resistFingerprinting. Does that sound familiar?

I think it's one of the many (not so well documented) behaviors of this feature to block the media query related to your theme preference. In an old Reddit thread, an add-on was suggested as a workaround, but I lazily just looked at a couple threads and don't know whether that is a good solution: https://www.reddit.com/r/firefox/comments/dmhq4e/privacyresistfingerprinting_prefercolorscheme/

Lire cette réponse dans son contexte 👍 1

Toutes les réponses (1)

more options

Solution choisie

Hmm, your Firefox user agent string indicates that you're running version 78.0, which can indicate that you turned on privacy.resistFingerprinting. Does that sound familiar?

I think it's one of the many (not so well documented) behaviors of this feature to block the media query related to your theme preference. In an old Reddit thread, an add-on was suggested as a workaround, but I lazily just looked at a couple threads and don't know whether that is a good solution: https://www.reddit.com/r/firefox/comments/dmhq4e/privacyresistfingerprinting_prefercolorscheme/