Is there a way to prevent Firefox or Chromium from capturing Ctrl+W and close the current tab? I want to pass the keypress on to the javascript application.

I am asking because, as a user on Firefox or Chromium, I use the Overleaf javascript editor with Emacs key bindings and it works reasonably well. However, some keys are captured by the browser interface and I don't know how to work around it.

By far the most annoying one is Ctrl+W, which has no easy substitute.

  • I'll try to clarify better, thanks anyway for trying :) In the meantime I realised that [unix.stackexchange.com/questions/341450] covers the same issue, but all links are broken. That question is three years old, and in the meantime Firefox has changed a lot... Commented May 29, 2020 at 16:25

1 Answer 1


For Chrome/Chrominum, you can go to chrome://extensions/shortcuts, then add ctrl+w as shortcut to any chrome extension you like.

I personally installed ctrlw and bound ctrl-w to no op.

Alternatively, you can have a look at other extensions like https://chrome.google.com/webstore/detail/better-ctrl-w/jfknaapblnppeflfamkegnnonlfgokhp an https://chrome.google.com/webstore/detail/disable-keyboard-shortcut/aidbmcboeighgdnilpdljbedbbiocphj

Source: https://superuser.com/a/1207752/107228

  • 1
    Not ideal (I would much prefer being able to set C-w to cut) and limited to Chromium, but much better than nothing. +1 Commented Nov 27, 2020 at 21:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .