sindresorhus/opn

Do you want to work on this issue?

You can request for a bounty in order to promote it!

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

spiropoulos94 posted onGitHub

Is this possible? Please let me know :)


yes

await open('https://google.com', { app: { name: open.apps.chrome, arguments: ['--new-window'] } })
posted by leekafai over 3 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.

posted by spiropoulos94 over 3 years ago

You need to pass newInstance. For example:

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

posted by archer56 over 3 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

posted by hzhang1902 over 3 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.

posted by artjomkruglenkov about 3 years ago

Has there been any updates on this?

posted by jinusean over 2 years ago

I know this thread is over 2 years old now, but for anyone who may still be struggling with this. I am on macOS and have managed to get the url to open in a new browser window as follows: open('https://www.google.com', { newInstance: true, app: { name: "google chrome", arguments: ["--new-window"] }, }); Just a small change to what somebody posted above, instead of open.apps.chrome, should be "google chrome".

posted by yishairose 6 months ago

I have tried @yishairose version and it works. Thanks

posted by akruglenkov 6 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests