当在开发人员模式下以未打包的形式加载ext时,键盘快捷键可以完美工作。
但是当发布到chrome网上商店并下载时-他们只是拒绝工作。
manifest.json
"commands": {
"_execute_browser_action": {
"suggested_key": {
"default": "Alt+B"
},
"description": "Open BGA form page"
},
"autocomplete": {
"suggested_key": {
"default": "Alt+Z"
},
"description": "Autocomplete form with BGA data"
}
}
background-scripts/autocomplete.js
chrome.commands.onCommand.addListener((command) => {
if (command === "autocomplete") {
do_stuff()
}
});
答案 0 :(得分:1)
这似乎有所帮助: