Which Chrome keyboard shortcuts cannot be overridden with Javascript? - Stack Overflow

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

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?

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?

Share Improve this question edited Oct 20, 2022 at 20:04 Slbox asked Jul 9, 2017 at 15:53 SlboxSlbox 13.2k18 gold badges65 silver badges135 bronze badges 5
  • 3 bugs.chromium/p/chromium/issues/detail?id=33056 has some more information. – moltenform 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. – moltenform 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). – Ryan M 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." – Swiffy Commented Jun 18, 2022 at 0:25
  • is it possible to overrider chrome incognito shortcut (Ctrl Shift N) using javascript? – Sagar Shah Commented Oct 4, 2022 at 6:22
Add a ment  | 

1 Answer 1

Reset to default 1

Within Chrome, here are the non-overridable mands 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745188819a4615763.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信