这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
sourceFile
只读特性在
SecurityPolicyViolationEvent
接口是
USVString
representing the URI of the document or worker in which the violation was found.
let source = violationEventInstance.sourceFile;
A
USVString
representing the URI of the document or worker in which the violation was found.
document.addEventListener("securitypolicyviolation", (e) => {
console.log(e.sourceFile);
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
Content Security Policy Level 3
The definition of 'sourceFile' in that specification. |
工作草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
sourceFile
|
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 |
完整支持
不支持
用户必须明确启用此特征。