Keyboard Shortcuts with the Commands API
Give power users fast access to your extension through global keyboard shortcuts defined with the commands API.
Why Keyboard Shortcuts
Beyond context menus and the omnibox, the commands API lets users trigger actions with a keystroke. Shortcuts make your extension feel fast and professional to power users.
Declaring Commands
Define each command in the manifest under commands, with a suggested key combination per platform.
{
"commands": {
"toggle-feature": {
"suggested_key": { "default": "Ctrl+Shift+Y" },
"description": "Toggle the feature"
}
}
}All lessons in this course
- Adding Context Menu Items
- Omnibox Keyword Integration
- Responding to Omnibox Input
- Keyboard Shortcuts with the Commands API