Slide 152
Slide 152 text
new ReportingObserver((reports, observer) => {
reports.forEach(({type, url, body}) => {
console.log(type, url);
// 'feature-policy-violation', https://some-url.com/...
console.log(body);
// {
// featureId: 'oversized-images',
// sourceFile: 'https://path-to-image/...
// ...
// }
});
}, {types: ['feature-policy-violation'], buffered: true}).observe();