Closed Bug 1629228 Opened 5 years ago Closed 4 years ago

`dark_theme` manifest field doesn't work on Linux

Categories

(WebExtensions :: Themes, enhancement, P3)

75 Branch
enhancement

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: flr73ji00, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

I loaded a temporary add-on / theme containing a manifest.json file with theme and dark_theme fields describing Firefox UI appearance when operating system theme is set to light and dark theme, respectively.

Actual results:

Firefox only shows UI described in the theme field in manifest.json, regardless of OS theme.

Expected results:

Firefox should switch between light and dark themes when system theme is changed, like the default Firefox theme.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Themes
Product: Firefox → WebExtensions

Hey Tim, could you please look into this?

Flags: needinfo?(ntim.bugs)
Attached file Test manifest.json

The dark_theme manifest field works as expected on my side with this test add-on. Does the default theme switch properly according to the system theme for you ? If not, it's likely you have privacy.resistFingerprinting enable, or it could be a bug general to prefers-color-scheme: dark.

Flags: needinfo?(ntim.bugs) → needinfo?(marko_skyline)

Thank you for replying.

I just tried loading the manifest.json you attached and it immediately switches to light theme, even though my OS theme is dark. Changing the OS theme does nothing to change the Firefox UI theme with this manifest.json theme loaded (it does change the bugzilla website theme). I don't have privacy.resistFingerprinting enabled. The default Firefox theme works properly, following the OS theme.

I'm running Fedora 31 with GNOME DE 3.34 on Wayland. Please let me know if you need more info.

Flags: needinfo?(marko_skyline)

I suspect the dark theme you were seeing on the default theme is the theme using system colors (which are dark in your case), but it's different from the dark theme you select from the add-ons manager. To confirm, is your about:preferences page or Bugzilla dark for you ?

dark_theme works on platforms where prefers-color-scheme: dark works (Windows and macOS), and IIRC, support on Linux was intentionally removed a while ago. If you set ui.systemUsesDarkTheme to 1, you should see the dark_theme in the manifest applied.

Flags: needinfo?(marko_skyline)

Pages like Bugzilla, DuckDuckGo, about:preferences, about:addons, about:config follow the OS theme and switch between light and dark theme depending on the system theme.
With the manifest.json applied and ui.systemUsesDarkTheme set to 1, the websites and about sites are fixed in dark mode, but the Firefox theme remains light, regardless of the system theme.

Flags: needinfo?(marko_skyline)

Resetting severity to default of --.

Ah right, we do exclude Linux from toggling dark_theme: https://searchfox.org/mozilla-central/source/toolkit/modules/LightweightThemeConsumer.jsm#204-208 which makes sense for the default theme. Sorry I missed that.

I guess this could be reconsidered for non-default themes though by checking the ID of the theme.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Create themes that follow system theme → `dark_theme` manifest field doesn't work on Linux
Priority: -- → P3

Fixed by Bug 1546540 Part 4.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: