pkg / browser

Package browser provides helpers to open files, readers, and urls in a browser window.
BSD 2-Clause "Simplified" License
559 stars 99 forks source link

browser.OpenURL does not work with windows GUI #6

Closed jimbojetlag closed 3 years ago

jimbojetlag commented 8 years ago

When compiled with -ldflags "-H windowsgui", browser.OpenURL does not work at all.

davecheney commented 8 years ago

I'm sorry, I don't use Windows so I don't have a way to test o fix this. If you can fix it, please send a PR

On 1 Jul 2016, at 11:57, jimbojetlag notifications@github.com wrote:

When compiled with -ldflags "-H windowsgui", browser.OpenURL doe snot work at all.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jimbojetlag commented 8 years ago

Thanks @davecheney . The error seems to be The handle is invalid which simply means there is no console to run the start command to open the browser.

The only way I could so far find is to attach or allocate a console, and then open the url, as described in http://stackoverflow.com/a/23744350 .

This is not the ideal case.

henvic commented 5 years ago

@davecheney can you please take a look at #8? Thanks!

luna-duclos commented 3 years ago

WSL support should now work via forking out to x-www-browser or www-browser, more OS specific commands (but ideally not WSL specific) can be added if needed.