Report: body property

Note: This feature is available in Web Workers.

The body read-only property of the Report interface returns an object containing the detailed report information.

Value

An object.

The properties on the object depend on the type of report. A mapping between the type and report body object can be found in Report types.

Note that the specification defines this property as a ReportBody-derived dictionary, where ReportBody has no properties or methods. For historical reasons, most of the report objects returned by this property do derive from ReportBody. However because it is empty it is not relevant to website developers, and report body instances can be considered stand-alone objects.

Examples

js
const options = {
  types: ["deprecation"],
  buffered: true,
};

const observer = new ReportingObserver(([firstReport], observer) => {
  // Log the first report's report body, i.e. a DeprecationReportBody object
  console.log(firstReport.body);
}, options);

Specifications

Specification
Reporting API
# dom-report-body

Browser compatibility

See also