发布扩展程序时如何解决“宽主机权限”?

时间:2019-08-13 17:26:45

标签: google-chrome-extension permissions publishing

我刚刚发布了Google Chrome浏览器扩展程序,却遇到错误消息:“由于以下问题,您的扩展程序可能需要进行深入的审查: -广泛的主机权限” 虽然我知道为什么会这样(请参阅清单代码片段),但我想知道修复它的最佳方法是什么?

我知道这与我使用的通配符有关,现在我已在特定网站上发布了扩展名以测试其预期的功能(确实如此)。但是,为了使扩展真正有效,我希望它可以更普遍地工作。


"content_scripts"   : [{
        "matches"           : [ "http://*/*","https://*/*" ],
        "exclude_globs"     : [ "*.jpg","*.jpeg","*.gif","*.png","*.bmp","*.webp",
                                "*.css","*.swf","*.js","*.zip","*.rar","*.tar","*.tar.gz","*.tgz","*.tar.bz2","*.tbz2",
                                "*.doc","*.docx","*.ppt","*.pptx","*.xls","*.xlsx","*.pdf","*.xml","*.txt",
                                "*.mpg","*.mpeg","*.qt","*.mp4","*.m4v","*.m4a","*.mp3","*.ogv","*.ogm","*.ogg","*.oga","*.webm","*.wav",
                                "*.","*." ],
        "css"               : [ "css/inject.css" ],
        "js"                : [ "js/jquery.js" , "js/inject.js" ],
        "run_at"            : "document_start"
    }],
    "web_accessible_resources" : [
        "html/iframe/*",
        "src/options/options.html"
    ],
    "permissions"       : [
        "tabs"
        "activeTab",
        "webRequest",
        "http://*/*",
        "https://*/*",
            "storage"
    ]
}

0 个答案:

没有答案