commands

Listen for the user executing commands that you have registered using the commands manifest.json key.

Types

commands.Command
Object representing a command. This contains the information specified for the command in the commands manifest.json key.

Functions

commands.getAll

Gets all registered commands for this add-on.

Events

commands.onCommand
Fired when a command is executed using its associated keyboard shortcut.

Browser compatibility

Chrome Edge Firefox Firefox for Android Opera
Command Yes No 48.0 No 33
getAll Yes No 48.0 No 33
onCommand Yes No 48.0 No 33

Chrome incompatibilities

commands

Firefox does not support:

  • Media keys as shortcuts
  • global
  • the special command _execute_browser_action

Example add-ons

Acknowledgements

This API is based on Chromium's chrome.commands API.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,