Javascript 有没有办法将本地脚本导入chrome代码段?

Javascript 有没有办法将本地脚本导入chrome代码段?,javascript,google-chrome,google-chrome-extension,Javascript,Google Chrome,Google Chrome Extension,我知道TamperMonkey,但我需要在chrome扩展页面上运行脚本。因此,最简单的方法是将代码存储到chrome代码段中,并在需要时运行它 我想知道有没有办法在chrome代码片段中要求使用本地代码 我也试过这个代码 这是不一样的,但它会起作用。但它抛出了这个错误 VM211 testing:3 Refused to load the script 'http://localhost:5656/javascripts/test.js' because it violates the

我知道TamperMonkey,但我需要在chrome扩展页面上运行脚本。因此,最简单的方法是将代码存储到chrome代码段中,并在需要时运行它

我想知道有没有办法在chrome代码片段中要求使用本地代码

我也试过这个代码

这是不一样的,但它会起作用。但它抛出了这个错误

VM211 testing:3 Refused to load the script 
'http://localhost:5656/javascripts/test.js' 
because it violates the following Content Security Policy directive: "script-src 'self'". 
Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
注意:此代码适用于某些网站,例如BBC网站,但在我需要它运行的页面中,它不起作用。

这有帮助吗?