Deprecation reports
Some browser features, functions, or APIs are considered deprecated, no longer recommended, and while they still work, you shouldn't be using them.
Deprecation reporting will send you a report if your code uses such deprecated feature, all you need to send is a Report-To
response header.
The Report-To
response header:
Report-To: {"group":"default","max_age":1800,"endpoints":[{"url":"https://calve.has.report/report"}],"include_subdomains":true}
group
: the name of the group, can be used in a CSP header in thereport-to
directive, for examplemax_age
: how long the browser should use the endpoint and report errors to it-
endpoints
: reporting endpoint configuration, can specify multiple endpoints but reports will be sent to just one of themurl
: where to send reports to, must behttps://
, otherwise the endpoint will be ignored
Use a deprecated feature
Synchronous XMLHttpRequest
outside of workers is in the process of being removed as it has detrimental effects to the user's experience and browsers have deprecated such usage.
Developers must not pass false
for the async
argument of the open()
method but you're a professional driver and this is a closed circuit, so…
new XMLHttpRequest().open('GET', 'foo', false)
<script>
document.getElementById('xhr').onclick = function() {
new XMLHttpRequest().open('GET', 'foo', false);
alert('XMLHttpRequest.open(async = false) called');
}
</script>
- Will trigger a report that will be sent asynchronously, possibly grouped with other reports (deprecation visible in Developer Tools in the Console tab, you won't see the report in Network tab but you can still view the reporting requests)
- Check your reports (can take some time before the browser sends the report)
Use an invalid feature
Some features are considered invalid, and won't work at all, for example using <source src>
HTML element with a <picture>
parent, instead of <source srcset>
.
But you will still get a report if you use them.
<source srcset>
<script>
document.getElementById('src').onclick = function() {
const source = document.createElement('source'), img = document.createElement('img');
source.src = 'data:image/webp;base64,UklGRhIAAABXRUJQVlA4TAYAAAAvQWxvAGs=';
img.src = 'data:image/gif;base64,R0lGODlhAQABAAAAADs=';
document.createElement('picture').append(source, img);
alert('<picture>\n <source src> ← this is invalid\n <img src>\n</picture>\nhas been created');
}
</script>
- Will trigger a report that will be sent asynchronously, possibly grouped with other reports (invalid feature visible in Developer Tools in the Console tab, you won't see the report in Network tab but you can still view the reporting requests)
- Check your reports (can take some time before the browser sends the report)
See Chrome's source code for more deprecated and invalid features.
Related specs & documents
- Reporting API Working Draft
- Reporting API Editor's Draft (which will evolve into a Working Draft, followed by a Recommendation eventually)
-
Notable changes in the Editor's Draft are switching to structured headers (
Reporting-Endpoints
instead ofReport-To
) and moving out concrete reports into the following separate Draft Community Group Reports: Crash Reporting, Deprecation Reporting, Intervention Reporting