Can a web page hijack the alt+f4 function?

5

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.

Faken

Posted 2011-04-29T02:00:02.720

Reputation: 1 301

Answers

2

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.

Sathyajith Bhat

Posted 2011-04-29T02:00:02.720

Reputation: 58 436

1

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

MyPreciousss

Posted 2011-04-29T02:00:02.720

Reputation: 373