Files
Michael Lip e85e798a37 feat: add chrome.commands API sample (#1629)
Add a new MV3 sample demonstrating the chrome.commands API.

The sample registers custom keyboard shortcuts in the manifest,
handles command events in the service worker with notifications
and badge text feedback, and uses chrome.commands.getAll() in the
popup to display all registered shortcuts.

Closes #1126
2026-03-04 11:18:27 +01:00
..

chrome.commands

This sample demonstrates the chrome.commands API by defining custom keyboard shortcuts and responding to command events.

Overview

The extension registers two custom keyboard shortcuts in the manifest and listens for them using chrome.commands.onCommand. One command shows a notification, the other toggles a feature on and off with badge text feedback. The popup uses chrome.commands.getAll() to display all registered shortcuts and their current key bindings.

Running this extension

  1. Clone this repository.
  2. Load this directory in Chrome as an unpacked extension.
  3. Use the keyboard shortcuts shown in the popup or customize them at chrome://extensions/shortcuts.