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 t
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:
window.open('', '_blank', 'toolbar=0,location=0,menubar=0');
For a specific URL:
window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');
For me the solution was to have
"location=0"
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):
window.open(url, "window" + id, 'toolbar=0,location=0,scrollbars=1,statusbar=1,menubar=0,resizable=1,width=' + width + ',height=800,left=100,top=50');
Specify window "features" to the open
call:
window.open(url, windowName, "height=200,width=200");
When you specify a width/height, it will open it in a new window instead of a tab.
See https://developer.mozilla.org/en-US/docs/Web/API/Window.open#Position_and_size_features for all the possible features.