open new window in background : is it possible?

H

HopfZ

Is it possible to open an external page in background?

window.open('http://www.google.com/search?q='+Math.random());
window.focus();

I tried the above code in three browsers:

Firefox 2 - opens google in new tab. but focus does not get back to the
original tab. Firefox behaves as if window.focus() is not there.
Opera 9 - opens google in new background tab. Good.
IE 7 - new window appears, then soon original window is focused back,
when the new window completes loading it gets focus again.

Possible only in Opera?
 
L

Lee

HopfZ said:
Is it possible to open an external page in background?

window.open('http://www.google.com/search?q='+Math.random());
window.focus();

I tried the above code in three browsers:

Firefox 2 - opens google in new tab. but focus does not get back to the
original tab. Firefox behaves as if window.focus() is not there.
Opera 9 - opens google in new background tab. Good.
IE 7 - new window appears, then soon original window is focused back,
when the new window completes loading it gets focus again.

Possible only in Opera?

By default, I believe Firefox blocks scripts from focus()ing windows.
IE probably has the same security option.
Opening a window that the user can't see is assumed to be malicious.


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top