files/en-us/web/api/interventionreportbody/index.md
{{APIRef("Reporting API")}}{{AvailableInWorkers}}{{SeeCompatTable}}
The InterventionReportBody interface of the Reporting API represents the body of an intervention report.
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.
A deprecation report is generated when a deprecated feature (for example a deprecated API method) is used on a document being observed by a {{domxref("ReportingObserver")}}. In addition to the support of this API, receiving useful intervention warnings relies on browser vendors adding these warnings for the relevant features.
{{InheritanceDiagram}}
An instance of InterventionReportBody is returned as the value of {{domxref("Report.body")}} when {{domxref("Report.Type")}} is intervention. The interface has no constructor.
This interface also inherits properties from {{domxref("ReportBody")}}.
null otherwise.null otherwise.null otherwise.This interface also inherits methods from {{domxref("ReportBody")}}.
InterventionReportBody object.In this example we create a new {{domxref("ReportingObserver")}} to observe intervention reports, then print details of each property of the first report to the console.
const options = {
types: ["intervention"],
buffered: true,
};
const observer = new ReportingObserver((reports, observer) => {
const 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}}
{{Compat}}