Firefox keyconfig extension

I’m a heavy keyboard user, and I often go to great lengths to set up consistent keyboard shortcuts in the programs I use.

Firefox has good keyboard support overall. Find as you type, for example, lets me select and follow an individual link with just a few keypresses. Awesome. Still, Firefox has a big UI surface area, so it inevitably has a few rough keyboard edges.

Enter the keyconfig extension, which lets you customize all of the built-in keyboard shortcuts and add new ones. You can even bind keys to arbitrary JavaScript. Brilliant! I can’t believe it took me so long to find it. It’s not currently on addons.mozilla.org, but you can download it here.

Here’s a list of the keyboard shortcuts I’ve modified with keyconfig:

  • Disabled Ctrl-B and Ctrl-H for the Bookmark and History sidebars. I often hit them accidentally, and there’s no corresponding key to close the sidebars.
  • Likewise, disabled F1 for help.
  • Disabled many of the Ctrl-Shift-… keys I don’t use:
    • Ctrl-Shift-B, Blocked Items sidebar
    • Ctrl-Shift-E, Tab groups
    • Ctrl-Shift-H, History sidebar
    • Ctrl-Shift-K, Web console
    • Ctrl-Shift-P, Private browsing
    • Ctrl-Shift-X, Switch text direction
    • Ctrl-Shift-Del, Clear recent history
  • Ctrl-1, -2, and -3 for my mail, calendar, and todo list app tabs and Ctrl-9 to go to the last tab.
  • Ctrl-Shift-S to reload my Stylish userstyles. I use this in my edit/compile/test loop for developing userstyles. Code:
stylishOverlay.turnOnOff(
  !Components.classes["@mozilla.org/preferences-service;1"].getService(
   Components.interfaces.nsIPrefBranch).getBoolPref("extensions.stylish.styleRegistrationEnabled"))
  
  • F9 to focus the page. Helpful when you try to scroll the page, but the focus is on the URL bar or elsewhere. Code: _content.focus();
  • Shift-F1 to reload the proxy:
Components.classes['@mozilla.org/network/protocol-proxy-service;1'].getService().reloadPAC();
  
  • Adblock Plus steals Ctrl-Shift-E, Ctrl-Shift-F, and Ctrl-Shift-O and sets them to open its Filters window. Totally unnecessary! To reclaim them, open about:config and clear the value for extensions.adblockplus.filters_key, then restart Firefox. (This isn’t a keyconfig thing, but it’s still worth mentioning.)
  • Alt-W to close the current tab: BrowserCloseTabOrWindow(). More tab functions here. This is better than the default Ctrl-W for me because I use Emacs key bindings, which steal Ctrl-W in text boxes and other input fields.

2 thoughts on “Firefox keyconfig extension

  1. Worth noting, on the top CTRL+B / CTRL+H – hitting them again will close them. Though I have mine disabled as well.

Leave a Reply

Your email address will not be published.