ReportingObserver: takeRecords() 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 takeRecords()
method of the
ReportingObserver
interface returns the current list of reports contained
in the observer's report queue, and empties the queue.
Syntax
js
takeRecords()
Parameters
None.
Return value
An array of Report
objects.
Examples
js
const options = {
types: ["deprecation"],
buffered: true,
};
const observer = new ReportingObserver((reports, observer) => {
reportBtn.onclick = () => displayReports(reports);
}, options);
observer.observe();
// …
const records = observer.takeRecords();
console.log(records);
Specifications
Specification |
---|
Reporting API # dom-reportingobserver-takerecords |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
takeRecords |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.