SecurityPolicyViolationEvent

The SecurityPolicyViolationEvent interface inherits from Event, and represents the event object of a securitypolicyviolation event sent on an Element, Document, or worker when its Content Security Policy (CSP) is violated.

MDN Reference

Constructors

Link copied to clipboard
constructor(type: EventType<SecurityPolicyViolationEvent>, init: SecurityPolicyViolationEventInit = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
external val blockedURI: String

The blockedURI read-only property of the SecurityPolicyViolationEvent interface is a string representing the URI of the resource that was blocked because it violates a Content Security Policy (CSP).

Link copied to clipboard
external val bubbles: Boolean
Link copied to clipboard
external val cancelable: Boolean
Link copied to clipboard
external val columnNumber: Int

The columnNumber read-only property of the SecurityPolicyViolationEvent interface is the character position in the source file line of the document or worker script at which the Content Security Policy (CSP) violation occurred.

Link copied to clipboard
external val composed: Boolean
Link copied to clipboard
external val currentTarget: EventTarget?
Link copied to clipboard
Link copied to clipboard

The disposition read-only property of the SecurityPolicyViolationEvent interface indicates how the violated Content Security Policy (CSP) is configured to be treated by the user agent.

Link copied to clipboard
external val documentURI: String

The documentURI read-only property of the SecurityPolicyViolationEvent interface is a string representing the URI of the document or worker in which the Content Security Policy (CSP) violation occurred.

Link copied to clipboard

The effectiveDirective read-only property of the SecurityPolicyViolationEvent interface is a string representing the Content Security Policy (CSP) directive that was violated.

Link copied to clipboard
external val eventPhase: EventPhase
Link copied to clipboard
external val isTrusted: Boolean
Link copied to clipboard
external val lineNumber: Int

The lineNumber read-only property of the SecurityPolicyViolationEvent interface is the line number in the document or worker script at which the Content Security Policy (CSP) violation occurred.

Link copied to clipboard
external val originalPolicy: String

The originalPolicy read-only property of the SecurityPolicyViolationEvent interface is a string containing the Content Security Policy (CSP) whose enforcement uncovered the violation.

Link copied to clipboard
external val referrer: String

The referrer read-only property of the SecurityPolicyViolationEvent interface is a string representing the referrer for the resources whose Content Security Policy (CSP) was violated. This will be a URL or null.

Link copied to clipboard
external val sample: String

The sample read-only property of the SecurityPolicyViolationEvent interface is a string representing a sample of the resource that caused the Content Security Policy (CSP) violation.

Link copied to clipboard
external val sourceFile: String

The sourceFile read-only property of the SecurityPolicyViolationEvent interface is a string representing the URL of the script in which the Content Security Policy (CSP) violation occurred.

Link copied to clipboard
external val statusCode: Short

The statusCode read-only property of the SecurityPolicyViolationEvent interface is a number representing the HTTP status code of the window or worker in which the Content Security Policy (CSP) violation occurred.

Link copied to clipboard
external val target: EventTarget?
Link copied to clipboard
Link copied to clipboard
open external override val type: EventType<SecurityPolicyViolationEvent>
Link copied to clipboard

The violatedDirective read-only property of the SecurityPolicyViolationEvent interface is a string representing the Content Security Policy (CSP) directive that was violated.

Functions

Link copied to clipboard
Link copied to clipboard
external fun preventDefault()
Link copied to clipboard
Link copied to clipboard
external fun stopPropagation()