Navigator: globalPrivacyControl 屬性
Navigator.globalPrivacyControl 只讀屬性返回使用者針對當前網站的 Global Privacy Control 設定。此設定指示使用者是否同意網站或服務將其個人資訊出售或分享給第三方。
此屬性的值反映了 Sec-GPC HTTP 頭的相應值。
值
如果使用者明確不提供出售或分享其資料的同意,則返回 true。如果使用者授予了同意,或者未表明偏好,則返回 false。
示例
js
console.log(navigator.globalPrivacyControl);
// "true" if the user has specifically indicated they do not want their data shared or sold, otherwise "false".
規範
| 規範 |
|---|
| 全球隱私控制 (GPC) # dom-globalprivacycontrol-globalprivacycontrol |
瀏覽器相容性
載入中…