这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
effectiveDirective
只读特性在
SecurityPolicyViolationEvent
接口是
DOMString
representing the directive whose enforcement uncovered the violation.
let effDir = violationEventInstance.effectiveDirective;
A
DOMString
representing the directive whose enforcement uncovered the violation.
document.addEventListener("securitypolicyviolation", (e) => {
console.log(e.effectiveDirective);
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
Content Security Policy Level 3
The definition of 'effectiveDirective' in that specification. |
工作草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
effectiveDirective
|
Chrome Yes | Edge 15 |
Firefox
63
|
IE 不支持 No | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes |
Firefox Android
63
|
Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
不支持
用户必须明确启用此特征。