问题
Ctrl+W and Alt+F4 command close the IE browser. I want to disable this default action. I can handle with Ctrl+W command. But I can't with Alt+F4 event. I found that Alt+Keys event(eg; Alt+Enter, Alt+Right Arrow, Alt+Left Arrow) can't to disable their default action. Is it possible to disable Alt+Key event in IE browser?
回答1:
You absolutely cannot do this with Javascript, for obvious security reasons.
If you are making a kiosk application that uses shdocvw.dll to render pages, then you have options, but you cannot from the page itself. Only the client gets to decide what to do with such keypresses, not you.
来源:https://stackoverflow.com/questions/6798363/how-can-i-disable-altf4-event-in-ie-browser