Google chrome extension '&书信电报;所有URL>';不是可识别的权限

Google chrome extension '&书信电报;所有URL>';不是可识别的权限,google-chrome-extension,Google Chrome Extension,我根据以下代码请求许可: chrome.permissions.request({permissions:["<all_urls>"]},function(granted){ if(granted) { ;; } }); chrome.permissions.request({permissions:[“”]},函数(已授予){ 如果(授予){ ;; } }); 但我得到了一个错误: Unchecked runtim

我根据以下代码请求许可:

chrome.permissions.request({permissions:["<all_urls>"]},function(granted){
        if(granted) {
            ;;
        }
    });
chrome.permissions.request({permissions:[“”]},函数(已授予){
如果(授予){
;;
}
});
但我得到了一个错误:

Unchecked runtime.lastError while running permissions.request: '<all_urls>' is not a recognized permission.
运行权限时未选中runtime.lastError。请求:“”不是可识别的权限。
这是一个bug吗?

而不是:

chrome.permissions.request({origins:[“”]},函数(已授予){
// ...
});
而不是:

chrome.permissions.request({origins:[“”]},函数(已授予){
// ...
});

OP还需要更新其清单以包含可选权限。我猜OP还没有这样做。@blunderboy如果OP没有在
的“可选权限”
中列出权限,那么他们会在
chrome.runtime.lastError中看到以下明确的错误:“可选权限必须列在扩展清单中。”OP还需要更新其清单以包含可选权限。我猜OP还没有这样做。@blunderboy如果OP没有在
的“可选权限”
中列出权限,那么他们会在
chrome.runtime.lastError中看到以下明确的错误:“可选权限必须列在扩展清单中。”
chrome.permissions.request({origins: ["<all_urls>"] }, function(granted) {
    // ...
});