Expose Reporting API interfaces to JavaScript
- Category
- Miscellaneous
- Type
- No developer-visible change
- Status
- No active development (Chrome No active development)
- Intent stage
- Prepare to ship
WPT details: IDLHarness tests already exist in Web Platform Tests for these interfaces, as they follow the published specification. This change causes those tests to pass.
Summary
Several interface objects used by the Reporting API were originally not exposed as symbols on the JavaScript global object. This includes Report, ReportBody, and the various specific report body types such as CSPViolationReportBody and DeprecationReportBody. This change exposes those objects on the window (or worker global), bringing the implementation in line with the specification.
Motivation
WebIDL is deprecating the NoInterfaceObject attribute, and APIs are moving towards having interface objects exposed on the global object ('window' or 'self') This can allow for some kinds of feature detection, but mostly it just brings Chrome's ReportingObserver in line with the specificaion.
Standards & signals
- Specification: https://w3c.github.io/reporting/#idl-index
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1122656
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=expose-reporting-api-interfaces-to-javascript
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Expose%20Reporting%20API%20interfaces%20to%20JavaScript
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Expose%20Reporting%20API%20interfaces%20to%20JavaScript
- Baseline status: https://webstatus.dev/?q=Expose%20Reporting%20API%20interfaces%20to%20JavaScript