Intent to Prototype: Web Preferences API

774 views
Skip to first unread message

Luke

unread,
Sep 5, 2023, 5:59:41 PM9/5/23
to blin...@chromium.org

Contact emails

lukewa...@gmail.comlu...@warlow.dev

Explainer

https://github.com/lukewarlow/web-preferences-api

Specification

https://specs.lukewarlow.dev/web-preferences-api

Summary

The Web Preference API aims to provide a way for sites to override the value for a given user preference (e.g. color-scheme preference) in a way that fully integrates with existing Web APIs.



Blink component

Blink

Motivation

Currently, website authors have a choice when wishing to honour a user's preference for a given setting. They can choose to "use the platform" where the user must indicate their preference via their OS or, if lucky, they can override in the browser. This comes with a number of issues: - Relies on the user's OS or browser offering the ability to change the setting - Relies on the user knowing how to change the setting in their OS or browser - No ability to override the setting for a specific site - No ability to sync preferences for a site across devices Alternatively, sites can and do offer site-level settings, but this currently comes with a number of issues: - No integration with CSS preference media queries - No integration with conditional resource loading (e.g. using <source media="(prefers-contrast: more)">) - No integration with JS APIs for retrieval of these preferences (e.g. matchMedia) - No integration with User Preference Client Hints - No integration with the color-scheme CSS property - The various client storage mechanisms that could store these preferences can be cleared in a number of scenarios The Web Preferences API aims to solve this by providing a way for sites to indicate a user preference for a given pre-defined setting.



Initial public proposal

https://github.com/WICG/proposals/issues/117

Search tags

preferencesprefers-color-scheme

TAG review

None

TAG review status

Pending

Risks



Interoperability and Compatibility

None



Gecko: No signal

WebKit: No signal

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Is this feature fully tested by web-platform-tests?

No

Flag name on chrome://flags

None

Finch feature name

WebPreferences

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1479201

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4631882616012800

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages