- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
无法让 Chrome/任何浏览器发送使用 Report-To header 生成的报告
嗨,我正在尝试收集 Deprecation/Crash/Intervention浏览器访问触发事件的网页生成的报告。我有一个端点设置,当浏览器访问页面时,它当前接收 CSP 报告,但即使控制台和日志查看器中存在弃用错误,也生成了弃用报告,它不是由 chrome(或Safari 或 Firefox)。Report-To
正在发送 header 以及 NEL header (它也无法发送报告但不是我的重点),通过使用 securityheaders.com 扫描我的页面可以看出:
(测试的最大年龄在这里很短,但我已经尝试了整整一年)
日志
使用 chrome://net-export/
并访问带有已弃用 JS 的页面,我可以看到在“Per origin config”部分中设置了正确的信息:
并且已弃用的 JS 正在生成弃用报告:
但由于某种原因,报告从未发送。有时,在日志转储中,它说已经多次尝试发送报告。
测试
我曾尝试将 chrome 与命令行标志一起使用 --enable-features=Reporting
和 --enable-blink-features=Reporting
(尽管我认为无论如何都启用了三种报告类型; Intervention 、 Deprecation 和 Crash )。我还使用了 safari 和 firefox,并在控制台中收到了弃用警报,但发送的唯一报告是 CSP 报告。
最佳答案
The Reporting API was designed to be out of band from your web app. The browser captures, queues and batches, then sends reports automatically at the most opportune time. Reports are sent internally by the browser, so there's little to no performance concern (e.g. network contention with your app) when using the Reporting API. There's also no way to control when the browser sends queued reports.
关于http - 从 Report-To 标题获取弃用报告;正在生成报告但未发送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62302176/
我是一名优秀的程序员,十分优秀!