-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.bs
157 lines (128 loc) · 5.63 KB
/
index.bs
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<h1>Deprecation Reporting</h1>
<pre class="metadata">
Status: w3c/CG-DRAFT
ED: https://wicg.github.io/deprecation-reporting/
Shortname: deprecation-reporting
Group: WICG
Editor: Ian Clelland 76841, Google Inc., [email protected]
Abstract:
This document defines mechanism for reporting use of deprecated features
to site owners through the use of the Reporting API.
Level: 1
Indent: 2
Version History: https://github.com/WICG/deprecation-reporting/commits/gh-pages
Boilerplate: omit conformance, omit feedback-header
!Participate: <a href="https://github.com/WICG/deprecation-reporting/issues/new">File an issue</a> (<a href="https://github.com/wicg/deprecation-reporting/issues">open issues</a>)
Markup Shorthands: css off, markdown on
</pre>
<pre class="anchors">
spec: ECMASCRIPT; urlPrefix: https://tc39.github.io/ecma262/
type: dfn
text: Realm
text: Date object; url: sec-date-objects
type: interface
text: Date; url: sec-date-objects
</pre>
<section>
<h2 id="intro">Introduction</h2>
[INTRODUCTION GOES HERE]
<h3 id="examples">Examples</h3>
<div class="example">
Example, Inc. wants to keep track of when users are using Web APIs on its
site which are going to be removed in upcoming browser versions. It can do
this by delivering the following header to define a default reporting
endpoint, which will direct deprecation reports there:
<pre>
Reporting-Endpoints: default="https://example.com/reports"
</pre>
</section>
<section>
<h2 id="deprecation-report">Deprecation Reports</h3>
<dfn>Deprecation reports</dfn> indicate that a browser API or feature has been
used which is expected to stop working in a future update to the browser.
<a>Deprecation reports</a> are a type of [=report=].
<a>Deprecation reports</a> have the <a>report type</a> "deprecation".
<a>Deprecation reports</a> are <a>visible to
<code>ReportingObserver</code>s</a>.
<pre class="idl">
[Exposed=(Window,Worker)]
interface DeprecationReportBody : ReportBody {
[Default] object toJSON();
readonly attribute DOMString id;
readonly attribute object? anticipatedRemoval;
readonly attribute DOMString message;
readonly attribute DOMString? sourceFile;
readonly attribute unsigned long? lineNumber;
readonly attribute unsigned long? columnNumber;
};
</pre>
A <a>deprecation report</a>'s [=report/body=], represented in JavaScript by
{{DeprecationReportBody}}, contains the following fields:
- <dfn for="DeprecationReportBody">id</dfn>: an implementation-defined
string identifying the feature or API that will be removed. This string
can be used for grouping and counting related reports.
- <dfn for="DeprecationReportBody">anticipatedRemoval</dfn>: A
JavaScript <a>Date object</a> (rendered as an ISO 8601 string) indicating
roughly when the browser version without the specified API will be
generally available (excluding "beta" or other pre-release channels). This
value should be used to sort or prioritize warnings. If unknown, this
field should be null, and the deprecation should be considered low
priority (removal may not actually occur).
- <dfn for="DeprecationReportBody">message</dfn>: A human-readable string
with details typically matching what would be displayed on the developer
console. The message is not guaranteed to be unique for a given
[=DeprecationReportBody/id=] (eg. it may contain additional context on how
the API was used).
- <dfn for="DeprecationReportBody">sourceFile</dfn>: If known, the file
which first used the indicated API, or null otherwise.
- <dfn for="DeprecationReportBody">lineNumber</dfn>: If known, the line
number in [=DeprecationReportBody/sourceFile=] where the indicated API
was first used, or null otherwise.
- <dfn for="DeprecationReportBody">columnNumber</dfn>: If known, the column
number in [=DeprecationReportBody/sourceFile=] where the indicated API
was first used, or null otherwise.
Note: Deprecation reports are always delivered to the <a>endpoint</a> named
<code>default</code>; there is currently no way to override this. If you want
to receive other kinds of reports, but not deprecation reports, make sure to
use a different name for the endpoint that you choose for those reports.
</section>
<section>
<h2 id="sample-reports">Sample Reports</h2>
<div class="example">
<pre>
POST /reports HTTP/1.1
Host: example.com
...
Content-Type: application/reports+json
[{
"type": "deprecation",
"age": 32,
"url": "https://example.com/",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0",
"body": {
"id": "websql",
"anticipatedRemoval": "2020-01-01",
"message": "WebSQL is deprecated and will be removed in Chrome 97 around January 2020",
"sourceFile": "https://example.com/index.js",
"lineNumber": 1234,
"columnNumber": 42
}
}]
}
</pre>
</div>
</section>
<section>
<h2 id="security">Security Considerations</h2>
For a discussion of security considerations surrounding out-of-band reporting
in general, see [[REPORTING#security]].
The remainder of this section discusses security considerations for
deprecation reporting specifically.
</section>
<section>
<h2 id="privacy">Privacy Considerations</h2>
For a discussion of privacy considerations surrounding out-of-band reporting
in general, see [[REPORTING#privacy]].
The remainder of this section discusses privacy considerations for
deprecation reporting specifically.
</section>