Reputation: 8694
I want to be sure that any popup opened earlier not only exists, but is not minimized. An earlier discussion talked about checking for the window's existence. I'm guessing (hoping!) that giving focus to an already-open window will restore that window if it's been minimized.
Is that the case, or no?
Thanks!
Upvotes: 1
Views: 1607
Reputation: 1933
You can do both, assuming 'window' is your reference to the tab or browser window you and detect focus and set it using these:
function detectFocus(state){
return "Window is now "+state;
}
window.onfocus = function("in focus")
window.onblur = function("not in focus")
/*You then can set state with this method of window:*/
if(needToRestore==true){window.focus}
Upvotes: 2