You are on the editable version of MDN Web Docs

MDN 웹 문서 사용자로 보기: https://developer.mozilla.org/ko/docs/Web/API/InterventionReportBody

InterventionReportBody

이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 참여해서 번역을 마치도록 도와 주세요!
English (US)의 문서도 읽어보세요.

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

The InterventionReportBody interface of the Reporting API represents the body of an intervention report (the return value of its Report.body property).

An intervention report is generated when usage of a feature in a web document has been blocked by the browser for reasons such as security, performance, or user annoyance. So for example, a script was been stopped because it was significantly slowing down the browser, or the browser's autoplay policy blocked audio from playing without a user gesture to trigger it.

Properties

id
A string representing the intervention that generated the report. This can be used to group reports by deprecated feature.
message
A string containing a human-readable description of the intervention, including information such how the intervention could be avoided. This typically matches the message a browser will display in its DevTools console when an intervention is imposed, if one is available.
sourceFile
A string containing the path to the source file where the intervention occurred, if known, or null otherwise.
lineNumber
A number representing the line in the source file in which the intervention occurred, if known, or null otherwise.
columnNumber
A number representing the column in the source file in which the intervention occurred, if known, or null otherwise.

Examples

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

let observer = new ReportingObserver(function(reports, observer) {
  let firstReport = reports[0];
  console.log(firstReport.type); // intervention
  console.log(firstReport.body.id);
  console.log(firstReport.body.message);
  console.log(firstReport.body.sourceFile);
  console.log(firstReport.body.lineNumber);
  console.log(firstReport.body.columnNumber);
}, options);

Specifications

Specification Status Comment
Reporting API
The definition of 'InterventionReportBody' in that specification.
Editor's Draft  

Browser compatibility

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

See also

문서 태그 및 공헌자

이 페이지의 공헌자: chrisdavidmills
최종 변경자: chrisdavidmills,