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 ReportingObserver. In addition to the support of this API, receiving useful intervention warnings relies on browser vendors adding these warnings for the relevant features.
Constructor
An instance of InterventionReportBody is returned as the value of Report.body when Report.Type is intervention. The interface has no constructor.
Instance properties
This interface also inherits properties from ReportBody.
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.
A serializer which returns a JSON representation of the InterventionReportBody object.
Examples
In this example we create a new ReportingObserver to observe intervention reports, then print details of each property of the first report to the console.