3

How can firefox's keyboard shortcut control+W, which closes a tab, be disabled? There's nothing in about:config under browser.tabs.

(When in a web session that is a virtual host's console, that's the venerable Linux keystroke to delete the last word you've typed. Deleting not just a word but the entire console is astonishing.)

Firefox 112.0.1 on Ubuntu 22.

Regarding the answers to Change key bindings (keyboard shortcuts) in Firefox Quantum:

  • Errge's "patch firefox" answer fails in Ubuntu 22, because firefox is now in /snap which is a read-only filesystem, thus unpatchable.
  • Benedikt's answer using autoconfig failed to disable Ctrl+W, with config.js window.document.getElementById('key_close');. I don't know why.
  • The other answers aren't for Linux.

1 Answers1

2

My desktop environment is Mate. My workaround (also for Chrome/Chromium) is by using AutoKey.

  1. In AutoKey, go to New > Script
  2. Configure CTRL+W as the hotkey
  3. Set Window Filter to be: firefox|chrom
  4. Leave the script empty and save it.

Result: CTRL+W now does nothing in Firefox and Chrome/Chromium.

rkok
  • 136