browser

package
v2.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBinNotFound  = errors.New("no compatible browser was found")
	ErrProcNotFound = errors.New("process not found")
)

Functions

func Close

func Close(ctx context.Context, opts Options, pid uint64) error

func EnsureBrowser

func EnsureBrowser(ctx context.Context, rtOpts cliruntime.Options, brOpts Options) (func(), error)

EnsureBrowser opens a browser if runtime options require it. Returns a cleanup function that must be deferred.

func Open

func Open(ctx context.Context, opts Options) (uint64, error)

func Wait

func Wait(ctx context.Context, opts Options) error

Types

type Browser

type Browser interface {
	Open(ctx context.Context) (uint64, error)

	Close(ctx context.Context, pid uint64) error
}

func New

func New(opts Options) Browser

type LinuxBrowser

type LinuxBrowser struct {
	// contains filtered or unexported fields
}

func (*LinuxBrowser) Close

func (b *LinuxBrowser) Close(ctx context.Context, pid uint64) error

func (*LinuxBrowser) Open

func (b *LinuxBrowser) Open(ctx context.Context) (uint64, error)

type Options

type Options struct {
	Detach   bool
	Headless bool
	Address  string
	Port     uint64
	UserDir  string
}

func NewDefaultOptions

func NewDefaultOptions() Options

func (Options) ToFlags

func (opts Options) ToFlags() []string

func (Options) ToURL

func (opts Options) ToURL() string

type ProcessMatcher

type ProcessMatcher func(processCmd, targetCmd string) bool

ProcessMatcher determines if a running process matches the target browser command.

Jump to

Keyboard shortcuts

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