Can I change the keyboard shortcuts for tab switching in Firefox?

Here is what worked for me in March 2016 (Firefox 45):

  1. Install the keyconfig addon from the keyconfig download page and restart.

    The addon file is unsigned, so to be able to install it, I first had to enter about:config in the address bar and set xpinstall.signatures.required to false.

  2. Go to Addons -> keyconfig -> Preferences.

  3. There are no "Previous Tab" and "Next Tab" entries by default, but you can add them by clicking Add a new key and using the following code snippets (thanks to the author). The "Global" checkbox can be left unchecked.

    • Next Tab: gBrowser.mTabContainer.advanceSelectedTab(1,true);
    • Previous Tab: gBrowser.mTabContainer.advanceSelectedTab(-1,true);
  4. Assign whatever keys to the "Next Tab" and "Previous Tab" actions.

(The Customizable Shortcuts addon didn't work for me, as it didn't have entries for Next Tab and Previous Tab.)


AutoHotkey is the answer. I tried those Firefox extensions, but they can't handle all the actions I wanted. AutoHotkey can. Try something like this in a .ahk file:

#IfWinActive ahk_class MozillaWindowClass
{
   ^Left::Send ^{PgUp}
   ^Right::Send ^{PgDn}
}

The Keyconfig add-on for Firefox allows you to program most tab-selection keyboard binding.