Google chrome extension 如何为Chrome扩展设置权限和内容安全策略

Google chrome extension 如何为Chrome扩展设置权限和内容安全策略,google-chrome-extension,permissions,manifest,content-security-policy,Google Chrome Extension,Permissions,Manifest,Content Security Policy,我正在尝试批准我的Chrome扩展,并希望了解如何正确填写manifest.json的“permissions”和“csp”部分。这些部分如下: ... "permissions": [ "storage", "http://api.openweathermap.org/data/2.5/weather*" ], "content_security_policy": "de

我正在尝试批准我的Chrome扩展,并希望了解如何正确填写manifest.json的“permissions”和“csp”部分。这些部分如下:

  ...
  "permissions": [
    "storage",
    "http://api.openweathermap.org/data/2.5/weather*"
  ],

  "content_security_policy": "default-src 'self' http://api.openweathermap.org/data/2.5/weather*; script-src 'self'"
  ...
这被拒绝了

我只使用:

  • 本地存储,用于存储有关天气的信息
  • OpenWeatherMapAPI以获取天气信息(JSON)
  • 我不使用任何远程脚本

    因此,我的问题是:

  • 如果我使用localStorage(不是chrome.storage),我真的需要一个“storage”字符串吗
  • 在我的案例中,设置CSP的正确方法是什么