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 Reporting-Endpoints response header.
Deprecation reports are always delivered to the endpoint named default.
The Reporting-Endpoints response header:
Reporting-Endpoints: default="https://char.has.report/report"
default: the name of the endpoint, deprecation reports are always delivered to the endpoint nameddefault"url": where to send reports, must behttps://, otherwise the endpoint will be ignored-
You may provide multiple
name="url"endpoints separated by comma (,)- For example:
Reporting-Endpoints: csp-reporting="https://example.com/csp", nel-reporting="https://example.com/nel"
- For example:
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 (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 (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)
- Deprecation Reporting Draft Community Group Report