Table of Contents

Class InterventionReportBody

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The InterventionReportBody interface of the Reporting API represents the body of an intervention report.
[Value("InterventionReportBody")]
public class InterventionReportBody : ReportBody
Inheritance
InterventionReportBody
Inherited Members

Remarks

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.

-Reporting API
-The Reporting API

See also on MDN

Constructors

InterventionReportBody()

public InterventionReportBody()

Properties

ColumnNumber

NOTE
Experimental
The columnNumber read-only property of the InterventionReportBody interface returns the line in the source file in which the intervention occurred.
[Value("columnNumber")]
public ulong? ColumnNumber { get; }

Property Value

ulong?

An integer, or null if the column is not known.

Remarks

NOTE

This property is most useful alongside SourceFile and LineNumber as it enables the location of the column in that file and line where the feature is used.

See also on MDN

Id

NOTE
Experimental
The id read-only property of the InterventionReportBody interface returns a string identifying the intervention that generated the report. This can be used to group reports.
[Value("id")]
public string Id { get; }

Property Value

string

A string.

Remarks

LineNumber

NOTE
Experimental
The lineNumber read-only property of the InterventionReportBody interface returns the line in the source file in which the intervention occurred.
[Value("lineNumber")]
public ulong? LineNumber { get; }

Property Value

ulong?

An integer, or null if the line is not known.

Remarks

NOTE

This property is most useful alongside SourceFile as it enables the location of the line in that file where the feature is used.

See also on MDN

Message

NOTE
Experimental
The message read-only property of the InterventionReportBody interface returns a human-readable description of the intervention, including information such as 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.
[Value("message")]
public string Message { get; }

Property Value

string

A string.

Remarks

SourceFile

NOTE
Experimental
The sourceFile read-only property of the InterventionReportBody interface returns the path to the source file where the intervention occurred.
[Value("sourceFile")]
public string? SourceFile { get; }

Property Value

string

A string, or null if the path is not known.

Remarks

NOTE

This property can be used with LineNumber and ColumnNumber to locate the column and line in the file where the feature is used.

See also on MDN

Methods

ToJSON()

NOTE
Experimental
The toJSON() method of the InterventionReportBody interface is a serializer, and returns a JSON representation of the InterventionReportBody object.
[Value("toJSON")]
public Object ToJSON()

Returns

Object

A JSON object that is the serialization of the InterventionReportBody object.

Remarks