Detect focus on browser address bar?

Is there any way to detect when the focus was placed in the address bar or in the browser search bar?

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

+4
source share
3 answers

No, It is Immpossible

+14
source

why not check when the desired item has lost focus? and make your way from there? and I meant using the .focusout () event, not .blur (), as it behaves differently.

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

+3
source

You can only work with the DOM.

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

0
source

Source: https://habr.com/ru/post/1304894/


All Articles