开发者

Window focus for a faster loading pop-up

开发者 https://www.devze.com 2023-01-15 18:51 出处:网络
I am very new to JavaScript. Kindly note that I am trying below issue in a shell which overrides many JavaScript functions.

I am very new to JavaScript. Kindly note that I am trying below issue in a shell which overrides many JavaScript functions.

I have an issue with focusing a window: on a single "click" action, I navigate to a new page which has two JavaScript methods which launch two external URLs which I don't own. For example I launch Yahoo.com and Google.com. My JS launches Yahoo.com in current window (as a page navigate) and Google.com as a pop-up. I WANT Google.com WINDOW TO BE FOCUSED irrespective of loading time of either URLs. The major issue is I cannot use the setTimeout JS function as this function's behavior is altered within the shell and is not usable.

Note: I am using a custom reusable JS function to launch external URLs and I just pass values to that method. So I don't even have access to window object. If I can somehow achieve a time delay without using setTimeout, it will be ideal case. If not, I will have to override that custom JS function, get access to the windo开发者_StackOverflow社区w object. Even if I have control over those window objects for external URLs, since loading times are different, setting focus to the Google window object is not always giving me the focus on Google window.

(IE6 & 7)


You cannot guarantee the behavior you want, in general; browsers will not let you.

Safari generally ignores requests to focus windows. Firefox and I think Chrome can be configured by their users (not by your code) to allow focus requests, but by default they won't.

0

精彩评论

暂无评论...
验证码 换一张
取 消