W3cubDocs

/DOM

SecurityPolicyViolationEvent

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The SecurityPolicyViolationEvent interface is an event sent on a document or worker when its content security policy is violated.

Constructor

SecurityPolicyViolationEvent()
Creates a SecurityPolicyViolationEvent object.

Properties

SecurityPolicyViolationEvent.blockedURIRead only
The URI of the resource blocked because it violates a policy.
SecurityPolicyViolationEvent.dispositionRead only
Indicates how the violated policy is configured to be treated by the user agent. This will be "enforce" or "report".
SecurityPolicyViolationEvent.documentURIRead only
The URI of the document or worker in which the violation was found.
SecurityPolicyViolationEvent.effectiveDirectiveRead only
The string representing the directive whose enforcement uncovered the violation.
SecurityPolicyViolationEvent.LineNumberRead only
The line number in the document or worker at which the violation occurred.
SecurityPolicyViolationEvent.originalPolicyRead only
A string containing the policy whose enforcement uncovered the violation.
SecurityPolicyViolationEvent.referrerRead only
The referrer of the resources whose policy was violated. This will be a URL or null.
SecurityPolicyViolationEvent.sourceFileRead only
The URI of the document or worker in which the violation was found.
SecurityPolicyViolationEvent.statusCodeRead only
The HTTP status code of the document or worker in which the violation occurred.
SecurityPolicyViolationEvent.violatedDirectiveRead only
The string representing the directive whose enforcement uncovered the violation.

Specifications

Browser Compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) (Yes) ? ? (Yes) ?
Worker support 56.0 43
Feature Android Webview Edge Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support (Yes) (Yes) ? ? ? (Yes) ? (Yes)
Worker support 56.0 43 56.0

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent