【发布时间】:2021-02-10 16:53:04
【问题描述】:
我正在尝试在依赖于光滑网格 (slickgrid.js) 的项目上添加 CSP 标头。我认为以下行会导致问题:
$focusSink = $("<div tabIndex='0' hideFocus style='position:fixed;width:0;height:0;top:0;left:0;outline:0;'></div>").appendTo($container)
这是我在浏览器上遇到的错误:
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'
我尝试了 sha256- 但它没有帮助,因为这些是样式属性。还有其他选择吗?
【问题讨论】:
标签: javascript content-security-policy slickgrid