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?
Hold down your ⇧ Shift (Mac) or ⇧ Shift (Windows) button. If you want to open the link in a new background tab, hold ⌘ Cmd (Mac) or Ctrl (Windows) instead. If you want to open the link in a new foreground tab, hold both ⌘ Cmd + ⇧ Shift or Ctrl + ⇧ Shift (Windows) instead.
The window. open() method is used to open a new browser window or a new tab depending on the browser setting and the parameter values. Approach: To open a new tab, we have to use _blank in the second parameter of the window.
Open in a new window To open a link in a new browser window, hold the Shift on then click the link or right-click the link and select Open link in New Window.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With