Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

'prefers-color-scheme' media query returns 'light' no matter what

  • 2 trả lời
  • 0 gặp vấn đề này
  • 4 lượt xem
  • Trả lời mới nhất được viết bởi felixbrakel

more options

I noticed this first when I had to force Google to go into dark mode even though firefox was already in dark mode.

I have searched through some issue reports and have seen a lot of people mentioning that their system theme is not being detected properly. This is not that issue. I can set the firefox "Website appearance" to dark or automatic at which point the UI of firefox itself does do into dark mode so no issues there. However if I go to a website that tries to query 'prefers-color-scheme' and set its theme accordingly it always returns 'light'. This is the case even if I set the 'layout.css.prefers-color-scheme.content-override' to 0 in about:config.

I used this website to test: https://septatrix.github.io/prefers-color-scheme-test/

The issue persists when opening a website in a private window.

Let me know if I need to provide additional information.

-Felix

I noticed this first when I had to force Google to go into dark mode even though firefox was already in dark mode. I have searched through some issue reports and have seen a lot of people mentioning that their system theme is not being detected properly. This is not that issue. I can set the firefox "Website appearance" to dark or automatic at which point the UI of firefox itself does do into dark mode so no issues there. However if I go to a website that tries to query 'prefers-color-scheme' and set its theme accordingly it always returns 'light'. This is the case even if I set the 'layout.css.prefers-color-scheme.content-override' to 0 in about:config. I used this website to test: https://septatrix.github.io/prefers-color-scheme-test/ The issue persists when opening a website in a private window. Let me know if I need to provide additional information. -Felix

Giải pháp được chọn

Setting "layout.css.prefers-color-scheme.content-override" to 0 is the same as selecting Dark for Website Appearance (Change website appearance settings in Firefox).

I am aware of one setting that will causes "prefers-color-scheme" to unfailingly return light, and that is setting "privacy.resistFingerprinting" to true in about:config. Does that ring a bell?

Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (2)

more options

Giải pháp được chọn

Setting "layout.css.prefers-color-scheme.content-override" to 0 is the same as selecting Dark for Website Appearance (Change website appearance settings in Firefox).

I am aware of one setting that will causes "prefers-color-scheme" to unfailingly return light, and that is setting "privacy.resistFingerprinting" to true in about:config. Does that ring a bell?