User Preferences API
The value read-only property of the PreferenceManager interface returns the override value of a preference if one is set, or the UA-defined value if an override value is not set.
Value
The override of the PreferenceObject interface if one is set, or the UA-defined value otherwise.
Examples
Basic usage
This example demonstrates how to query the user's reduced motion preference.
if (navigator.preferences.reducedMotion.value === "reduce") {
// The user prefers reduced motion.
} else {
// The user has stated no preference regarding motion.
}
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
