Navigator: thuộc tính globalPrivacyControl

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Thuộc tính chỉ đọc Navigator.globalPrivacyControl trả về cài đặt Global Privacy Control của người dùng cho trang web hiện tại. Cài đặt này cho biết liệu người dùng có đồng ý cho phép trang web hoặc dịch vụ bán hoặc chia sẻ thông tin cá nhân của họ với bên thứ ba hay không.

Giá trị của thuộc tính phản ánh giá trị của tiêu đề HTTP Sec-GPC.

Giá trị

true nếu người dùng không đồng ý bán hoặc chia sẻ dữ liệu của họ một cách rõ ràng. false nếu người dùng đồng ý hoặc chưa chỉ ra tùy chọn.

Ví dụ

js
console.log(navigator.globalPrivacyControl);
// "true" if the user has specifically indicated they do not want their data shared or sold, otherwise "false".

Thông số kỹ thuật

Specification
Global Privacy Control (GPC)
# dom-globalprivacycontrol-globalprivacycontrol

Khả năng tương thích của trình duyệt

Xem thêm