Chrome Extension “Refused to load the script because it violates the following Content Security Policy directive”

前端 未结 7 1396
孤城傲影
孤城傲影 2020-12-29 18:50

I\'m trying to create a Chrome extension, but none of my JS works. The console shows this error:

Refused to load the script \'https://ajax.googleapi

相关标签:
7条回答
  • 2020-12-29 19:50

    well, you cant use CDN for js, you will be have to copy the content of "https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js" and create a new file inside your js directory and call it jquery.min.js and paste everything in it , then in your HTML file header remove the line that has this url in it and use this one instead

    <script src="js/jquery.min.js"></script>
    

    but make sure that this is the write path for the file that contains all the data in the mentioned url

    cheers,

    0 讨论(0)
提交回复
热议问题