How to “refresh” a window in IE without stealing window focus?

I have a page on which, periodically, I have to change the URL to enable some GET parameters in the background using JavaScript, so that the page is updated using the new GET parameters.

So, for example, I will periodically do

window.location.href = window.location.host + '?' + ss;

or

window.location.search = '?' + ss;

Where 'ss' is the new query string, for example: "foo = 3 & bar = 1". These "updates" will be performed when the window is in the background.

My problem is that in IE browsers the update causes the window to steal focus. Is there anyway to avoid or get around this?

+3
source share
3 answers

, AJAX ?

+2

Ajax. , - , . , URL- , SERP.

+2

Do I need to refresh the whole page? I would think that if you FIX content, it would not steal focus. I have never tried this with a background window, but I was curious that IE does this. Which version does this, since I would like to reproduce it.

0
source

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


All Articles