请求首部 DNT
(Do Not Track) 表明了用户对于网站追踪的偏好。它允许用户指定自己是否更注重个人隐私还是定制化内容。
Header type | Request header |
---|---|
Forbidden header name | yes |
语法
DNT: 0 DNT: 1
指令
- 0
- 表示用户更愿意允许目标站点对个人信息进行追踪。
- 1
- 表示用户更愿意禁止目标站点对个人信息进行追踪。
示例
使用 JavaScript 读取 “不追踪” (Do Not Track)状态
用户对 DNT 的设置还可以使用 Navigator.doNotTrack
属性进行读取:
navigator.doNotTrack; // "0" or "1"
规范
Specification | Status | Comment |
---|---|---|
Tracking Preference Expression (DNT) DNT Header Field for HTTP Requests |
Working Draft | Initial definition. |
浏览器兼容性
The compatibility table in 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.
Feature | Chrome | Firefox | Edge | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic Support | 23 | 4 | (Yes) | 9 | (Yes) | 6 |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
相关内容
Navigator.doNotTrack
Tk
header- Do Not Track on Wikipedia
- What Does the "Track" in "Do Not Track" Mean? – EFF
- donottrack.us
- DNT browser settings help: