Ionic cordova 如何设置 worker-src?
Ionic cordova how to set worker-src?
我正在尝试为我的 cordova 应用程序设置 worker-src。当我为浏览器构建 cordova 时,它显示
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
所以我尝试通过 https://content-security-policy.com/
来设置 worker-src,但他们没有 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' *">
我正在尝试为我的 cordova 应用程序设置 worker-src。当我为浏览器构建 cordova 时,它显示
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
所以我尝试通过 https://content-security-policy.com/
来设置 worker-src,但他们没有 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' *">