我正在通过chrome.commands.onCommand.addListener
事件帮助我定义特定命令并将其绑定到组合键。
{
"name": "My extension",
...
"commands": {
"toggle-feature-foo": {
"suggested_key": {
"default": "Ctrl+Shift+Y",
"mac": "Command+Shift+Y"
},
"description": "Toggle feature foo"
},
"_execute_browser_action": {
"suggested_key": {
"windows": "Ctrl+Shift+Y",
"mac": "Command+Shift+Y",
"chromeos": "Ctrl+Shift+U",
"linux": "Ctrl+Shift+J"
}
},
"_execute_page_action": {
"suggested_key": {
"default": "Ctrl+E"
"windows": "Alt+P",
"mac": "Option+P",
}
}
},
...
}
我的问题是,如何绑定组合键以注册其他组合键,而不是像tutorial所示启动browser_action.html。
例如:我想通过[Mouse Middle Click + P]注册Ctrl + P。