首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“宽主机权限”webstore chrome扩展发布错误

“宽主机权限”webstore chrome扩展发布错误
EN

Stack Overflow用户
提问于 2018-10-28 09:04:41
回答 1查看 1.6K关注 0票数 1

我试图发布到网上商店的铬扩展。在chrome的开发者区域,我得到了错误。我试着在预告中添加"activeTab“,但是没有什么改变。

这是我的舱单:

代码语言:javascript
复制
{
    "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>"
    ]
}

这是一个错误:

代码语言:javascript
复制
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/*"]
}

我能做什么?

EN

回答 1

Stack Overflow用户

发布于 2018-10-31 14:31:37

我认为当您的扩展请求过于通用的权限时,会显示此错误。

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

代码语言:javascript
复制
content_scripts": [
 { 
   "matches": "https://*/*", 
   "js": ["my-script.js"] 
 }
]

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

你也有同样的错误。在您的示例中,由于optional_permissions all_url,也可能会显示此错误。

代码语言:javascript
复制
"optional_permissions": [ 
  "< all_urls>"
]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53029899

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档