41

How do I disable the Ctrl + Q shortcut in Firefox without using the keyconfig extension?

21

There is now an extension just for that:

https://addons.mozilla.org/en-us/firefox/addon/disable-ctrl-q-shortcut/

42

You should obtain a similar result, easier, enabling the hidden config option (about:config).

  1. In Firefox's address bar, type about:config and accept the warning that it will give. Now it appears in front of you a long list of config options. Filter it typing the keyword quit in the filter bar (up top). After that the filter acts you will have only few lines. Click on browser.showQuitWarning and set it true by clicking on it.

  2. You can use this filter again with the keyword warnon and see if the options "warn when close tabs" and similar are set to true.

  3. In the Firefox's Options/Preferences (or Edit/preferences it depends from system and version), go to the Tabs section and check the option "Warn me when closing multiple tabs". This will prevent you to close a window with multiple tab.

You will not completely disable Ctrl-Q but at least you will make it harmless.

  • 8
    Unfortunately, for me (on Ubuntu 14.10 with Firefox 33.0), setting the key "browser.showQuitWarning" to "true" does absolutely nothing. :-( So I had to install the above mentioned extension just to disable keyboard shortcut. What a world we live in. – okolnost Nov 22 '14 at 13:43
  • 2
    It just worked for me with 14.04. – arhuaco Jun 4 '15 at 16:22
  • 2
    @okolnost @axd @user905686 it won't work if you have firefox set to show your windows/tabs from last time. In General preferences under When Firefox starts - change that to home page or blank page. See support.mozilla.org/en-US/questions/1127960 for the reason why. You can restore the last session manually from the history menu when starting firefox. – Matthew Jan 11 '18 at 6:59
  • 1
    @DylanHunt in about:config you can find the field browser.tabs.warnOnClose. The default value is true... After so many years the layout of the interface is changed many times, but some internal variable not... – Hastur Feb 23 '18 at 13:42
  • 1
    This stopped working for me recently. Odd. – NotSimon Jul 25 '18 at 22:14
8

You can just add a custom shortcut for Ctrl + Q. In Ubuntu it is available directly in settings(How to). It will be captured by the OS and hence no app including Firefox would detect it.

P.S. I have mapped it to play an 'Oops' sound.

Step 1. Install sox package & its mp3 support library-

sudo apt-get install sox libsox-fmt-all

Step 2. Add the following line in the custom shortcut prompt-

play ~/Music/Oops.mp3

P.S. For windows users: you can use AutoHotKey. It has inbuilt function to play a beep sound. Use it in the script like this-

^Q::
    SoundBeep, 1000, 500

The '^' above stands for Ctrl

  • thank you. this was far simpler than some of the other solutions, which wanted to intercept the keystrokes and pass them on based on what application I was in. While I can see why I might sometimes want to do that, this was a far easier solution for my case, and one I would not have thought of. – Silvestris Dec 27 '17 at 4:36
  • You're welcome! I figured this solution for the same reason :) – Udayraj Deshmukh Jan 7 '18 at 13:12
  • I must say, with all the existent 'disable-ctrl-Q' extensions not working due to some bugs in mozilla or due to the version incompatibility; this answer is the best. Now I have a lovely 'Badum tsss!' sound every time I press ctrl-Q :) – mike239x Mar 4 '18 at 0:52
3

Ctrl + Q isn't a Firefox specific shortcut, it's system wide on Ubuntu if you don't mind disabling it everywhere follow this answer.
Basically, you create a new shortcut and assign /bin/false as command.
No restarting is needed.

  • No restarting is needed. only quitting.)) – vstepaniuk Jan 25 at 23:56

protected by Community Dec 28 '15 at 8:19

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.