diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/http/headers/dnt/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/http/headers/dnt/index.html')
-rw-r--r-- | files/zh-cn/web/http/headers/dnt/index.html | 88 |
1 files changed, 88 insertions, 0 deletions
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 +--- +<div>{{HTTPSidebar}}</div> + +<p>请求首部 <strong><code>DNT</code></strong> (<strong>D</strong>o <strong>N</strong>ot <strong>T</strong>rack) 表明了用户对于网站追踪的偏好。它允许用户指定自己是否更注重个人隐私还是定制化内容。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Header type</th> + <td>{{Glossary("Request header")}}</td> + </tr> + <tr> + <th scope="row">{{Glossary("Forbidden header name")}}</th> + <td>yes</td> + </tr> + </tbody> +</table> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox">DNT: 0 +DNT: 1 +</pre> + +<h2 id="指令">指令</h2> + +<dl> + <dt>0</dt> + <dd>表示用户愿意目标站点追踪用户个人信息。</dd> + <dt>1</dt> + <dd>表示用户不愿意目标站点追踪用户个人信息。</dd> +</dl> + +<h2 id="示例">示例</h2> + +<h3 id="使用_JavaScript_读取_“不追踪”_(Do_Not_Track)状态">使用 JavaScript 读取 “不追踪” (Do Not Track)状态</h3> + +<p>用户对 DNT 的设置还可以使用 {{domxref("Navigator.doNotTrack")}} 属性进行读取:</p> + +<pre class="brush: js">navigator.doNotTrack; // "0" or "1"</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Tracking','#dnt-header-field', 'DNT Header Field for HTTP Requests')}}</td> + <td>{{Spec2("Tracking")}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("http.headers.DNT")}}</p> + +<h2 id="相关内容">相关内容</h2> + +<ul> + <li>{{domxref("Navigator.doNotTrack")}}</li> + <li>{{HTTPHeader("Tk")}} header</li> + <li><a href="https://en.wikipedia.org/wiki/Do_Not_Track">Do Not Track on Wikipedia</a></li> + <li><a href="https://www.eff.org/deeplinks/2011/02/what-does-track-do-not-track-mean">"Do Not Track"中的"Track"指什么? – EFF</a></li> + <li><a href="http://donottrack.us/">donottrack.us</a></li> + <li>DNT 浏览器设置帮助: + <ul> + <li><a href="https://www.mozilla.org/en-US/firefox/dnt/">Firefox</a></li> + <li><a href="https://support.google.com/chrome/answer/2790761">Chrome</a></li> + </ul> + </li> +</ul> |