Documentation
¶
Overview ¶
Package launcher provides Chrome browser launching and installation.
Index ¶
- func FindSystemChrome() (string, error)
- func GetCacheDir() (string, error)
- func GetChromeDir() (string, error)
- func GetChromePath(version string) (string, error)
- func IsInstalled() bool
- func Uninstall() error
- func Version() string
- type Browser
- type Download
- type InstallResult
- type LastKnownGoodResponse
- type Options
- type Platform
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindSystemChrome ¶
FindSystemChrome looks for Chrome installed on the system.
func GetCacheDir ¶
GetCacheDir returns the platform-specific cache directory for webpilot.
func GetChromeDir ¶
GetChromeDir returns the directory where Chrome for Testing is installed.
func GetChromePath ¶
GetChromePath returns the path to the Chrome executable for the given version. If version is empty, it looks for any installed version.
func IsInstalled ¶
func IsInstalled() bool
IsInstalled checks if Chrome for Testing is already installed.
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
Browser represents a running browser instance.
func LaunchHeadless ¶
LaunchHeadless is a convenience function to launch a headless browser.
func MustLaunch ¶
MustLaunch is like Launch but panics on error.
func (*Browser) WebSocketURL ¶
WebSocketURL returns the WebSocket URL for BiDi connection.
type InstallResult ¶
InstallResult contains the paths to installed binaries.
func Install ¶
func Install() (*InstallResult, error)
Install downloads and installs Chrome for Testing. Returns the path to the installed Chrome executable. Skips download if already installed.
type LastKnownGoodResponse ¶
type LastKnownGoodResponse struct {
Channels map[string]VersionInfo `json:"channels"`
}
LastKnownGoodResponse represents the API response for last known good versions.
type Options ¶
type Options struct {
// Headless runs the browser in headless mode.
Headless bool
// Port specifies the debugging port. If 0, a random port is used.
Port int
// ExecutablePath specifies a custom Chrome executable path.
ExecutablePath string
// UserDataDir specifies a custom user data directory.
// If empty, a temporary directory is used.
UserDataDir string
// Args specifies additional command-line arguments.
Args []string
// AutoInstall automatically downloads Chrome if not found.
// Defaults to true.
AutoInstall *bool
}
Options configures the browser launch.
type Platform ¶
type Platform string
Platform represents a browser download platform.
func GetPlatform ¶
func GetPlatform() Platform
GetPlatform returns the current platform string for Chrome for Testing downloads.
type VersionInfo ¶
type VersionInfo struct {
Version string `json:"version"`
Downloads map[string][]Download `json:"downloads"`
}
VersionInfo represents Chrome for Testing version information.