Getting browsers to respect PureOS dark/nightlight mode

I’ve noticed that none of the browsers I have installed (epiphany, vivaldi, brave, ungoogled chromium) are respecting the system nightlight settings.

I want the browsers to automatically switch from light to dark mode themes as nightlight turns off an on. Is there some special setting or gnome glue software that needs to be installed on order to enable this feature?

1 Like

Not sure, but I do notice the browsers you installed are based on the Blink web engine.

Hard to get away from Blink these days, but I’ll try to reproduce with Firefox this evening.

1 Like

Do you mean the “Night Light” in the “Displays” settings? It only adjusts the color temperature of your screen to filter out blue light. It is not intended to change the theme or the color scheme.

Assuming that your Pure OS is older than Crimson, the toggle to change the color scheme is not yet in the Settings application, but you should still be able to change the theme and the color scheme of the applications, including browsers. There is a method for Byzantium in another post.

If you mean the contents on the web pages as well, many implement support for changing the colors in CSS when the host color scheme changes. However, if you want to rewrite CSS automatically and enforce a dark appearance on all websites, even if they have not implemented one, you would need a browser with WebExtensions support and the Dark Reader extension.

If you install browsers through Flatpak, you would need a newer version of xdg-desktop-portal-gtk than packaged in PureOS Byzantium.

The web engine behind GNOME Web (Epiphany) is WebKit, not Blink. To be more precise, it is WebKitGTK, the GTK port of WebKit. It is also a dependency for many other GNOME applications.

1 Like

Thank you for the comprehensive reply.

I did mean Night Light in the Display settings. I was hoping that browsers would detect whether or not nightlight was active, and use that to switch from light to dark themes.

I was not aware of any other mechanism for a browser to detect which theme was in use by the Gnome desktop, but I now see that the gtk-theme and color-scheme gsettings is what I was after.

I’ll try setting up the script linked and assigning to a keyboard shortcut as suggested.

I have a few browsers installed via Flatpak so I’ll look into more recent versions of xdg-desktop-portal-gtk.

1 Like

Now that I’ve upgraded to PureOS Crimson 11 I see the addition of the Dark Mode toggle switch under the Gnome power button menu.

Turning this on will cause most of my newer browsers to switch to a dark theme.

4 Likes