ReportingObserver.takeRecords()

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

The takeRecords() method of the ReportingObserver interface returns the current list of reports contained in the observer's report queue, and empties the queue.

Syntax

reportingObserverInstance.takeRecords()

Return value

An array of Report objects.

Examples

let options = {
  types: ['deprecation'],
  buffered: true
}

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

observer.observe()

// ...

let records = observer.takeRecords();
console.log(records);

Specifications

Specification Status Comment
Unknown
The definition of 'ReportingObserver.takeRecords()' in that specification.
Unknown Ā 

Browser compatibility

No compatibility data found. Please contribute data for "api.ReportingObserver.takeRecords" (depth: 1) to the MDN compatibility data repository.

See also