Keyboard Shortcuts in Firefox Extensions: A Complete Guide Keyboard shortcuts make extensions feel native. A new tab extension that users can control without clicking feels much more polished. Here's how to add them to your Firefox extension. Declaring Commands in manifest.json { "manifest_version" : 2 , "commands" : { "toggle-dark-mode" : { "suggested_key" : { "default" : "Ctrl+Shift+D" , "mac" : "Command+Shift+D" }, "description" : "Toggle dark/light mode" }, "refresh-weather" : { "suggested_key" : { "default" : "Ctrl+Shift+R" }, "description" : "Refresh weather data" }, "_execute_browser_action" : { "suggested_key" : { "default" : "Ctrl+Shift+W" , "mac" : "Command+Shift+W" } } } } Enter fullscreen mode Exit fullscreen mode The special _execute_browser_action command opens your extension's popup. Handling Commands in Background Script // background.js browser . commands . onCommand .…