【问题标题】:"Broad host permissions" webstore chrome extension publish error“广泛的主机权限” webstore chrome 扩展发布错误
【发布时间】:2019-04-01 11:08:13
【问题描述】:

我尝试发布到 webstore chrome 扩展。 在 chrome 的开发人员区域中我得到了错误。 我尝试在我的清单中添加“activeTab”,但没有任何改变。

这是我的清单:

{
    "name": "scan document",
    "version": "1.0",
    "manifest_version": 2,
    "description": "scan document",
    "browser_action": {
        "default_icon": {
            "16": "icon.png"
        }
    },
    "content_scripts": [{
            "matches": ["<all_urls>"],
            "js": ["contentScript.js"],
            "all_frames": true
        }],
    "background": {
        "scripts": ["background.js"]
    },
    "permissions": [
        "nativeMessaging"
    ],
    "optional_permissions": [ 
        "downloads.open",
        "<all_urls>"
    ]
}

这是错误:

Because of the following issue, your extension may require an in-depth review:
- Broad host permissions
Instead of requesting broad host permissions, consider using the activeTab permission, or specify the sites that your extension needs access to. Both options are more secure than allowing full access to an indeterminate number of sites, and they may help minimize review times.

The activeTab permission allows access to a tab in response to an explicit user gesture.

{
...
"permissions": ["activeTab"]
}
If your extension only needs to run on certain sites, simply specify those sites in the extension manifest:
{
...
"permissions": ["https://example.com/*"]
}

我能做什么?

【问题讨论】:

  • 你解决了吗?

标签: google-chrome chrome-native-messaging webstore


【解决方案1】:

我认为当您的扩展程序要求过于笼统的权限时会显示此错误。

在我当前编码的 chrome 扩展中,由于我的 content_scripts 匹配,我遇到了这个错误:

content_scripts": [
 { 
   "matches": "https://*/*", 
   "js": ["my-script.js"] 
 }
]

我将https://*/* 替换为https://www.example.com/* 来修复它。 但是这个脚本只会在这个网站上被调用。

你有同样的错误。在您的情况下,由于 optional_permissions all_url

也可能显示此错误
"optional_permissions": [ 
  "< all_urls>"
]

【讨论】:

    猜你喜欢
    • 2019-03-26
    • 2019-08-04
    • 2018-06-17
    • 1970-01-01
    • 2016-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多