2

In Safari 4 windows, it does not seem possible to stop some key events from bubbling up to the browser in Javascript.

This question got pounced on for trying to stop F5 (a dubious design goal), but the technical problem remains... how do you stop certain key events from bubbling up in Safari 4? For example,

You can stop:

  • CTRL+T
  • CTRL+N

You cannot stop:

  • CTRL+F
  • F5
3
  • PPK seems to be able to cancel up/down keys: quirksmode.org/js/keys.html (see example at bottom of page). Tried safari 4 windows and the document does not scroll. Perhaps you are asking about Function keys? I.e. F1, F2, F3 ... ? Nov 5, 2009 at 4:15
  • Good point. I was trying to stop CTRL+F, etc (so that different behavior can be implemented in flash). Hmm.
    – jedierikb
    Nov 5, 2009 at 4:19
  • edited question to include more examples
    – jedierikb
    Nov 5, 2009 at 4:25

1 Answer 1

1

Interesting. My tests gave the same results as yours: I couldn't find a way to prevent the default action of CTRL+F in Safari 4 in Windows, which suggests it's a deliberate design decision. However, I did discover the probably useless fact that putting an alert in my keydown event handler prevented the search bar from appearing, regardless of whether I then cancelled the event default action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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