Add Custom Keyboard Shortcuts to Chrome Extensions
In this article
You can add custom keyboard shortcuts to Chrome extensions in two ways: if you are the extension's developer, define them in the manifest and handle them in your background script; if you are a user, open chrome://extensions/shortcuts and assign or change shortcuts for any installed extension that supports commands. This guide covers both paths, with the exact steps, common pitfalls, and fixes.
What You'll Need
- Google Chrome on desktop (Windows, macOS, or Linux). The shortcuts page is not available on Chrome for Android or iOS.
- For developers: the extension's source folder, a text editor, and Chrome's Developer mode enabled at
chrome://extensions. - For users: an installed extension that declares at least one command. Extensions without commands will not appear on the shortcuts page.
Step-by-Step
Part A: For Users (Assigning Shortcuts to an Installed Extension)
- Open a new tab and type
chrome://extensions/shortcutsin the address bar, then press Enter. You can also reach this page by openingchrome://extensions, clicking the menu icon (three horizontal lines) at the top left, and choosing Keyboard shortcuts. Menu labels can differ slightly by Chrome version and operating system. - Find the extension you want in the list. Each extension shows its declared commands, for example "Activate the extension" or a custom action name.
- Click the input field next to the command. It will show "Type a shortcut" or the current shortcut.
- Press the key combination you want. Chrome accepts most combinations that include Ctrl (Windows/Linux) or Command (macOS), plus Alt or Shift, and a letter or number. For example, Ctrl+Shift+Y on Windows or Command+Shift+Y on macOS.
- If the combination is already used by Chrome or another extension, Chrome will warn you or refuse to assign it. Try a different combination.
- Click elsewhere on the page to save. The shortcut is applied immediately; no restart is needed.
- To remove a shortcut, click the input field and press Backspace or Delete, then click away.
Note: Some extensions do not declare any commands, so they will not appear on this page. In that case, the extension's own options page may offer a different way to set a shortcut, or it may not support shortcuts at all.
Part B: For Developers (Adding Shortcuts to Your Extension)
- Open your extension's
manifest.jsonfile in a text editor. - Add a
commandskey at the top level of the manifest. Each command needs a name, a description, and optionally a suggested key combination. Example:"commands": { "toggle-feature": { "suggested_key": { "default": "Ctrl+Shift+Y", "mac": "Command+Shift+Y" }, "description": "Toggle the feature" } } - In your background script (service worker for Manifest V3), listen for the command using
chrome.commands.onCommand.addListener. Example:chrome.commands.onCommand.addListener((command) => { if (command === "toggle-feature") { // your logic here } }); - Reload the extension: go to
chrome://extensions, enable Developer mode, and click the reload icon for your extension. - Open
chrome://extensions/shortcutsto verify your command appears. You can also test the suggested key directly. - If you want users to be able to change the shortcut, do nothing else: Chrome automatically lists your commands on the shortcuts page, and users can override the suggested key.
Common Mistakes
- Using reserved shortcuts. Chrome reserves some combinations (for example Ctrl+N, Ctrl+T, Ctrl+W). Attempting to assign these will fail silently or show a warning.
- Forgetting the
commandsmanifest key. Without it, the extension will not appear on the shortcuts page, andchrome.commandswill be undefined. - Not handling the command in the background script. Declaring a command is not enough; you must add a listener or nothing happens when the shortcut is pressed.
- Assuming shortcuts work on mobile. The shortcuts page and
chrome.commandsAPI are desktop-only. Extensions on Chrome for Android cannot use keyboard shortcuts. - Using
suggested_keywith a combination that is already taken. Chrome will not override an existing assignment; the user must choose manually. - Editing the manifest without reloading the extension. Changes to
manifest.jsonrequire a reload fromchrome://extensions.
Tips
- Use
Ctrl+Shift(Windows/Linux) orCommand+Shift(macOS) as a base for custom shortcuts to avoid clashes with common browser shortcuts. - Provide a clear
descriptionfor each command; it appears on the shortcuts page and helps users understand what the shortcut does. - Test your extension's shortcuts on both Windows and macOS if you plan to publish it, since modifier keys differ.
- For extensions with multiple commands, consider grouping related actions under one shortcut with a modifier, or use the
globalflag only if the command should work when Chrome is not focused (requires thecommandspermission and user approval). - Document your shortcuts in the extension's description or options page so users know they exist.
Troubleshooting
- The extension does not appear on
chrome://extensions/shortcuts. The extension likely has nocommandsin its manifest. Check the extension's details or contact the developer. You cannot add commands to someone else's extension. - The shortcut does nothing when pressed. The extension may not be listening for the command, or the shortcut conflicts with another extension. Try reassigning it to a different combination.
- Chrome says the shortcut is already in use. Choose a different combination. You can also disable or reassign the conflicting extension's shortcut on the same page.
- Your manifest changes are not reflected. Reload the extension from
chrome://extensions. If you are using a packed.crxfile, you must repack it. - The shortcut works only when Chrome is focused. That is the default behavior. To make it global, add
"global": trueto the command in the manifest, but note that users must approve global shortcuts, and Chrome may limit how many can be global. - You are on a Chromebook or mobile device. Chromebooks support keyboard shortcuts for extensions, but mobile Chrome does not. There is no workaround on mobile.
Frequently Asked Questions
Can I add a shortcut to any Chrome extension?
Only if the extension declares commands in its manifest. You cannot add commands to an extension you did not develop. Check chrome://extensions/shortcuts to see which extensions support shortcuts.
Do extension shortcuts work in Incognito mode?
They work only if the extension is allowed in Incognito. Enable "Allow in Incognito" on the extension's details page.
Can I use the same shortcut for two extensions?
No. Chrome requires each shortcut to be unique across all extensions and browser actions. You must choose different combinations.
Why does my shortcut only work when Chrome is open?
By default, extension shortcuts are scoped to Chrome. To make a shortcut global, the extension developer must set "global": true in the manifest, and the user must approve it.
Can I set shortcuts on Chrome for Android?
No. The shortcuts page and the chrome.commands API are not available on Chrome for Android or iOS. Keyboard shortcuts for extensions are a desktop-only feature.
How do I remove a shortcut I no longer want?
Go to chrome://extensions/shortcuts, click the field for that command, press Backspace or Delete, then click elsewhere to save. The extension will no longer respond to that key combination.