Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The requestOverride method of the PreferenceObject interface sets an override value for a particular preference.
requestOverrides(value)valueThe value to request an override with.
A Promise which resolves to undefined on success, or rejects on failure.
NotAllowedError DOMExceptionThrown if the given value is not allowed.
The following example requests an override of the colorScheme.
await navigator.preferences.colorScheme.requestOverride("dark");
console.log(navigator.preferences.colorScheme.override);