Listen for the user executing commands that you have registered using the commands manifest.json key.
Listen for the user executing commands that you have registered using the commands manifest.json key.
commands.CommandObject representing a command. This contains the information specified for the command in the commands manifest.json key.
commands.getAllGets all registered commands for this extension.
commands.resetReset the given command's description and shortcut to the values given in the manifest key.
commands.updateChange the description or shortcut for the given command.
commands.onCommandFired when a command is executed using its associated keyboard shortcut.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
Command |
Yes | 79 | 48 | ? | Yes | 14 | ? | ? | No | ? | 15 | ? |
getAll |
Yes | 79 | 48 | ? | Yes | 14 | ? | ? | No | ? | 15 | ? |
onCommand |
Yes | 79 | ? | Yes | 14 | ? | ? | No | ? | 15 | ? | |
reset |
No | No | 60 | ? | No | No | ? | ? | No | ? | No | ? |
update |
No | No | 60 | ? | No | No | ? | ? | No | ? | No | ? |
Note:
This API is based on Chromium's chrome.commands API.
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/commands