SecurityPolicyViolationEvent: violatedDirective property
Reporting API
Reporting API
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.
Value
A string representing the Content-Security-Policy directive that was violated.
Examples
document.addEventListener("securitypolicyviolation", (e) => {
console.log(e.violatedDirective);
});