ReportingObserverOptions

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

ReportingObserverOptions dictionary of the Reporting API allows options to be set in the constructor when creating a ReportingObserver .

特性

types
An array of strings representing the types of report to be collected by this observer. Available types include deprecation , intervention ,和 crash .
buffered
A boolean that defines whether the reports that were generated before the observer was able to be created should be observable ( true ) or not ( false ).

范例

let options = {
  types: ['deprecation'],
  buffered: true
}
let observer = new ReportingObserver(function(reports, observer) {
  reportBtn.onclick = () => displayReports(reports);
}, options);
					

规范

规范 状态 Comment
Reporting API
The definition of 'ReportingObserverOptions' in that specification.
编者草案

浏览器兼容性

No compatibility data found. Please contribute data for "api.ReportingObserverOptions" (depth: 1) to the MDN 兼容性数据存储库 .

另请参阅