ContentSecurityPolicyViolationReport Class
A violation of a content security policy (https://w3c.github.io/webappsec-csp/#violation), given to BrowsingContextOptions.ContentSecurityPolicyViolation. The URLs are stripped as in the reports sent to the endpoints of the policy (https://w3c.github.io/webappsec-csp/#strip-url-for-use-in-reports).
public sealed class ContentSecurityPolicyViolationReportProperties
| Name | Description |
|---|---|
| BlockedUrl | Gets the URL of the blocked resource, or a keyword such as inline, eval, wasm-eval, trusted-types-policy or trusted-types-sink. |
| ColumnNumber | Gets the column number in ContentSecurityPolicyViolationReport.SourceFile, or 0. |
| Disposition | Gets whether the violated policy is enforced (the resource is blocked) or report-only. |
| DocumentUrl | Gets the URL of the document (or of the response, for a violation of a navigation response check). |
| EffectiveDirective | Gets the directive whose enforcement caused the violation (e.g. img-src). |
| LineNumber | Gets the line number in ContentSecurityPolicyViolationReport.SourceFile, or 0. |
| OriginalPolicy | Gets the serialization of the violated policy. |
| Referrer | Gets the referrer of the document, or the empty string. |
| Sample | Gets the sample of the code or of the value that caused the violation (only with the 'report-sample' source), or the empty string. |
| SourceFile | Gets the URL of the script that caused the violation, or null. |
| StatusCode | Gets the HTTP status code of the response of the document. |
BlockedUrl
ContentSecurityPolicyViolationReport.csColumnNumber
ContentSecurityPolicyViolationReport.csGets the column number in ContentSecurityPolicyViolationReport.SourceFile, or 0.
public int ColumnNumber { get; }Property value
Disposition
ContentSecurityPolicyViolationReport.csGets whether the violated policy is enforced (the resource is blocked) or report-only.
public SecurityPolicyViolationEventDisposition Disposition { get; }Property value
DocumentUrl
ContentSecurityPolicyViolationReport.csEffectiveDirective
ContentSecurityPolicyViolationReport.csLineNumber
ContentSecurityPolicyViolationReport.csGets the line number in ContentSecurityPolicyViolationReport.SourceFile, or 0.
public int LineNumber { get; }Property value
OriginalPolicy
ContentSecurityPolicyViolationReport.csSourceFile
ContentSecurityPolicyViolationReport.csStatusCode
ContentSecurityPolicyViolationReport.csMethods
| Name | Description |
|---|---|
| ToString() | Returns a string that represents the current object. |