As mentioned in this answer , it is the user who decides if the new windows go to a flap or even a window.
The concept currently used by browsers is that new window requests are opened as a new tab unless you set otherwise in your browser options (note that this is not a standard).
It seems to me that you are trying to resolve something that can not be solved programmatically since the decision is by the user and is present in the browser settings to which we do not have access programmatically.
Force open in new tab
So far there is no official support yet, but in CSS there is a proposal to deal with this issue:
.novaAba {
target-new: tab ! important
}
Some tests show that recent browsers support this property.
Learn more at CSS3 Hyperlink Presentation Module .
Force to open in new window
Unless you have set your browser to always open in a new tab, the following code opens in a new window because we are actually indicating details such as height, details that tell the browser that we want a new window and not a tab:
window.open("http://www.google.com/", "minhaJanela", "height=200,width=200");
These and other options in the new window can be found here .