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.


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.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.