sindresorhus / open

Open stuff like URLs, files, executables. Cross-platform.
MIT License
3.18k stars 219 forks source link

Open in new browser window, not in existing one #264

Open spiropoulos94 opened 2 years ago

spiropoulos94 commented 2 years ago

Is this possible? Please let me know :)

leekafai commented 2 years ago

yes

await open('https://google.com', { app: { name: open.apps.chrome, arguments: ['--new-window'] } })
spiropoulos94 commented 2 years ago

yes

await open('https://google.com', { app: { name: open.apps.chrome, arguments: ['--new-window'] } })

sorry but this doesnt work. If a have an open chrome window, using this it will just add a new tab. what i want is to open a NEW WINDOW, not add a tab to an existing one.

archer56 commented 2 years ago

You need to pass newInstance. For example:

await open('https://google.com', { newInstance: true, app: { name: open.apps.chrome, arguments: ['--new-window'] } })

hzhang1902 commented 2 years ago

You need to pass newInstance. For example:

await open('https://google.com', { newInstance: true, app: { name: open.apps.chrome, arguments: ['--new-window'] } })

This does not work, I'm using MacOS. Actually none of the argument passed works. I thought this was fixed.

234

artjomkruglenkov commented 2 years ago

Same here. Trying this on MacOs results in new tab opened in whatever chrome window that is currently open. If all chrome instances are closed then it would open a new chrome window correctly but would continue adding tabs in this mode, regardless of what I specify next.

jinusean commented 2 years ago

Has there been any updates on this?