0

I'm trying to run a simple JS function (in index.js) in a regular HTML file, but I keep getting this error: Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”).

I tried inserting this <meta> tag:

<meta http-equiv="Content-Security-Policy" content="script-src 'index.js'"/>

I also tried putting the JS code in the <script> tag and replacing index.js with self, but no luck. I also tried using a "nonce", but it also didn't work. I'm new to web/extension development and I didn't even know CSP existed, so please provide a beginner-friendly explanation.

I'm running the extension as a temporary add-on through about:debugging (local).

tigerros
  • 73
  • 1
  • 6

0 Answers0