Reputation: 1363
I'm trying to set worker-src for my cordova application. When I build cordova for browser, it shows
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
So I tried to set worker-src by going through https://content-security-policy.com/
but they don't have anything like worker-src
. How do I solve this? Any idea will be appreciated. Thanks.
Upvotes: 1
Views: 979
Reputation: 254
You should use child-src instead of worker-src eg. is
<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' *">
Upvotes: 2