7

Is there a way to detect when focus has been put onto the address-bar or the browser-search-bar?

I ask because I am trying to keep focus on one element in my document, but adding a blur() listener to that element (which calls focus() on that same element) works too well in Safari Mac -- you can't put focus on the address-bar when you setFocus with a timeout of 0 (necessary for a plugin).

Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
jedierikb
  • 12,161
  • 20
  • 91
  • 160

3 Answers3

16

No, it is not possible

Joel Martinez
  • 45,329
  • 25
  • 128
  • 183
3

why not check when the desired element has lost focus? and work your way from there? and what i meant was using the .focusout() event, instead of .blur() since it behaves different.

http://api.jquery.com/focusout/

undertakeror
  • 1,022
  • 7
  • 11
2

You can only work with the DOM.

If you want to access address bar, you need a control running in the browser or your own toolbar.

Raj More
  • 45,769
  • 31
  • 127
  • 192