Class InterventionReportBody
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalInterventionReportBody 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.
Constructors
InterventionReportBody()
public InterventionReportBody()
Properties
ColumnNumber
NOTE
ExperimentalcolumnNumber 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
nullif 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.
Id
NOTE
Experimentalid 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
ExperimentallineNumber 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
nullif 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.
Message
NOTE
Experimentalmessage 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
ExperimentalsourceFile 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
nullif 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.
Methods
ToJSON()
NOTE
ExperimentaltoJSON() 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.