Prevent websites from using browser hotkeys in Google Chrome

9

1

I've noticed more and more websites are stealing browser hotkeys.

Alt+D is perhaps the most obnoxious. I use this constantly to change website. Yet so many websites are stealing the hotkey for their own system - which is really stupid because if you are going to put the effort in to learn hotkeys for a website, you've probably already put the effort in to learn hotkeys for the browser! For example, Google Sheets stealing Alt+D to open the data menu.

Is there any way to prevent websites from overriding browser shortcuts?

Radley Sustaire

Posted 2018-01-12T08:26:51.427

Reputation: 225

2Doubtful. I mean one option is to disable javascript but I think you can guess the negative effects that would have. – Dave – 2018-01-12T08:31:50.140

Have you noticed that the StackExchange editor has a bunch of its own hotkeys? – Barmar – 2018-01-12T17:35:13.490

For just ALT+D, consider using CTRL+L. I think it is more well known and less likely to be overridden. F6 is an alternative. All three shortcuts work almost everywhere, even Firefox, Windows Explorer, iexplore, Edge, etc.. – binki – 2018-06-12T00:04:58.520

Ctrl+L doesn't work great since it's on the other side of the keyboard, but F6 is a good tip. Hard to train myself to change that hotkey though. Thankfully it's just a couple of sites! Thanks for the tip – Radley Sustaire – 2018-06-20T17:22:01.447

Answers

3

Not exactly a way to prevent but a workaround (that also works in Google Sheets).

In short, we want the browser to focus something else besides the website so we can use any shortcut we want. And there are some shortcuts that get you out of the website's grip and focus to the browser's other elements:

  • Alt: Focus browser menu. This is the easiest one but there are other options if the website blocks this.
  • Alt+D: Focus address bar
  • Ctrl+L: Focus address bar
  • F6: Focus address bar
  • Ctrl+E: Focus search bar (or address bar and start searching)
  • Ctrl+K: Focus search bar (or address bar and start searching)
  • Ctrl[+Shift]+Tab: Change tab as the last resort

So even if the website is blocking some shortcuts, one of these will most likely work. When you get focus something else besides the website you can use the shortcut you wanted to use in the first place.

E.g. to focus address bar while in a Google Sheets document press Alt (and lift your finger), then press Alt+D.

Taylan

Posted 2018-01-12T08:26:51.427

Reputation: 652

It was never practical to learn a new (less convenient) hotkey. But knowing that you can press alt once, then press alt+d is a FANTASTIC workaround. I will accept this answer. I was never too keen on Ctrl+L or F6. Thanks! – Radley Sustaire – 2018-10-24T08:59:46.340

Any equivalents for Mac? Specifically looking for something equivalent to Alt – Bruno Ely – 2019-02-18T22:46:51.117