skratchdot / open-golang

Open a file, directory, or URI using the OS's default application for that object type. Optionally, you can specify an application to use.
MIT License
783 stars 65 forks source link

new Window not tab #13

Closed Tarektouati closed 4 weeks ago

Tarektouati commented 6 years ago

Hey is it possible to open url in a new Window not in a tab ?

skratchdot commented 6 years ago

I'm not sure if there's a cross platform way to do this. For me, firefox opens links in a new window, and chrome opens them in a new tab. On osx, I've played around with various switches to the open tool, and I haven't found a way

skratchdot commented 6 years ago

@Tarektouati -

Actually, for OSX, there does appear to be a way to have Chrome open things in a new window:

open -n -a "Google Chrome" --args "https://www.google.com" --new-window

I need to think about how this would work in a cross platform way (or if it's even possible).

Currently, this go-wrapper does not allow passing arguments, but perhaps that's a feature that should be added. I think if we add "passing arguments", it'd still be the responsibility of the user of the library to pass the correct arguments to "open a new window".

I'll think about it some. Going to re-open just in case I ever get around to adding new features...