Reputation: 91
I have a small web application, which after certain network events, must make the page (and therefore the browser) gain the focus. The javascript code, simply, is:
window.focus ();
This, only works when the browser (IE11), I minimize it, but if instead of minimizing it I open another program, when the window.focus () is executed, the explorer icon in the toolbar starts to "blink" in orange, but the browser is not displayed. I've looked around and tried something, like disabling IE's protected mode, but still doing the same
Upvotes: 1
Views: 878
Reputation: 36
the browser cannot over-ride the operating system/user actions. If the user has minimised the browser otr put another program on top then your javascript won't change that fact. can you image how out-of-control this could get? Every web store would have the browser impossible to minimise or move out of focus.
Upvotes: 1
Reputation: 21
Try the following, if only just to isolate the problem, i would have commented ins but cant yet:
Do a window.blur(); before focusing, may be a problem of ie thinking its focused, despite it not being the case, so try:
window.blur();
window.focus();
Upvotes: 0