Firefox: change/disable default keyboard shortcut configuration

22,051

Solution 1

Extensions you can use with Firefox Quantum: Saka Key, Shortkeys

However any extension seems to be limited and does not work in various situations:

  • privileged pages such as https://addons.mozilla.org/
  • new tab page,
  • internal pages such as about:config,about:newtab,about:addons
  • outside of the webpage such as in the url bar/ search bar
  • before the page has finished loading

So from time-to-time your keyboard shortcuts will stop working, and you might run a totally different command that does something bad. Thanks Mozilla.

Credit: the list of limitations was gathered from the project pages of the two extensions.

Complex options requiring coding skills

var key = document.getElementById('viewBookmarksSidebarKb');
if (key) key.remove();
  • Write your own js, see code at bottom var _mappings = { (and paste it into [Browser Console] after you launch Firefox)

  • Binary hacking firefox (re-run the hack script after every Firefox upgrade)

Solution 2

macOS users can customize any app’s shortcuts as long as they appear in the application menus.

  1. On your Mac, choose Apple menu > System Preferences, click Keyboard, then click Shortcuts.

  2. Select App Shortcuts on the left, click the Add button

  3. In the Menu Title field, type the menu command for which you want to create a shortcut

More details on Apple’s site: https://support.apple.com/guide/mac-help/create-keyboard-shortcuts-for-apps-mchlp2271/mac

You can’t disable them however, you can just override them.

Solution 3

actually the Customizable Shortcuts Extension is able to change firefox shortcuts (and potentially show conflicts); you should give it a try.

However i'm still looking for a extension-less solution and the ability to totally disable a shortcuts...

Edit

As @louis noted, the customizable-shortcuts add-on has been discontinued (around 2016/2017). The sames features are now found in the shortkeys addon (GitHub).

Solution 4

Time to refresh the answer. The official support page now is good enough and also points to a new extension to customize kyeboard shortcuts called Saka that's experimental but kind of official and works great for me (Firefox 60 developer edition / Ubuntu Linux)

Share:
22,051

Related videos on Youtube

Janaka Bandara
Author by

Janaka Bandara

I am a Computer Science and Engineering Undergraduate at University of Moratuwa, the pioneer in technical education and research in Sri Lanka. I am an enthusiastic programmer who likes to explore new annals of programming and software engineering. As an individual, I like to help, learn, appreciate and share.

Updated on September 18, 2022

Comments

  • Janaka Bandara
    Janaka Bandara over 1 year

    I have installed the Keyconfig add-on and configured it to toggle Offline Mode on Firefox, whenever I press Ctrl + Shift + O. It worked fine on previous versions of Firefox (before version 28.0).

    However, now, when I have the Developer Tools pane open, pressing Ctrl + Shift + O causes the pane to switch to the Toolbox Options tab and consequently my 'toggle offline' option does not get triggered. (This happens only when the keyboard is 'focused' on the Developer Tools pane; if I'm actually working on a web page (i.e. some web page element is in focus), Ctrl + Shift + O always works regardless of whether the Developer Tools pane is open or not.)

    I don't think a plugin or add-on would help in this regard, because the Ctrl + Shift + O shortcut assignment seems to be part of Firefox's Developer Tools pane itself. (After all, Keyconfig, via which I customized that shortcut, is also an add-on!)

    As such, I'm looking for a possible way of altering the configurations of the Developer Tools toolbox (or Firefox itself, for that matter) in order to regain control of my keyboard shortcut Ctrl + Shift + O. (Well, I know it would be easier to change my shortcut to a different one, but I'm so accustomed to pressing Ctrl + Shift + O whenever required, that I cannot get rid of it now. :) ) I have been looking up the issue on the web for quite a long time, but still could not arrive at a satisfactory solution.

    Any ideas/suggestions are highly appreciated.

  • Janaka Bandara
    Janaka Bandara about 9 years
    Thanks. I just tried it, but it seems that the extension is picking up the shortcuts set on Keyconfig as well; so it doesn't seem to be able to disable/change just one of the shortcuts. I'll play around with it a bit more and see, though.
  • Саша Черных
    Саша Черных over 7 years
    Extension now was deleted((.
  • Janaka Bandara
    Janaka Bandara almost 6 years
    Thanks - I tried out Saka right after I upgraded to 60, but unfortunately it had the same problem that I had with Keyconfig, i.e. not being able to intercept commands while devtools is open. But worse, Saka didn't offer an option to bind keystrokes to custom scripts (like Keyconfig did - at least back then).
  • Janaka Bandara
    Janaka Bandara almost 6 years
    Thanks for the detailed clarification! Tired of all the complications (and the demise of Keyconfig) I wrote my own script to handle the keystrokes that I'm interested in - and it seems to work everywhere, including all the cases you have pointed out above :) only caveat being that I have to run it manually every time I restart the browser.
  • AdamS
    AdamS almost 6 years
    @JanakaBandara great idea to write your own script - I'm interested in that. Would you be willing to make it easy for other people to use? Maybe you could make a new "example KeyConfig" script without your other utility functions and with some instructions for how people put their own keys?
  • Janaka Bandara
    Janaka Bandara almost 6 years
    Thanks @AdamS! I'll give it a try - in fact I tried to make an extension out of it, some time back, but had to give up eventually due to some extension packaging/installation issues and lack of time.