How do I disable the Ctrl + Q shortcut in Firefox without using the keyconfig extension?
You should obtain a similar result, easier, enabling the hidden config option (about:config).
In Firefox's address bar, type
about:configand 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.
There is now an extension just for that:
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
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-
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
Since Firefox 87 you can just set
about:config. If this preference is not present, just create a new boolean preference with this name and set it to
Relevant bug: https://bugzilla.mozilla.org/show_bug.cgi?id=52821
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.