Documentation
¶
Overview ¶
Package browser opens URLs in the user's web browser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Browser ¶
Browser opens a URL.
func New ¶
New returns a Browser. A non-empty launcher (from $YTRACK_BROWSER, the config "browser" key or $BROWSER) is run with the URL as its argument; otherwise the platform default opener is used.
func Quiet ¶ added in v0.2.1
Quiet returns a Browser that discards the browser's own output. A browser launched from a terminal prints its diagnostics there (Chrome's "Sandbox: CanCreateUserNamespace() clone() failure", GTK warnings), and during `auth login` that lands in the middle of the token prompt. Failure to launch is still returned as an error.
The sink is a real file (os.DevNull), never io.Discard: for a non-file writer exec copies through a pipe and waits for every holder of it to exit, and the browser inherits that pipe and keeps running.