【问题标题】:Chrome App Manifest Not Allowing My URL'SChrome 应用清单不允许我的网址
【发布时间】:2013-10-31 17:25:04
【问题描述】:

我的清单具有以下权限行:

"permissions": ["https://api.vineapp.com/*", "storage", "webRequest","http://platform.vine.co/*", "background","*://davine.co/*", "notifications"]

我已开始将我的应用上传并发布到 Chrome 网上应用店,但它返回以下错误,

An error occurred: Failed to process your item.

The field permissions.https://api.vineapp.com/* is not allowed in manifest.
The field permissions.http://platform.vine.co/* is not allowed in manifest.
The field permissions.*://davine.co/* is not allowed in manifest.

但 Chrome 应用程序文档中明确指出,您计划向其发出 ajax/xhr 请求的任何域都应在清单的权限中说明。我尝试从我的清单中删除它们并再次上传,它通过了,但我得到了大量的 CORS 错误,并且我的应用被禁止发出请求。

【问题讨论】:

    标签: google-chrome google-chrome-app chrome-web-store


    【解决方案1】:

    我没有尝试过使用通配符,但它应该可以删除尾随星号,正如文档所述:Referencing External Resources

    此外,协议中带有通配符的 url 也不是 kosher,请尝试这样:

    "permissions": ["https://api.vineapp.com/", "storage", "webRequest",
    "http://platform.vine.co/", "background","http://davine.co/", "https://davine.co/",
    "notifications"]
    

    并将除 http 或 https 之外的任何内容添加到列表中。

    【讨论】:

    • 请注意,“引用外部资源”似乎与 match patterns 的规范不一致——我怀疑这是最近的更改,Google 尚未更正其不一致的文档。 (+1)
    【解决方案2】:

    您是否尝试过使用这种模式的通配符?

    "permissions": ["https://api.vineapp.com*", "storage", "webRequest",
          "http://platform.vine.co*", "background","*://davine.co*", "notifications"]
    

    【讨论】:

      猜你喜欢
      • 2015-03-27
      • 2013-01-19
      • 1970-01-01
      • 2020-07-31
      • 1970-01-01
      • 1970-01-01
      • 2015-10-19
      • 1970-01-01
      • 2023-03-26
      相关资源
      最近更新 更多