Warning
vibe coded garbage, but good enough for what I wanted
A Chrome extension that temporarily disables keyboard shortcuts with customizable controls. Perfect for preventing accidental keyboard shortcuts while gaming, testing, or when you need to temporarily mute browser hotkeys.
HotkeyMuzzle allows you to:
- Temporarily disable keyboard shortcuts in your browser with a single click
- Whitelist essential shortcuts (like Cmd+C, Cmd+V) so they continue working
- Get visual feedback when shortcuts are blocked or when the extension state changes
- Customize which shortcuts to allow through an easy-to-use options page
The extension blocks common browser shortcuts that use modifier keys (Cmd, Ctrl, Alt) while preserving normal typing functionality and whitelisted shortcuts.
Since this extension is not published on the Chrome Web Store, you'll need to install it in developer mode:
Make sure you have all the extension files in a folder on your computer.
git clone https://github.com/bytehow/HotkeyMuzzle.git
- Open Chrome and navigate to
chrome://extensions/
- Toggle on Developer mode (switch in the top-right corner)
- Click the "Load unpacked" button
- Select the folder containing the HotkeyMuzzle extension files
- The extension should now appear in your extensions list
- Click the HotkeyMuzzle icon in your browser toolbar to open the popup
- Click "Start Blocking" to activate shortcut blocking
- Click "Stop Blocking" to deactivate and restore normal shortcuts
- The icon will change color to indicate the current state:
- 🟢 Green: Shortcuts are active (normal browsing)
- 🔴 Red: Shortcuts are blocked
- Click the HotkeyMuzzle icon and select "Options"
- Configure your preferences:
- Notification Settings: Choose whether to show notifications when shortcuts are blocked
- Whitelist Management: Add or remove shortcuts that should always work
- Notification Duration: Adjust how long notifications are displayed
The following shortcuts work even when blocking is active:
Cmd+A
(Select All)Cmd+C
(Copy)Cmd+V
(Paste)Cmd+T
(New Tab)Cmd+W
(Close Tab)Cmd+R
(Refresh)Cmd+L
(Focus Address Bar)Cmd+Shift+T
(Reopen Closed Tab)Cmd+Shift+N
(New Incognito Window)Cmd+Q
(Quit Browser)
Note: On Windows/Linux, Ctrl
is used instead of Cmd
A test script (test-extension.sh
) is included for macOS users to quickly launch Chrome with the extension loaded:
./test-extension.sh
manifest.json
- Extension configuration and permissionsbackground.js
- Service worker handling extension state and messagingcontent.js
- Script injected into web pages to intercept keyboard eventspopup.html/js
- Extension popup interface for quick toggleoptions.html/js
- Settings page for customizationtest-extension.sh
- Test script for macOS development
The extension requires these permissions:
storage
: Save your settings and preferencesactiveTab
: Communicate with the current tabscripting
: Inject the content script into web pagestabs
: Manage extension state across tabscommands
: Future support for keyboard shortcuts to control the extensionhost_permissions
: Access all websites to intercept keyboard events
To modify or contribute to this extension:
- Make changes to the relevant files
- Go to
chrome://extensions/
- Click the refresh icon on the HotkeyMuzzle extension
- Test your changes