Chome扩展程序:拒绝加载脚本'https://apis.google.com/js/api.js? (没有内联脚本)

时间:2020-07-17 19:11:32

标签: javascript google-chrome google-chrome-extension

我正在尝试通过Chrome扩展程序实现OAuth第三方身份验证。我收到上述错误。从以前的堆栈溢出文章中,我确保代码中没有内联脚本,并且我使用的是HTTPS协议。但是,我仍然收到相同的错误。奇怪的是,如果我只是通过npm run start运行代码,则不会出现身份验证问题。只有在遇到问题时才加载build文件夹。这是我的manifest.json代码:

{   
      "manifest_version": 2,
      "name": "Twitter Store",
      "author": "SOMENAME",
      "version": "1.0.1",
      "description": "Save and organize tweets",
      "icons": {
        "16": "logo192.png",
        "48": "logo512.png",
        "128": "logo512.png"
      },
      "background": {
        "scripts": ["background.js"],
        "persistent": false
      },
      "browser_action": {
        "default_popup": "popup.html"
      },
      "chrome_url_overrides": {
        "newtab": "index.html"
      },
      "permissions": ["storage", "tabs", "identity"],
      "content_security_policy":"script-src 'self' https://www.gstatic.com/ https://*.firebaseio.com https://www.googleapis.com; object-src 'self'",
      "oauth2": {
        "client_id": "SOMEID",
        "scopes": [
          "https://www.googleapis.com/auth/userinfo.email",
          "https://www.googleapis.com/auth/userinfo.profile"
        ]
      },
      "key": "<SOMEKEY>"
    }

0 个答案:

没有答案
相关问题