browser

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 5 Imported by: 0

README

Browser Opener

Opens web links in your default browser when human needs you to view a page, sign in, or approve something, working the same way on macOS, Linux, and Windows.

  • Opens URLs in your default browser
  • Works across macOS, Linux, and Windows
  • Confirms which link was opened
  • Rejects anything that is not http or https
  • Launches without blocking your command
  • Powers OAuth sign-in and ticket links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunOpen

func RunOpen(opener Opener, out io.Writer, rawURL string) error

RunOpen validates the URL, opens it, and prints a confirmation.

func ValidateURL

func ValidateURL(rawURL string) error

ValidateURL checks that rawURL is non-empty, parseable, and uses http or https.

Types

type DefaultOpener

type DefaultOpener struct{}

DefaultOpener uses platform-specific commands to open URLs without blocking.

func (DefaultOpener) Open

func (DefaultOpener) Open(rawURL string) error

type Opener

type Opener interface {
	Open(url string) error
}

Opener opens a URL in the default browser.

Jump to

Keyboard shortcuts

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