我想摆弄一下chrome标签,特别是我想用chrome.tabs.group对它们进行分组
https://developer.chrome.com/docs/extensions/reference/tabs/#method-group
但是,此函数未定义
这是我的manifest.json
{
"name": "Test",
"version": "1.0",
"description": "Test",
"manifest_version": 2,
"permissions": ["tabs"],
"page_action": {
"default_popup": "popup.html"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"commands": {
"toggle-pin": {
"suggested_key": { "default": "Ctrl+Shift+P" },
"description": "Test Action"
}
}
}这是我的background.js脚本
chrome.commands.onCommand.addListener(function (command) {
if (command == "toggle-pin") {
chrome.tabs.query({ currentWindow: true }, function (tabs) {
// Here i want to use the chrome.tabs.group method, but
// it is not defined
})
}
})我错过了什么?
发布于 2020-12-13 13:30:11
正如@wOxxOm指出的那样,这个功能只在Chrome 88中可用(现在是2020年12月12日的测试版)
https://stackoverflow.com/questions/65265640
复制相似问题