Note: This feature is available in Web 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 SecurityPolicyViolationEvent.violatedDirective, its historical alias.
A string representing the particular Content-Security-Policy directive that was violated.
document.addEventListener("securitypolicyviolation", (e) => {
console.log(e.effectiveDirective);
});