Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just chanced upon a web page that seemingly remapped my default alt + f4 function to search on the website. When on that web page (a university webmail), whenever i press alt + f4, it goes to the search function rather than closing the browser.

How is this even possible? Being a university webmail, it is a fairly harmless effect (annoying but harmless) but if it can be remapped to open the search function, it could be remapped to do many other things. Is there any way to protect against this?

Using firefox 4.0, windows 7 x64.

share|improve this question

Using Javascript it's possible to check for events ( such as keypresses, specific keys) and remap them.

As for

it could be remapped to do many other things

Most modern browsers run Javscript in a sandboxed environment, so the capabilities are limited.

share|improve this answer

NoScript blocks against such key hijacking. You can finetune it to allow specific javascript functionalities.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .