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