1

I am making a chrome extension in JS but am getting the following errors. I found some similar posts related to it but none of them solved my issue (will explain further down in the post):

Refused to load the script 'https://cdn.jsdelivr.net/npm/brython@3.9.0/brython.min.js' because it violates the following Content Security Policy directive: "script-src 'self' https://example.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

manifest.json

 {
    "name": "name",
    "version": "0.1",
    "description": "desc",
    "permissions": [
      "activeTab",
      "<all_urls>",
      "tabs",
    ],   
    
    "browser_action": {
        "default_icon": "mainlogo.png",
        "default_popup": "popup.html"
       },
    "manifest_version": 2,
    "content_security_policy": "script-src 'self' 'unsafe-eval' https://www.gstatic.com/ https://*.firebaseio.com https://www.googleapis.com https://cdn.jsdelivr.net; object-src 'self'"

  }

popup.html

<script type="text/javascript"
    src="https://cdn.jsdelivr.net/npm/brython@3.9.0/brython.min.js">
    </script> 

Other posts suggested manually including the files needed in the folder but I don't think that is the solution here.

I need to include Brython hence the script tag in popup.html

Can anyone explain what I am doing wrong here. Thanks

I am relatively new to StackOverflow so please let me know if I need to fix anything or if I did something wrong

Thanks!

0 Answers0