当我发布 Chrome 扩展程序时,我收到以下警告。我不请求广泛的主机权限,只请求 8 个特定域的权限:
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.
{
"manifest_version": 2,
"name": "My Amazing Extension",
"version": "1.3",
"description": "It's great",
"icons": {
"16": "img/icon16.png",
"32": "img/icon32.png",
"48": "img/icon48.png",
"128": "img/icon128.png"
},
"browser_action": {
"default_title": "My Amazing Extensions"
},
"background": {
"scripts": ["background.js"]
},
"content_scripts": [
{
"run_at": "document_start",
"matches": ["*://www.domain.com/*", "*://www.domain.co.uk/*", "*://www.domain.ca/*", "*://www.domain.de/*", "*://www.domain.fr/*", "*://www.domain.es/*", "*://www.domain.it/*", "*://www.domain.in/*"],
"js": ["content0.js"]
}],
"web_accessible_resources": [
"font.css",
"AZSDstyle.css",
"font.woff2",
"img/*"
],
"permissions": [
"activeTab",
"storage",
"*://www.domain.com/*",
"*://www.domain.co.uk/*",
"*://www.domain.ca/*",
"*://www.domain.de/*",
"*://www.domain.fr/*",
"*://www.domain.es/*",
"*://www.domain.it/*",
"*://www.domain.in/*"
],
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'"
}
最佳答案
如@wOxxOm在他的评论中提到,它很可能被拒绝,因为检测器有点问题,可能是因为方案中的 * 。
就我而言,延期在 30 分钟内获得批准,如果存在实际的“广泛权限”问题,而根据过去的经验,需要一周或更长时间才能获得批准,这速度异常快。
将 *://
替换为 http://
和 https://
在单独的行上可能会避免出现此错误第一名。
关于google-chrome-extension - "Broad host permissions"错误,尽管我的主机权限很窄,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55141280/