ReportBody
Note: This feature is available inWeb Workers.
TheReportBody interface of theReporting API represents the body of a report. Individual report types inherit from this interface, adding specific attributes relevant to the particular report.
The following interfaces inherit fromReportBody:
An instance ofReportBody is returned as the value ofReport.body. The interface has no constructor.
In this article
Instance methods
ReportBody.toJSON()DeprecatedAserializer which returns a JSON representation of the
ReportBodyobject.
Examples
In this example we create a newReportingObserver to observe intervention reports. TheInterventionReportBody interface inherits fromReportBody.
js
const options = { types: ["intervention"], buffered: true,};const observer = new ReportingObserver(([firstReport], observer) => { console.log(firstReport.type); // intervention}, options);Specifications
| Specification |
|---|
| Reporting API> # reportbody> |