0Pricing
Browser Extensions Development (Chrome & Edge) · Lesson

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

  1. Adding Context Menu Items
  2. Omnibox Keyword Integration
  3. Responding to Omnibox Input
  4. Keyboard Shortcuts with the Commands API
← Back to Browser Extensions Development (Chrome & Edge)