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 extension.
commands.reset
-
Reset the given command's description and shortcut to the values given in the manifest key.
commands.update
-
Change the description or shortcut for the given command.
Events
commands.onCommand
-
Fired when a command is executed using its associated keyboard shortcut.
Browser compatibility
Report problems with this compatibility data on GitHubwebextensions-desktop | webextensions-mobile | |||||
---|---|---|---|---|---|---|
Command | ChromeFull supportYes | EdgeFull support79 | FirefoxFull support48 | OperaFull supportYes | SafariFull support14 | Firefox for AndroidNo supportNo |
getAll | ChromeFull supportYes | EdgeFull support79 | FirefoxFull support48 | OperaFull supportYes | SafariFull support14 | Firefox for AndroidNo supportNo |
onCommand | ChromeFull supportYes | EdgeFull support79 | FirefoxFull support48
| OperaFull supportYes | SafariFull support14 | Firefox for AndroidNo supportNo |
reset | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support60 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
update | ChromeNo supportNo | EdgeNo supportNo | FirefoxFull support60 | OperaNo supportNo | SafariNo supportNo | Firefox for AndroidNo supportNo |
Legend
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Example extensions
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.