browser

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTargetNotFound = errors.New("target not found")

Functions

func ExpandUser

func ExpandUser(path string) string

func FindChrome

func FindChrome(explicit string) (string, error)
func NavigateExistingTarget(cdpURL, targetID, address string, timeout time.Duration) error

Types

type Options

type Options struct {
	BrowserLaunchOptions map[string]any
	BrowserPath          string
	CDPPort              int
	CDPURL               string
	Cwd                  string
	DeviceScaleFactor    float64
	Headless             bool
	ProfileDir           string
}

func (Options) CDPEndpoint

func (o Options) CDPEndpoint() string

type ResolvedAddress

type ResolvedAddress struct {
	URL string
}

func ResolveAddress

func ResolveAddress(input, cwd string) (ResolvedAddress, error)

type Runtime

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

func New

func New(options Options) (*Runtime, error)

func (*Runtime) Back

func (r *Runtime) Back() error

func (*Runtime) CDPEndpoint

func (r *Runtime) CDPEndpoint() string

func (*Runtime) Click

func (r *Runtime) Click(x, y int) error

func (*Runtime) Close

func (r *Runtime) Close()

func (*Runtime) CurrentURL

func (r *Runtime) CurrentURL() string

func (*Runtime) Forward

func (r *Runtime) Forward() error

func (*Runtime) HideVirtualMouse

func (r *Runtime) HideVirtualMouse() error

func (*Runtime) IsLoading

func (r *Runtime) IsLoading() bool

func (*Runtime) MoveMouse

func (r *Runtime) MoveMouse(x, y int) error

func (*Runtime) Navigate

func (r *Runtime) Navigate(address string) error

func (*Runtime) Press

func (r *Runtime) Press(key string) error

func (*Runtime) Reload

func (r *Runtime) Reload() error

func (*Runtime) ResetZoom

func (r *Runtime) ResetZoom() (float64, error)

func (*Runtime) Resize

func (r *Runtime) Resize(width, height int) error

func (*Runtime) Screenshot

func (r *Runtime) Screenshot() ([]byte, error)

func (*Runtime) ScrollBy

func (r *Runtime) ScrollBy(deltaX, deltaY int) error

func (*Runtime) ScrollTo

func (r *Runtime) ScrollTo(position string) error

func (*Runtime) SetZoom

func (r *Runtime) SetZoom(value float64) (float64, error)

func (*Runtime) TargetID

func (r *Runtime) TargetID() string

func (*Runtime) TypeText

func (r *Runtime) TypeText(text string) error

func (*Runtime) WaitForRenderReady

func (r *Runtime) WaitForRenderReady() error

func (*Runtime) ZoomBy

func (r *Runtime) ZoomBy(delta float64) (float64, error)

Jump to

Keyboard shortcuts

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