aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/headers/sourcemap/index.html
blob: e5a77ef625776a8497e0b7b4da6101bc86c06143 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
title: SourceMap
slug: Web/HTTP/Headers/SourceMap
translation_of: Web/HTTP/Headers/SourceMap
---
<div>{{HTTPSidebar}}</div>

<p><strong><code>SourceMap</code></strong> <a href="/en-US/docs/Web/HTTP">HTTP</a> 响应头链接生成的代码到一个 <a href="/en-US/docs/Tools/Debugger/How_to/Use_a_source_map">source map</a>,使浏览器能够重建原始的资源然后显示在调试器里。</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header 类型</th>
   <td>{{Glossary("Response header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>no</td>
  </tr>
 </tbody>
</table>

<h2 id="语法">语法</h2>

<pre class="syntaxbox">SourceMap: &lt;url&gt;
X-SourceMap: &lt;url&gt; (deprecated)
</pre>

<h3 id="指令">指令</h3>

<dl>
 <dt><code>&lt;url&gt;</code></dt>
 <dd>指向一个source map文件的一个相对(于请求的URL)或者一个绝对的URL。</dd>
</dl>

<h2 id="例子">例子</h2>

<pre>SourceMap: /path/to/file.js.map</pre>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td><a href="https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k">Draft document</a></td>
   <td>Source Map Revision 3 Proposal</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.SourceMap")}}</p>

<h2 id="另请参阅">另请参阅</h2>

<ul>
 <li><a href="/en-US/docs/Tools/Debugger/How_to/Use_a_source_map">Firefox Developer Tools: using a source map</a></li>
</ul>