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