内容安全策略:Google Chrome、Firefox 和 Microsoft Edge 之间的区别

标签 content-security-policy

我是 Content-Security-Policy header 的新手,我一直在尝试定义我们的策略以使我们的应用程序正常工作。

我是谷歌浏览器用户,在谷歌浏览器下,一切似乎都很好。但是,在 Firefox 或 Edge 下,我看到的是这样的:

CSP14309: Unknown directive 'script-src-elem' in Content-Security-Policy - directive will be ignored.



为什么会script-src-elem在 Edge 和 Firefox 中未知,但在 Google Chrome 中正常工作?

究竟是什么script-src-elem ?

帮助?

最佳答案

这是一项新的 CSP 3 政策,迄今为止仅在 Chrome 和少数较小的浏览器(例如 Opera)中实现。

见:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src-elem#Specifications

关于内容安全策略:Google Chrome、Firefox 和 Microsoft Edge 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59146285/

相关文章:

asp.net-mvc - Google Recaptcha 的内容安全策略 header 指令

cordova - 如何在 Cordova 中正确定义 Content-Security-Policy?

webpack - Electron 加载资源失败

node.js - 报告 URI 上缺少内容安全策略违规详细信息

security - 在站点 B 上使用 nginx proxy_pass 来提供内容时,如何覆盖站点 A 的内容安全策略?

javascript - CSP 安全的 ES6 模板文字

http - 设置 script-src 'self' 和 frame-src 'unsafe-inline' 会相互冲突吗?

javascript - 内容安全政策能否与 Google Analytics 和 AdSense 兼容?

html - Jenkins 内容安全策略

testing - CSP本地测试