cordova - 离子科尔多瓦如何设置worker-src?
问题描述
我正在尝试为我的科尔多瓦应用程序设置 worker-src。当我为浏览器构建科尔多瓦时,它显示
plugin.min.js:582 Refused to create a worker from
'blob:http://localhost:8000/a641e3c9-53b6-4a67-bf4f-281a66e78530'
because it violates the following Content Security Policy
directive: "script-src * 'unsafe-inline' 'unsafe-eval'".
Note that 'worker-src' was not explicitly set, so 'script-src'
is used as a fallback
所以我尝试通过设置 worker-srchttps://content-security-policy.com/
但他们没有类似worker-src
. 我该如何解决这个问题?任何想法将不胜感激。谢谢。
解决方案
您应该使用 child-src 而不是 worker-src 例如。是
<meta http-equiv="Content-Security-Policy" content="default-src *; child-src * 'self' blob: http:;
img-src * 'self' data: http:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *;
style-src 'self' 'unsafe-inline' *">
推荐阅读
- matlab - 如何使用源文件名自动保存绘制的图形?
- python - 字符串到列表的转换 - 分隔符问题
- apache-kafka - 以下订阅的主题未分配给任何成员
- angular - Storybook 在角度库中给出“无法解析 AppComponent 的所有参数”错误
- phpunit - 运行单个测试方法时,PhpStorm 无法获取文件夹的配置
- php - WooCommerce ajax 获取订单状态并重定向到 url
- javascript - React 函数高阶组件
- python - 如何加快熊猫 drop() 方法?
- magento - 如何解决未定义索引的问题:在 magento 2.3.1 中自定义导入期间的 sku
- python - 二进制编码或填充神经网络中的输入序列?