From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/http/headers/dnt/index.html | 88 +++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 files/zh-cn/web/http/headers/dnt/index.html (limited to 'files/zh-cn/web/http/headers/dnt') diff --git a/files/zh-cn/web/http/headers/dnt/index.html b/files/zh-cn/web/http/headers/dnt/index.html new file mode 100644 index 0000000000..7c639c766f --- /dev/null +++ b/files/zh-cn/web/http/headers/dnt/index.html @@ -0,0 +1,88 @@ +--- +title: DNT +slug: Web/HTTP/Headers/DNT +tags: + - 不追踪 + - 定制化内容 + - 请求首部 + - 隐私 +translation_of: Web/HTTP/Headers/DNT +--- +
{{HTTPSidebar}}
+ +

请求首部 DNT (Do Not Track) 表明了用户对于网站追踪的偏好。它允许用户指定自己是否更注重个人隐私还是定制化内容。

+ + + + + + + + + + + + +
Header type{{Glossary("Request header")}}
{{Glossary("Forbidden header name")}}yes
+ +

语法

+ +
DNT: 0
+DNT: 1
+
+ +

指令

+ +
+
0
+
表示用户愿意目标站点追踪用户个人信息。
+
1
+
表示用户不愿意目标站点追踪用户个人信息。
+
+ +

示例

+ +

使用 JavaScript 读取 “不追踪” (Do Not Track)状态

+ +

用户对 DNT 的设置还可以使用 {{domxref("Navigator.doNotTrack")}} 属性进行读取:

+ +
navigator.doNotTrack; // "0" or "1"
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Tracking','#dnt-header-field', 'DNT Header Field for HTTP Requests')}}{{Spec2("Tracking")}}Initial definition.
+ +

浏览器兼容性

+ + + +

{{Compat("http.headers.DNT")}}

+ +

相关内容

+ + -- cgit v1.2.3-54-g00ecf