Firefox Tomorrow

web api instance method

ReportingObserver: observe() method

View on MDN ↗

Available in workers

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

Basic usage

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

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

observer.observe();

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also