Chrome extension Content Security Policy directive error

前端 未结 4 1249
悲哀的现实
悲哀的现实 2020-12-08 15:44

I\'m trying to make radio stream chrome extension but there is a problem. When I run my script in browser like normal JS+HTML+CSS it works, but when I try runing it like Chr

4条回答
  •  情歌与酒
    2020-12-08 16:33

    Your problems are as follows:

    1. Chrome CSP forbids inline code, and this is not subject to override. Your 'unsafe-eval' does not address the issue, and 'unsafe-inline' that would've helped will be ignored by Chrome.

      You need to get rid of inline code:

      
      

      This needs to be moved in a js file.

    2. There is a typo in your manifest.json, you forgot a comma:

      "version": "1.0",
      

      In general, using a JSON validator can help you catch those errors.

提交回复
热议问题