SecurityPolicyViolationEvent: violatedDirective-Eigenschaft

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2016.

Hinweis: Diese Funktion ist in Web Workers verfügbar.

Die schreibgeschützte Eigenschaft violatedDirective des SecurityPolicyViolationEvent-Interfaces ist ein Zeichenfolgenwert, der die Content Security Policy (CSP)-Direktive darstellt, die verletzt wurde.

Dies ist ein historischer Alias von SecurityPolicyViolationEvent.effectiveDirective und hat denselben Wert.

Wert

Eine Zeichenfolge, die die verletzte Content-Security-Policy-Direktive darstellt.

Beispiele

js
document.addEventListener("securitypolicyviolation", (e) => {
  console.log(e.violatedDirective);
});

Spezifikationen

Specification
Content Security Policy Level 3
# dom-securitypolicyviolationevent-violateddirective

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
violatedDirective

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support