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