这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
disposition
只读特性在
SecurityPolicyViolationEvent
interface indicates how the violated policy is configured to be treated by the user agent.
let disposition = violationEventInstance.disposition;
A value defined in the
SecurityPolicyViolationEventDisposition enum
representing the URI of the blocked resource. Possible values are
"enforce"
or
"report"
document.addEventListener("securitypolicyviolation", (e) => {
console.log(e.disposition);
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
Content Security Policy Level 3
The definition of 'disposition' in that specification. |
工作草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
disposition
|
Chrome Yes | Edge ≤18 |
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 |
完整支持
不支持
用户必须明确启用此特征。