我是 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/