browser

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2026 License: BSD-3-Clause, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package browser opens a URL in the user's default browser, with a hook so tests can substitute the real implementation.

Index

Constants

This section is empty.

Variables

View Source
var Opener = browser.OpenURL

Opener is the function used to open URLs. Tests can replace this with a no-op or capture function.

Functions

func LooksHeadless

func LooksHeadless() bool

LooksHeadless reports whether the current environment seems incapable of opening a desktop browser (SSH session, no display, or non-TTY stdin). Callers use this to decide whether to attempt browser.Open at all — if headless, the URL is printed and the user opens it manually on their own machine.

func Open

func Open(url string) error

Open invokes Opener for the given URL.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL