Closed Bug 1733461 Opened 1 year ago Closed 1 year ago

WebExtension API to toggle prefers-color-scheme for light/dark/system mode

Categories

(WebExtensions :: General, enhancement, P5)

Firefox 93
enhancement

Tracking

(firefox95 fixed)

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: me, Assigned: me)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

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

Steps to reproduce:

In 93, a new preference has appeared to toggle the preferred color scheme:
layout.css.prefers-color-scheme.content-override

See: https://hg.mozilla.org/integration/autoland/rev/399441fe2466

It’s not modifiable from a WebExtension currently.

Expected results:

I would be nice for this preference to be exposed through the WebExtension API. Maybe through the browser.theme that currently only exists in Firefox:

See: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/theme

I would be willing to take a look into it, given some input on whether this seems a good idea to power that be, and a pointer or 2 over where to do the changes.

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Product: Firefox → WebExtensions

Changing severity to S5 because of patches welcome.

Severity: -- → N/A
Priority: -- → P5
Summary: WebExtension API to toggle preferes-color-scheme for light/dark/system mode → WebExtension API to toggle prefers-color-scheme for light/dark/system mode
Assignee: nobody → me
Pushed by scaraveo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/48501517af5e
Add a webextension preference to override light or dark color scheme. r=mixedpuppy
Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch

Bug 1529323 added another supported value, so the options are now dark, light, system and browser. Please document the API in browser-compat-data and MDN.

Component: Untriaged → General
See Also: → 1529323
Duplicate of this bug: 1547818

Content to address dev-doc-needed is now available for review:

You need to log in before you can comment on or make changes to this bug.