google-chrome - Chromium 的 XSS 审核员拒绝执行脚本

标签 google-chrome chromium

这是来自 Chrome 检查器的消息:

The XSS Auditor refused to execute a script in http://localhost/Disposable Working NOTAS.php because its source code was found within the request. The auditor was enabled as the server sent neither an 'X-XSS-Protection' nor 'Content-Security-Policy' header.

...我的笔记本电脑上的本地主机上有几十个网站,我在工作流程中使用它们,在过去的几天里,更新后的 Chrome 更改了一些内容,几乎所有网站的文本区域' 内容不再保存到文件中。

保存我所做编辑的代码全部被破坏;我输入新文本,单击 在保存和我的浏览器上,而不是执行脚本中的 file~writing 子例程 对于我正在处理的网页,只需打开一个新的空白页面。如果我随后反击 按钮,文本区域仍然显示新添加的内容,但在文件中,没有变化 正在追加中。

最佳答案

如果您想告诉 Chrome 禁用其 XSS 保护,您可以发送值为 0X-XSS-Protection header 。由于您似乎使用的是 PHP,因此您可以将其添加到始终在输出任何内容之前执行的位置:

header("X-XSS-Protection: 0");

关于google-chrome - Chromium 的 XSS 审核员拒绝执行脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17016960/

相关文章:

performance - 在 chrome 中,为什么 DOMContentLoaded 看起来比请求/响应本身花费的时间更长?

javascript - 在 Chrome 中使用 React 添加新的 DOM 项目不会保持预期的滚动位置

html - 如何为 Chrome SnappySnippet 选择元素?

firefox - 将Cookie复制到其他域。火狐浏览器? Chrome ?

javascript - window.open 在 chrome 扩展中返回 undefined

google-chrome - 有没有办法将 Chrome 应用程序快捷方式添加到 Google Chrome 中的书签栏?

delphi - 如何可靠地知道(以编程方式)页面何时在 Chromium 中加载

google-chrome - docker 官方 dind 构建 (docker :latest) with chromiuim

electron - 控制台日志不再显示信息日志

javascript - 如何将变量传递给 Puppeteer page.on?