Opening URL in New Tab doesn't work in existing, programmatically-opened New Window (Firefox)

Posted by seth on Stack Overflow See other posts from Stack Overflow or by seth
Published on 2010-06-11T06:42:53Z Indexed on 2010/06/11 6:53 UTC
Read the original article Hit count: 234

Filed under:
|
|

I am building a web app, for myself, to control some servers on my home network, and discovered what I think is very odd behavior in Firefox.

If you open a pop-up, via javascript, in Firefox, is it then impossible to open a new tab, via javascript in that pop-up? If not impossible, how do you do it?

Given a clean, default Firefox 3.6.3 installation...

If I open a page in Firefox and then call

var my_window = window.open('http://www.google.com','_blank','top=10');

A brand new "pop-up" window opens.

However, if instead I call

var my_window = window.open('http://www.google.com');

A get a new tab.

HOWEVER...

If I call the first version

var my_window = window.open('http://www.google.com','_blank','top=10');

And then in the new "pop-up" that opens, I call

var my_window = window.open('http://www.google.com');

It opens a new tab in the original window, not a new tab in the pop-up.

This seems very odd, and not intuitive at all. Why would the call in the pop-up open a tab in the "parent" window?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about firefox