キーボード ショートカットを Chrome 拡張機能に実装しようとしています。
私はこれを管理しましたが、上部にある数字ではなくテンキーを使用するキーボードショートカットが欲しいです (まあ、それに加えて)。
以下は私のマニフェストとスクリプトです。
おそらく、これは Chrome コマンドの制限です。
マニフェスト.json
{
"name": "Shortcut Test",
"version": "1",
"manifest_version": 2,
"background": {"scripts": ["background.js"]},
"commands": {
"shortcut_test": {
"suggested_key": {
"default": "Ctrl+0",
"windows": "Ctrl+0"
},
"description": "A test shortcut"
}
}
}
background.js
chrome.commands.onCommand.addListener(function(command){
console.log(command);
});