ReportingObserver.observe()

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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

Syntax

observe()

Parameters

None.

Return value

None (undefined).

Examples

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