Navigator:globalPrivacyControl 属性
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Navigator.globalPrivacyControl
只读属性返回用户对当前网站的全球隐私控制设置。此设置指示用户是否同意网站或服务将其个人信息出售或共享给第三方。
该属性的值反映了 Sec-GPC
HTTP 标头中的值。
值
如果用户明确表示不同意出售或共享其数据,则为 true
;如果用户同意出售或共享数据,或者尚未表明偏好,则为 false
。
示例
js
console.log(navigator.globalPrivacyControl);
// 如果用户明确表示不同意共享或出售其数据,则为“true”;否则为“false”。
规范
Specification |
---|
Global Privacy Control (GPC) # dom-globalprivacycontrol-globalprivacycontrol |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
globalPrivacyControl |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
参见
Sec-GPC
标头- globalprivacycontrol.org
- 全球隐私控制规范
- 维基百科上的请勿追踪