相关疑难解决方法(0)

拒绝将字符串评估为JavaScript,因为'unsafe-eval'不是允许的

重新加载Chrome扩展程序时出现此错误:

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".


    at new Function (<anonymous>)
    at evalExpression (compiler.js:33919)
    at jitStatements (compiler.js:33937)
    at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._interpretOrJit (compiler.js:34520)
    at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileTemplate (compiler.js:34448)
    at compiler.js:34347
    at Set.forEach (<anonymous>)
    at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileComponents (compiler.js:34347)
    at compiler.js:34217
    at Object.then (compiler.js:474)
Run Code Online (Sandbox Code Playgroud)

我在manifest.json中有这个:

 "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
Run Code Online (Sandbox Code Playgroud)

我可以使用任何其他设置来避免该错误吗?

javascript google-chrome-extension angular5

8
推荐指数
4
解决办法
1万
查看次数