Versions in this module Expand all Collapse all v0 v0.1.0 Dec 2, 2026 Changes in this version + var ErrElementNotFound = errors.New("element not found") + var ErrInvalidInput = errors.New("invalid browser input") + var ErrRemoteConnection = errors.New("remote browser connection failed") + var ErrUnsuccessfulResponse = errors.New("unsuccessful HTTP response") + type BrowserError struct + ExitCode int + Kind error + Message string + func (e *BrowserError) Error() string + func (e *BrowserError) Unwrap() error + type Browsershot struct + func HTML(value string) *Browsershot + func HTMLFromFilePath(path string) *Browsershot + func New() *Browsershot + func URL(value string) *Browsershot + func (b *Browsershot) AddChromiumArguments(args ...string) *Browsershot + func (b *Browsershot) AddScriptTag(options map[string]string) *Browsershot + func (b *Browsershot) AddStyleTag(options map[string]string) *Browsershot + func (b *Browsershot) AllowLocalFileAccess(enabled ...bool) *Browsershot + func (b *Browsershot) Authenticate(username, password string) *Browsershot + func (b *Browsershot) Base64PDF(ctx context.Context) (string, error) + func (b *Browsershot) Base64Screenshot(ctx context.Context) (string, error) + func (b *Browsershot) BlockDomains(domains []string) *Browsershot + func (b *Browsershot) BlockURLs(urls []string) *Browsershot + func (b *Browsershot) BodyHTML(ctx context.Context) (string, error) + func (b *Browsershot) Click(selector string, options ...ClickOptions) *Browsershot + func (b *Browsershot) Clip(x, y, width, height int) *Browsershot + func (b *Browsershot) ConsoleMessages(ctx context.Context) ([]ConsoleMessage, error) + func (b *Browsershot) Delay(delay time.Duration) *Browsershot + func (b *Browsershot) Device(device string) *Browsershot + func (b *Browsershot) DeviceScaleFactor(scale int) *Browsershot + func (b *Browsershot) DisableCaptureURLs() *Browsershot + func (b *Browsershot) DisableImages() *Browsershot + func (b *Browsershot) DisableJavascript() *Browsershot + func (b *Browsershot) DisableRedirects() *Browsershot + func (b *Browsershot) DismissDialogs() *Browsershot + func (b *Browsershot) EmulateMedia(media string) *Browsershot + func (b *Browsershot) EmulateMediaFeatures(features []map[string]string) *Browsershot + func (b *Browsershot) Evaluate(ctx context.Context, expression string, target any) error + func (b *Browsershot) EvaluateOnNewDocument(script string) *Browsershot + func (b *Browsershot) FailedRequests(ctx context.Context) ([]FailedRequest, error) + func (b *Browsershot) FooterHTML(value string) *Browsershot + func (b *Browsershot) Format(format string) *Browsershot + func (b *Browsershot) FullPage() *Browsershot + func (b *Browsershot) HeaderHTML(value string) *Browsershot + func (b *Browsershot) HideBackground() *Browsershot + func (b *Browsershot) HideBrowserHeaderAndFooter() *Browsershot + func (b *Browsershot) HideFooter() *Browsershot + func (b *Browsershot) HideHeader() *Browsershot + func (b *Browsershot) IgnoreHTTPSErrors() *Browsershot + func (b *Browsershot) InitialPageNumber(page int) *Browsershot + func (b *Browsershot) Landscape(enabled ...bool) *Browsershot + func (b *Browsershot) LocatorClick(selector string, options ...ClickOptions) *Browsershot + func (b *Browsershot) Margins(top, right, bottom, left float64, unit ...string) *Browsershot + func (b *Browsershot) Mobile(enabled ...bool) *Browsershot + func (b *Browsershot) NewHeadless() *Browsershot + func (b *Browsershot) NoSandbox() *Browsershot + func (b *Browsershot) Output() *Result + func (b *Browsershot) PDF(ctx context.Context) ([]byte, error) + func (b *Browsershot) PageErrors(ctx context.Context) ([]PageError, error) + func (b *Browsershot) Pages(ranges string) *Browsershot + func (b *Browsershot) PaperSize(width, height float64, unit ...string) *Browsershot + func (b *Browsershot) Post(fields map[string]string) *Browsershot + func (b *Browsershot) PreventUnsuccessfulResponse(enabled ...bool) *Browsershot + func (b *Browsershot) ProtocolTimeout(timeout time.Duration) *Browsershot + func (b *Browsershot) RedirectHistory(ctx context.Context) ([]Response, error) + func (b *Browsershot) Save(ctx context.Context, path string) error + func (b *Browsershot) SavePDF(ctx context.Context, path string) error + func (b *Browsershot) Scale(scale float64) *Browsershot + func (b *Browsershot) Screenshot(ctx context.Context) ([]byte, error) + func (b *Browsershot) Select(selector string, index ...int) *Browsershot + func (b *Browsershot) SelectOption(selector, value string) *Browsershot + func (b *Browsershot) SelectorIndex(index int) *Browsershot + func (b *Browsershot) SetBinPath(path string) *Browsershot + func (b *Browsershot) SetChromePath(path string) *Browsershot + func (b *Browsershot) SetContentURL(value string) *Browsershot + func (b *Browsershot) SetCustomTempPath(path string) *Browsershot + func (b *Browsershot) SetEnvironmentOptions(env map[string]string) *Browsershot + func (b *Browsershot) SetExtraHTTPHeaders(headers map[string]string) *Browsershot + func (b *Browsershot) SetExtraNavigationHTTPHeaders(headers map[string]string) *Browsershot + func (b *Browsershot) SetHTML(value string) *Browsershot + func (b *Browsershot) SetHTMLFromFilePath(path string) *Browsershot + func (b *Browsershot) SetIncludePath(path string) *Browsershot + func (b *Browsershot) SetNodeBinary(path string) *Browsershot + func (b *Browsershot) SetNodeEnv(env map[string]string) *Browsershot + func (b *Browsershot) SetNodeModulePath(path string) *Browsershot + func (b *Browsershot) SetNpmBinary(path string) *Browsershot + func (b *Browsershot) SetOption(key string, value any) *Browsershot + func (b *Browsershot) SetProxyServer(proxy string) *Browsershot + func (b *Browsershot) SetRemoteInstance(host string, port int) *Browsershot + func (b *Browsershot) SetScreenshotType(format string, quality ...int) *Browsershot + func (b *Browsershot) SetURL(value string) *Browsershot + func (b *Browsershot) SetWSEndpoint(endpoint string) *Browsershot + func (b *Browsershot) ShowBackground() *Browsershot + func (b *Browsershot) ShowBrowserHeaderAndFooter() *Browsershot + func (b *Browsershot) TaggedPDF() *Browsershot + func (b *Browsershot) ThrowOnRemoteConnectionError(enabled ...bool) *Browsershot + func (b *Browsershot) Timeout(timeout time.Duration) *Browsershot + func (b *Browsershot) Touch(enabled ...bool) *Browsershot + func (b *Browsershot) TransformImage(transform ImageTransform) *Browsershot + func (b *Browsershot) TransparentBackground() *Browsershot + func (b *Browsershot) TriggeredRequests(ctx context.Context) ([]Request, error) + func (b *Browsershot) Type(selector, text string, delay ...time.Duration) *Browsershot + func (b *Browsershot) UseCookies(cookies map[string]string, domain ...string) *Browsershot + func (b *Browsershot) UsePipe() *Browsershot + func (b *Browsershot) UserAgent(agent string) *Browsershot + func (b *Browsershot) UserDataDir(path string) *Browsershot + func (b *Browsershot) WaitForFunction(expression string) *Browsershot + func (b *Browsershot) WaitForSelector(selector string, options ...map[string]any) *Browsershot + func (b *Browsershot) WaitUntilNetworkIdle(strict ...bool) *Browsershot + func (b *Browsershot) WindowSize(width, height int) *Browsershot + func (b *Browsershot) WithRunner(runner Runner) *Browsershot + func (b *Browsershot) WriteOptionsToFile() *Browsershot + type ClickOptions struct + Button string + Count int + Delay time.Duration + type Command struct + Action string + Options map[string]any + PostParams map[string]string + URL string + type ConsoleMessage struct + Location json.RawMessage + Message string + StackTrace json.RawMessage + Type string + type FailedRequest struct + Status int + URL string + type ImageTransform func(context.Context, []byte) ([]byte, error) + type PageError struct + Message string + Name string + type Request struct + URL string + type Response struct + Headers map[string]string + Reason string + Status int + URL string + type Result struct + ConsoleMessages []ConsoleMessage + Exception string + FailedRequests []FailedRequest + PageErrors []PageError + RedirectHistory []Response + Requests []Request + Value json.RawMessage + type Runner func(context.Context, Command) (Result, error)