question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Custom browser theme breaks listening to system color scheme (Firefox, Linux)

See original GitHub issue

Bug Report

Bug Description

When Change the browser theme (More tab) is set to Custom and automation is set to Use system color scheme, the extension switches on but not off on system theme change.

Steps To Reproduce

  1. Start a fresh profile and install Dark Reader.
  2. Turn extension on and set Change the browser theme (More tab) to Custom; turn extension off again.
  3. Set Automation (kebab menu) to Use system color scheme.
  4. Switch system dark mode on.
  5. Switch system dark mode off.

Expected Behavior

The extension turns on and then off on steps 4, 5.

Actual Behavior

The extension does turn on but remains so after switching the system to light mode again.

System Information

  • OS: Manjaro 21.2.0 with i3wm (using xsettingsd to switch between Adwaita and Adwaita-dark)
  • Browser: Firefox 95.0
  • Dark Reader Version: 4.9.43

Additional Context

The bug appears to have surfaced with the upgrade to Firefox 95.0. I tried it with 91.4.0esr and could not reproduce it.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
adqlcommented, Dec 13, 2021

Update: when changing the about:config property layout.css.prefers-color-scheme.content-override to 2 (system) the bug is “solved” (but not actually resolved), which confirms the context of the recent Firefox change behind this. Here adding a UI element to change this property is discussed.

This property’s value can be 0 dark, 1 light, 2 system or 3 browser. When Dark Reader is set to Use system color scheme automation and to overriding the browser theme with Custom, this only works as expected when layout.css.prefers-color-scheme.content-override is set to 2 (system). On 0 (dark) and 1 (light) dark reader remains always on or off respectively. On 3 (browser), which is default since 95.0, the behavior originally described in this issue is reproduced (unidirectional switch off > on).

It seems likely that Dark Reader both relying on prefers-color-scheme and modifying the browser theme leads to a “lock” in the case of option 3, where it can turn itself on but then not off since it keeps the theme dark… I don’t really know about its internal design but I guess it should somehow rely directly on the system theme, regardless of the setting for websites. Is it at all possible?

1reaction
alexislefebvrecommented, Dec 16, 2021

Thanks adql, it looks like setting layout.css.prefers-color-scheme.content-override to 2 fixed the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make prefers-color-scheme respect the Firefox theme rather ...
Notable side effect: this would enable prefers-color-scheme: dark on OSes that don't currently have a dark mode (e.g. Linux, Windows 7 and 8)....
Read more >
Firefox stuck in dark mode with a custom theme
Firefox 96 applies a dark color scheme to menus, the sidebar, the Library window, and various built-in pages if the color of text...
Read more >
Use themes to change the look of Firefox - Mozilla Support
A theme changes the appearance of Firefox, such as the color scheme and background image of the toolbars. The color scheme of menus...
Read more >
dark linux gtk theme makes pages look bad - Bugzilla@Mozilla
Un-check "Use System Colors" option in browser preferences, using default Firefox theme. 2. Choose Darklooks desktop theme in Gnome Appearance control panel ...
Read more >
Mozilla Firefox Release Notes
Firefox Bug Fixes. v.16.0See the complete list of bugs fixed by the new version. ... 772883, System proxy settings on Linux in nightlies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found