> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/js/all/chrome_plugins/shortcuts.md).

# Shortcuts / Commands

Listen for key presses and get event in background script

background listener

```javascript
browser.commands.onCommand.addListener((command) => {
  debug("Command:", command);
  if (command === "insert-request-link") {
    insertRequestLink();
  }
});
```

manifest.json

```javascript
  "commands": {
    "start-recording": {
      "suggested_key": {
        "default": "Ctrl+Shift+E",
        "mac": "Command+Shift+E"
      },
      "description": "Toggle feature foo"
    }
  },
```
