添加键盘快捷键以执行 Chrome 扩展

Adding keyboard shortcuts to execute Chrome extension

我创建了一个 chrome 扩展程序,我想使用键盘快捷键执行它。

片段:

"suggested_key": {
  "default": "Ctrl+Shift+F"

我尝试了不同的组合,例如 "Ctrl+Shift+A"、"Ctrl+Shift+D"、"Alt+X" 和 "Space+B"

None 其中似乎有效。我拼错了 Alt 还是 Space?

您的 manifest 文件中的建议键仅在没有其他操作绑定到同一键盘快捷键时才有效。

来自documentation

The user is free to designate any shortcut as global using the UI in chrome://extensions \ Keyboard Shortcuts, but the extension developer is limited to specifying only Ctrl+Shift+[0..9] as global shortcuts. This is to minimize the risk of overriding shortcuts in other applications since if, for example, Alt+P were to be allowed as global, the printing shortcut might not work in other applications.

因此,Ctrl+Shift+F 它是 Chrome 的 View 菜单中的一个设置。您需要手动覆盖它或找到其他快捷方式。

此外,您需要重新安装扩展程序才能从清单中激活新的快捷方式。