How to prevent keystroke grabbing/hijacking by websites in Firefox? [duplicate]

Solution 1:

You could use Vimperator plugin. Aimed at making Firefox a keyboard-only interface, it first listens to any keystroke that you press and performs its own actions. Sometimes when you would require to use the site's defined keyboard hijacks, you could easily enable/disable a pass-through mode for sometime.

Let's take the case of GMail, which offres a host of keyboard shortcuts. But when you press any such shortcut, it is handled by Vimperator itself. For example, pressing / inside GMail usually places the cursor in the search box. But pressing / in a GMail page when Vimperator is active triggers its default page search (ala searching in Vim editor). Same case for other GMail shortcuts like o c or even Ctrl+Enter. What this means is that, Vimperator will be the 0th listener for keystrokes in Firefox, over-riding even the 1st possible listeners so that your keyboard shortcuts are global throughout the browser.

Vimperator is basically a Vim wrapper over Firefox. If you are comfortable with Vim, Vimperator will seem like a long-lost friend. :-)

Anyway, a few Vimperator keyboard shortcuts to get you started with:

o<link> opens the . This sequences causes the Vimperator command line (at the bottom of the screen) to be activated and the command open <link> will be placed there, with the space in the middle inserted for you. Press Enter to load the page.

t<link activates the command tabopen and opens the link in a new tab.

gt switches to next tab. Ctrl+Tab and Ctrl+PgUp/Dn also work.

gT switches to previous tabs.

ZZ closes FF after saving the session.

f labels all the links in the page view with highlighted numbers. Typing a number opens the link. All the highlighted fields are searchable. So, instead of typing numbers, you could type any of the text in the highlighted link that you want to go to.

F opens links in a background tab.

h j k l to navigate the page left down upand right

Vimperator offers a host of keyboard shortcuts (and certainly makes the whole experience painlessly mouse-free), and most of FF's default shortcuts function as they normally do. You can find shortcuts to highlight text, copy them, navigate the page as if it were a text document, zoom in/out, simulate the hover on a link, and simply put, anything that would make Firefox respond to a mouse.

The only place where it doesn't work as far as I've used it, is inside Flash boxes, because, FF can't reach what's inside them.

It might take a bit of getting used to if you don't know about Vim or are new to it. However, really extensive online help is just a :h<Enter> away.

Here is the link.