ReportingObserver: observe() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: This feature is available in Web Workers.

The observe() method of the ReportingObserver interface instructs a reporting observer to start collecting reports in its report queue.

Syntax

js
observe()

Parameters

None.

Return value

None (undefined).

Examples

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

const observer = new ReportingObserver((reports, observer) => {
  reportBtn.onclick = () => displayReports(reports);
}, options);

observer.observe();

Specifications

Specification
Reporting API
# dom-reportingobserver-observe

Browser compatibility

BCD tables only load in the browser

See also