This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The blockedURI
read-only property of the SecurityPolicyViolationEvent
interface is a USVString
representing the URI of the resource that was blocked because it violates a policy.
Syntax
let blockedURI = violationEventInstance.blockedURI;
Value
A USVString
representing the URI of the blocked resource.
Example
document.addEventListener("securitypolicyviolation", (e) => { console.log(e.blockedURI); });
Specifications
Specification | Status | Comment |
---|---|---|
Content Security Policy Level 3 The definition of 'blockedURI' in that specification. |
Working Draft | Initial definition |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | Yes | 15 | 591 | No | Yes | Yes |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|---|---|
Basic support | Yes | Yes | Yes | 591 | Yes | Yes | Yes |
1. From version 59: this feature is behind the security.csp.enable_violation_events
preference (needs to be set to true
). To change preferences in Firefox, visit about:config.
See also
Document Tags and Contributors
Tags:
Contributors to this page:
fscholz,
chrisdavidmills
Last updated by:
fscholz,