无法解决扩展程序中的内容安全策略错误

时间:2018-07-29 21:24:09

标签: javascript html google-chrome-extension

无论我做什么,我的弹出窗口都会不断返回此错误,“拒绝执行内联脚本,因为它违反了以下内容安全策略指令:“ script-src'self'https://s3.tradingview.com/tv.js”。 -inline'关键字,散列('sha256-RtrTopek4SlRj1jJ / Err6CDLFxdi7 + ka5mWfZxTAPfY =')或随机数('nonce -...')即可启用内联执行。

我已经尝试了所有修复方法,包括粘贴源JS并单独运行它,我在清单中使用了content_security_policy,但这似乎行不通。有什么我可以尝试解决的选项吗?我的manifest.json在下面,

Logging before InitGoogleLogging() is written to STDERR
E0729 20:58:01.995159  2016 common_gpu.cc:42] Found an unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES

HTML和JS代码,

    {
  "name": "Stellar Lumens Price Tracker",
  "version": "1.1",
  "manifest_version": 2,
  "description": "Display the price of Stellar Lumens right in your browser.",
  "content_security_policy": "script-src 'self' https://s3.tradingview.com/tv.js; object-src 'self'",
  "browser_action": {
    "default_title": "Stellar Lumens Price Tracker",
    "default_popup": "popup.html",
    "default_icon": "stellar.png"
  },
  "background": {
    "scripts":["price.js", "popup.js"],
    "persistent": true
  }
}

0 个答案:

没有答案