I have a select box that calls window.open(url)
when an item is selected. Firefox will open the page in a new tab by default. However, I would like the page to open in a new window, not a new tab.
How can I accomplish this?
I have a select box that calls window.open(url)
when an item is selected. Firefox will open the page in a new tab by default. However, I would like the page to open in a new window, not a new tab.
How can I accomplish this?
I think its not html target properties problem but you unchecked "open nw windows in a new tab instead" option in "tab" tab under firefox "options" menu. check it and try again.
You don't need to use height, just make sure you use
_blank
, Without it, it opens in a new tab.For a empty window:
For a specific URL:
Interestingly, I found that if you pass in an empty string (as opposed to a null string, or a list of properties) for the third attribute of window.open, it would open in a new tab for Chrome, Firefox, and IE. If absent, the behavior was different.
So, this is my new call:
For me the solution was to have
in the 3rd parameter. Tested on latest FF/Chrome and an old version of IE11
Full method call I use is below (As I like to use a variable width):
The key is the parameters :
If you provide Parameters [ Height="" , Width="" ] , then it will open in new windows.
If you DON'T provide Parameters , then it will open in new tab.
Tested in Chrome and Firefox
OK, after making a lot of test, here my concluson:
When you perform:
or whatever you put in the destination field, this will change nothing: the new page will be opened in a new tab (so depend on user preference)
If you want the page to be opened in a new "real" window, you must put extra parameter. Like:
After testing, it seems the extra parameter you use, dont' really matter: this is not the fact you put "this parameter" or "this other one" which create the new "real window" but the fact there is new parameter(s).
But something is confused and may explain a lot of wrong answers:
This:
And this:
will NOT give the same result.
In the first case, as you first open a page without extra parameter, it will open in a new tab. And in this case, the second call will be also opened in this tab because of the name you give.
In second case, as your first call is made with extra parameter, the page will be opened in a new "real window". And in that case, even if the second call is made without the extra parameter, it will also be opened in this new "real window"... but same tab!
This mean the first call is important as it decided where to put the page.