27

You can preventDefault() on Chrome shortcuts with JavaScript, but you can't do it with all of them.

Ctrl + S and Ctrl + F you can override.

Ctrl + W you cannot. This makes sense.

Ctrl + L though I was surprised to find you also cannot override though.

What shortcuts are overridable and which aren't in Chrome?

5
  • 3
    bugs.chromium.org/p/chromium/issues/detail?id=33056 has some more information. Commented Mar 13, 2018 at 22:59
  • 1
    Ctrl-NTW, Ctrl Tab, Ctrl Shift Tab also appear to be non-overridable. Apparently Ctrl-Q can be overridden but not Ctrl-Shift-Q. Commented Mar 13, 2018 at 23:00
  • 2
    Ctrl+L can be overridden: the editor on this site has it as a shortcut for "insert link." I verified that it works in Chrome 88 (and also Firefox 87). Commented Jan 28, 2021 at 1:43
  • 3
    Keymaster and Keypress have a lot of it figured out. Furthermore the DOM living standard of all things just states that "There are scenarios where invoking preventDefault() has no effect. User agents are encouraged to log the precise cause in a developer console, to aid debugging." Commented Jun 18, 2022 at 0:25
  • is it possible to overrider chrome incognito shortcut (Ctrl Shift N) using javascript? Commented Oct 4, 2022 at 6:22

1 Answer 1

1

Within Chrome, here are the non-overridable commands that I have found:

Ctrl Tab, Ctrl-NTW, Ctrl-W

Most 'Ctrl-Shift' keyboard shortcuts are able to be overridden now with a few exceptions:

Ctrl Shift Tab, Ctrl-Shift-Q

Ctrl-L is now overridable along a few other new Ctrl-Shift shortcuts.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.