22

I'm using Mozilla Firefox for Ubuntu(version - 39.0) I want to change the quit short-cut which is currently Ctrl+Q.. To some other keys, because sometime while closing tabs with Ctrl+W., I accidentally close my firefox.

How can I change it in my system? Is there any way to do it?

Kunal
  • 1,889
  • 5
  • 23
  • 31
  • I might be missing something, but I just tested every combination of [browser.tabs.warnOnClose](http://kb.mozillazine.org/About%3Aconfig_entries), [browser.warnOnQuit](http://kb.mozillazine.org/Browser.warnOnQuit) and [browser.showQuitWarning](https://support.mozilla.org/en-US/questions/824072), and still no dialog showed up when closing a window with multiple tabs, either by clicking the close button or by hitting `Ctrl`+`Q`. I'm using Firefox 60.0.1 on Ubuntu 16.04 LTS. So I guess there's not much one can do apart from using extensions... – waldyrious May 23 '18 at 13:04
  • 1
    You could also disable `Ctrl+Q` system-wide: https://askubuntu.com/questions/1919/how-can-i-disable-ctrlq-for-all-applications-system-wide – caw May 31 '18 at 22:12
  • 2
    As of Firefox 87 (March 2021), you can finally disable the `Ctrl+Q` shortcut, by going to `about:config` and setting `browser.quitShortcut.disabled` to `true`. Note that this will only apply after restarting the broswer. Thanks to @evilpie who contributed that solution to [this answer](https://superuser.com/a/1352295/112593)! – waldyrious Sep 08 '21 at 16:00
  • Ah, but that does not disable Ctrl+Shift+Q. Q being right next to TAB :'( – john v kumpf Jun 03 '22 at 18:34
  • 1
    For me (Firefox 113) `browser.quitShortcut.disabled` worked, but only took effect after restarting Firefox. There is also `browser.warnOnQuitShortcut`, which seems to take effect immediately. – EM0 May 24 '23 at 19:19
  • browser.warnOnQuitShortcut should default to True. Thanks for that, @EM0. – mbuc91 Aug 17 '23 at 12:45

6 Answers6

8

Firefox offers no built-in editor for key bindings.

A solution exists to disable the shortcut starting with version Firefox 87, as given in the comments above by waldyrious. Thanks to Firefox developer Tom Schuster (user evilpie) and the patch to the 20 year-old bugzilla we have the updated answer on superuser, reproduced here:

In about:config set the preference

browser.quitShortcut.disabled true

and restart the browser for it to take effect.

meuh
  • 6,119
  • 1
  • 20
  • 26
5

To disable the shortcut without installing extensions:

  1. Type about:config in the address bar
  2. Type browser.showQuitWarning in the search field
  3. Change the value to true
Matthew
  • 1,288
  • 2
  • 18
  • 27
  • 4
    It does not work when you use the feature "Show my windows and tabs from last time" - [source bugzilla](https://bugzilla.mozilla.org/show_bug.cgi?id=691297) –  Feb 22 '18 at 16:48
  • 1
    This solution is the only one that actually works for the latest Firefox Quantum (suggested extensions are not compatible or are discontinued) – Hamman Samuel Apr 21 '18 at 02:12
4

Firefox does not allow changing shortcut keys out of the box (not even in About:config).

As far as I know, you have two options:

  • For only disabling ctrl+q, you can use the very simple Disable ctrl-q extension.

  • For customizing other shortcuts, including ctrl+q, you can install Menu Wizard. To use it, access Tools->Menu Wizard and click the keyboard icon on the top right (in LTR layout) to display the list of shortcuts and select a new one.

Note: the Customizable Shortcuts extension mentioned in the previous answer was discontinued and removed by its author (although the source code can still be found on github). Edit 2016-08-02: the add-on keybinder seems to be a successor to Customizable Shortcuts, although I haven't tried it personally.

Dror S.
  • 141
  • 4
  • I tried `Ctrl+Q` and `Alt+F4` for File->Exit in Menu Wizard. But FF ignores these shortcuts and does not quit. I tried [`Key Binder`](https://addons.mozilla.org/en-US/firefox/addon/keybinder/?src=search), but this add-on does not show `Quit` or `Exit` in its shorcut list. – Aleksey F. Jun 27 '16 at 08:11
  • 1
    I'm slightly confused by this statement - those shortcuts are Firefox's default, and this questions was discussing how to disable them. You don't need to do anything to *enable* them, AFAIK... – Dror S. Jun 27 '16 at 09:01
  • The "Exit" action is really absent in FF 47.0. When I sent a screenshot, Gregorio Litenstein, the developer of `Keybinder`, pointed me out to [this add-on](https://addons.mozilla.org/en-US/firefox/addon/mac-shortcuts/?src=search). Only after installing it, the "Exit" action appears in the "Other" category of `Keybinder`. – Aleksey F. Jun 28 '16 at 08:51
2

I use Xubuntu, but plain Ubuntu probably has a similar function. Because Firefox itself does not allow to change the Ctrl-Q shortcut, I decided to steal that key combination away from Firefox.

The system gets keystrokes before applications do, so I used the Settings/Keyboard/Application shortcuts to define Ctrl-Q to start some non obtrusive application. I chose the Whisker application menu, but pick whatever. And look: even when Firefox has focus, Ctrl-Q does not reach it.

user686341
  • 59
  • 2
1

On Linux with Firefox Quantum, there is currently a bug that prevents extensions and explicit configuration from changing a builtin shortcut such as ctrl-Q. A workaround is to block it at the system level by e.g. installing the script from https://github.com/sasawat/firefox-ctrl-q-workaround and assigning it as the action of ctrl-Q as a global shortcut.

JanKanis
  • 159
  • 1
  • 8
0

In the electrolysis era I have come to rely on menu wizard to modify existing firefox hotkeys. It is a bit overkill since it also changes menu items, but seems to work well and is compatible.

groceryheist
  • 146
  • 6