google-chrome-extension - "Broad host permissions"错误,尽管我的主机权限很窄

标签 google-chrome-extension google-chrome-app

当我发布 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/

相关文章:

google-chrome-extension - Chrome 扩展中的 RequireJS

javascript - 为什么 chrome.notifications.onButtonClicked.addListener 函数运行多次?

google-chrome - 在窗口打开事件中在后台运行的 Chrome 扩展程序?

google-chrome-extension - 我们如何从 chrome 扩展执行 shell 命令;有提供的方法吗?

javascript - Chrome Apps <a> 标签不工作

google-chrome - 什么会导致 Chrome 浏览器扩展程序崩溃?

javascript - Chrome : Native messaging Error: Access to the specified native messaging host is forbidden

javascript - 在浏览器选项卡中运行 Chrome 打包应用程序

javascript - 从 Angular Controller 调用 webview 方法

javascript - (打包的Chrome应用程序)chrome.identity.getAuthToken需要manifest.json中的 "key"