How do I disable the Ctrl + Q shortcut in Firefox without using the keyconfig extension?
-
7i hate developer, who develop ctrl+q(very rare used) with ctr+w(freq. used). Thanx for your request! – Vladimir Ch May 16 '17 at 11:39
-
1Disable Ctrl+Q systemwide – Mateen Ulhaq May 29 '17 at 03:58
-
Duplicate on SuperUser – Pablo Bianchi Jun 16 '21 at 05:46
-
Not sure why this website doesn't let me add an answer, this question isn't that old. The simplest solution is to just install xbindkeys and map CTRL+Q to /dev/null, or echo "" or something. It will trap and kill the combo before it ever has a chance to ruin your private-session pr0ning by sloppy left-hand typing. No more lost links... The only caveat is that it'll trap it for all other programs, too. In my arrogant opinion, a welcomed feature. edit: I just saw user31389's answer. My life is changed. – Brandon Jun 29 '21 at 04:32
-
Now it's easy to turn it off by setting the option "browser.quitShortcut.disabled" to "true" inside the "about:config" page – Vladan Feb 02 '23 at 08:04
6 Answers
You should obtain a similar result, easier, enabling the hidden config option (about:config).
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.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.
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.

- 3,950
-
10Unfortunately, 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
-
-
@axd It should depend from the
firefox
version (or from the way in which you compiled from the source files) and not from the Ubuntu release... BTW 16.06 seems to be a monthly snapshot-releases and not a stable one. The solution in the answer above worked or not in alternative phases depending on the firefox version and it does not rely on external addons but only on internal parameters. – Hastur Oct 31 '17 at 14:39 -
-
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 https://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 06:59 -
2018 update: There is no 'tabs' section. Searching for 'tabs' or 'multiple' did not bring up such an option, either. – dylanh724 Jan 13 '18 at 05:13
-
I know newer Firefox versions removed the feature that allowed you to configure your keyboard shortcuts via a GUI. Is there any hidden way to configure keyboard shortcuts (i.e. via
about:config
or is there a Firefox config file), yes or no? – Trevor Boyd Smith Feb 23 '18 at 13:23 -
2@DylanHunt in
about:config
you can find the fieldbrowser.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
-
Can confirm that this no longer works with Firefox 61 on Windows 7. Obviously not an Ubuntu-specific problem. – shadowtalker Aug 27 '18 at 21:50
There is now an extension just for that:
https://addons.mozilla.org/en-us/firefox/addon/disable-ctrl-q-shortcut/
2020 update:
The original extension has now disappeared from the addons store. Similar addons (see comments) have come and gone. One of the last remaining extensions (link) does not work on Linux due to: https://bugzilla.mozilla.org/show_bug.cgi?id=1325692

- 322
-
4For those who are interested in using this plugin, it is restartless. – Can't Tell Dec 14 '14 at 04:14
-
3Disable Ctrl Q shortcut seems to not be maintained. It does not support e10s. https://addons.mozilla.org/en-US/firefox/addon/ctrl-shift-q-quit/ is a good alternative. – Rob W Nov 20 '16 at 14:11
-
9
-
1
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

- 241
- 1
- 3
- 7
-
2thank 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. – Dec 27 '17 at 04:36
-
You're welcome! I figured this solution for the same reason :) – Udayraj Deshmukh Jan 07 '18 at 13:12
-
1I 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 04 '18 at 00:52
-
1The link to add a custom shortcut doesn't explain it any more for Ubuntu 20.04+. But I just used the settings->keyboard shortcuts and there I changed the setting for "hide Window" to CTRL+Q – rubo77 Feb 18 '21 at 01:54
Since Firefox 87 you can just set browser.quitShortcut.disabled
to true
in about:config
. If this preference is not present, just create a new boolean preference with this name and set it to true
.
Relevant bug: https://bugzilla.mozilla.org/show_bug.cgi?id=52821

- 598
-
1note, that this will take effect only after restarting firefox for some reason. – Jakuje Jun 29 '21 at 10:05
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.

- 199
On Ubuntu: Hide window instead
In your global Ubuntu-Settings: settings->keyboard shortcuts
change the setting for "hide Window" to CTRL+Q

- 32,486