Closed derdudev closed 2 years ago
It's a 2 step process:
"content_security_policy"
property and set it to the following
"content_security_policy": "script-src 'self' 'unsafe-eval' <remote script routes>; object-src 'self'"
and replace <remote script routes>
with a list of the base routes of the remote scripts you want to include (separated by one space). So e.g. when you want to use a cdnjs library like jsPDF from the link https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js
, it should look like this:
"content_security_policy": "script-src 'self' 'unsafe-eval' https://cdnjs.cloudflare.com; object-src 'self'"
meta
-tag in the html file into which your main content script is imported. The meta tag should look like the following
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-eval' <remote script routes>">
Again, replace <remote script routes>
with the same routes you already inserted in step 1.
This did it for me.
This problem is really driving me crazy.
my manifest.js file:
Am I missing any permissons? Why does this CSP error occur in the extension script but not when using the remote scripts in another unrelated "normal" html file?