Documentation ¶
Overview ¶
Package webbrowser provides a simple API for opening web pages on your default browser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCantOpenBrowser = errors.New("webbrowser: can't open browser") ErrNoCandidates = errors.New("webbrowser: no browser candidate found for your OS") )
View Source
var Candidates []Browser
Candidates contains a list of registered `Browser`s that will be tried with Open.
Functions ¶
func Open ¶
Open tries to open a URL in your default browser ensuring you have a display set up and not running this from SSH. NOTE: This may cause your program to hang until the browser process is closed in some OSes, see https://github.com/toqueteos/webbrowser/issues/4.
Types ¶
type Browser ¶
type Browser interface { // Command returns a ready to be used Cmd that will open an URL. Command(string) (*exec.Cmd, error) // Open tries to open a URL in your default browser. NOTE: This may cause // your program to hang until the browser process is closed in some OSes, // see https://github.com/toqueteos/webbrowser/issues/4. Open(string) error }
Click to show internal directories.
Click to hide internal directories.