web api instance property
SecurityPolicyViolationEvent: violatedDirective property
Available in workers
The violatedDirective read-only property of the SecurityPolicyViolationEvent interface is a string representing the Content Security Policy (CSP) directive that was violated.
This is a historical alias of effectiveDirective, and has the same value.
Value
A string representing the Content-Security-Policy directive that was violated.
Examples
document.addEventListener("securitypolicyviolation", (e) => {
console.log(e.violatedDirective);
});
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.