How do I stop a website for overriding my keyboard short cuts

7

How can I stop websites from overriding the keyboard shortcuts in Firefox?

e.g., if you go to Youtube, Ctrl+T no longer opens a new tab, etc.

It there a plug-in that will do that for me?

BIBD

Posted 2009-07-19T21:56:50.827

Reputation: 1 506

1

On YouTube, this is indeed caused by the Flash plugin. But in general, keyboard shortcuts can also be overwritten with javascript, see http://superuser.com/questions/168087/how-to-forbid-keyboard-shortcut-stealing-by-websites-in-firefox/670040#670040

– Martin J.H. – 2013-11-05T21:26:51.627

Answers

9

This is a focus issue....when you click on the flash player, focus is transferred from the browser window to the flash plugin.

This is a page on IBM's website with describes a method of creating a firefox extension that prevents hotkeys from being captured by flash here

Unfortunately, I'm unsure how effective this solution will be. I've seen on various forums people saying that there is no real way to prevent a plugin from grabbing the keyboard completely because of how mozilla handles plugins, and I haven't been inconvenienced enough to try to use the code I mentioned above.

It looks like the most convenient workaround would be MicTech's solution of clicking anywhere except the animation, and then proceeding with the shortcuts.

Babu

Posted 2009-07-19T21:56:50.827

Reputation: 1 297

In this case, I notice that if I click outside of the video frame then my keyboard short cuts work again. An extra click will solve my problem for now. Thanks. – BIBD – 2009-07-20T01:14:47.283

This behaviour might be changing soon: https://bugzilla.mozilla.org/show_bug.cgi?id=78414

– Martin J.H. – 2013-11-05T21:23:30.507

3

I think, this is problem with Flash.

If you click on video player on youtube, then short-cuts stop working, but if you click outside video player, then short-cuts start working.

I have same problem, too.

MicTech

Posted 2009-07-19T21:56:50.827

Reputation: 9 888

1

The focus- and Flash-related answers are legitimate, and may help some people, but don't address the overall question raised by the subject: How to prevent sites from hijacking keyboard shortcuts. And the asker mentioned Firefox specifically.

Well, 11 years after the bug was filed, Mozilla has finally taken action on https://bugzilla.mozilla.org/show_bug.cgi?id=380637, which directly addresses this issue.

In current versions of Firefox (starting with v.58; I'm using v.59) there is a new per-site preference, but unfortunately it's problematic (as discussed in recent comments on the bug ticket): It prevents the Backspace and Del keys from working in the browser itself (e.g. to edit entered text), which is likely to be a deal-breaker for most people.

But you can experiment with the current implementation (and hopefully, access a fixed version in Firefox 60) by clicking the (i) icon in the Location Bar (or by pressing Ctrl-I, presuming you're on a site that hasn't hijacked that shortcut), going to the Permissions tab, and adjusting the Override Keyboard Shortcuts` setting:

Firefox screenshot

Lambart

Posted 2009-07-19T21:56:50.827

Reputation: 622

1

If this isn't a flash issue as mentioned by MicTech, then it may be a JavaScript issue. I use NoScript, which disables JavaScript on a whitelist basis, so you can allow sites to use JavaScript if you a) trust them and b) require the javascript functionality while there.

jtimberman

Posted 2009-07-19T21:56:50.827

Reputation: 20 109

+! - I've used that trick before. But some sites is use do require JS. Now, if I can find something that will selectively block the JS hotkey interceptors as well. – BIBD – 2009-07-20T01:15:55.160