Versions in this module Expand all Collapse all v0 v0.2.1 Jul 28, 2026 v0.2.0 Jul 28, 2026 Changes in this version + const DefaultArticleMinChars + const DefaultConsentPendingAfter + const DefaultConsentTimeout + const DefaultConsoleBuffer + const DefaultConsoleMaxEntry + const DefaultFindLimit + const DefaultNetBuffer + const DefaultNetMaxBody + const DefaultRecordFPS + const DefaultRecordFrames + const DefaultRecordMaxBytes + const DefaultRecordMaxDuration + const DefaultRecordQuality + const DefaultRecordScale + const MaxConsentTimeout + const MaxFindLimit + const MinConsentTimeout + const NetRedacted + var ConsoleLevels = []string + var ErrAlreadyRecording = errors.New("a recording is already active on this tab") + var ErrAppendUnknown = errors.New(...) + var ErrCoordinateOOB = errors.New("coordinate is outside the viewport") + var ErrDropFailed = errors.New("the drop could not be delivered") + var ErrNoHistory = errors.New("no history entry in that direction") + var ErrNotFileInput = errors.New("element is not a file input") + var ErrNotMultiple = errors.New("input does not accept multiple files") + var ErrNotRecording = errors.New("no recording is active on this tab") + var ErrOccluded = errors.New("element has no settled, unoccluded clickable centre") + var ErrZeroArea = errors.New("element resolved but has a zero-area box (display:none, or collapsed)") + var NetTypes = []string + func ClampConsentTimeout(d time.Duration) time.Duration + func FormatKeys(keys []KeyStroke) string + func IsAlreadyRecording(err error) bool + func IsCoordinateOOB(err error) bool + func IsDropFailure(err error) bool + func IsNoHistory(err error) bool + func IsNotRecording(err error) bool + func IsOccluded(err error) bool + func IsUploadUsage(err error) bool + func IsZeroArea(err error) bool + func KeyNames(keys []KeyStroke) []string + func NetURLMatcher(spec string) (func(string) bool, error) + func NormalizeConsoleLevel(s string) (string, bool) + func NormalizeNetType(s string) (string, bool) + func PDFPageCount(b []byte) int + func ParseModifiers(s string) (int64, error) + func ProbeWS(wsURL string, wait time.Duration) browser.WSState + func RedactBody(body string, noRedact bool) string + func RedactHeaders(h map[string]string, noRedact bool) map[string]string + func RedactURL(raw string) string + func RedactedHeaderName(name string) bool + func RedactedParamName(name string) bool + func ResolveWSURL(endpoint string) (string, bool) type Browser + Activate func(ctx context.Context, targetID string) (map[string]any, error) + CloseTabs func(ctx context.Context, targetIDs []string) (map[string]any, error) + Console func(ctx context.Context, targetID string, opts ConsoleOpts) (any, error) + ConsoleStream func(ctx context.Context, targetID string, opts ConsoleOpts, emit func(any) error) error + Find func(ctx context.Context, targetID, query string, opts FindOpts) (map[string]any, error) + History func(ctx context.Context, targetID string, delta int) (map[string]any, error) + Key func(ctx context.Context, targetID, selector string, keys []KeyStroke, opts KeyOpts) (map[string]any, error) + Net func(ctx context.Context, targetID string, opts NetOpts) (any, error) + NetStream func(ctx context.Context, targetID string, opts NetOpts, emit func(any) error) error + NetWait func(ctx context.Context, targetID string, cond NetCond) (map[string]any, error) + Pointer func(ctx context.Context, targetID, selector string, opts PointerOpts) (map[string]any, error) + RecordCancel func(ctx context.Context, targetID string) (map[string]any, error) + RecordRestore func(ctx context.Context, targetID string, frames []Frame, meta map[string]any) error + RecordStart func(ctx context.Context, targetID string, opts RecordOpts) (map[string]any, error) + RecordStatus func(ctx context.Context, targetID string) (map[string]any, error) + RecordStop func(ctx context.Context, targetID string) ([]Frame, map[string]any, error) + Reload func(ctx context.Context, targetID string, hard bool) (map[string]any, error) + Upload func(ctx context.Context, targetID, selector string, paths []string, ...) (map[string]any, error) + Window func(ctx context.Context, targetID string, opts WindowOpts) (WindowBounds, error) type CDP + func (c *CDP) Activate(ctx context.Context, targetID string) (map[string]any, error) + func (c *CDP) CloseTabs(ctx context.Context, targetIDs []string) (map[string]any, error) + func (c *CDP) Console(ctx context.Context, id string, opts ConsoleOpts) (any, error) + func (c *CDP) ConsoleStream(ctx context.Context, id string, opts ConsoleOpts, emit func(any) error) error + func (c *CDP) Find(ctx context.Context, id, query string, opts FindOpts) (map[string]any, error) + func (c *CDP) History(ctx context.Context, targetID string, delta int) (map[string]any, error) + func (c *CDP) Key(ctx context.Context, id, selector string, keys []KeyStroke, opts KeyOpts) (map[string]any, error) + func (c *CDP) Net(ctx context.Context, id string, opts NetOpts) (any, error) + func (c *CDP) NetStream(ctx context.Context, id string, opts NetOpts, emit func(any) error) error + func (c *CDP) NetWait(ctx context.Context, id string, cond NetCond) (map[string]any, error) + func (c *CDP) Pointer(ctx context.Context, id, selector string, opts PointerOpts) (map[string]any, error) + func (c *CDP) RecordCancel(ctx context.Context, id string) (map[string]any, error) + func (c *CDP) RecordRestore(_ context.Context, id string, frames []Frame, meta map[string]any) error + func (c *CDP) RecordStart(ctx context.Context, id string, opts RecordOpts) (map[string]any, error) + func (c *CDP) RecordStatus(_ context.Context, id string) (map[string]any, error) + func (c *CDP) RecordStop(ctx context.Context, id string) ([]Frame, map[string]any, error) + func (c *CDP) Reload(ctx context.Context, targetID string, hard bool) (map[string]any, error) + func (c *CDP) Upload(ctx context.Context, id, selector string, paths []string, opts UploadOpts) (map[string]any, error) + func (c *CDP) Window(ctx context.Context, id string, opts WindowOpts) (WindowBounds, error) + type ConsoleOpts struct + Clear bool + Grep string + Levels []string + Limit int + Since time.Duration + type EvalOpts struct + Await bool + type FindOpts struct + All bool + Dedupe bool + Limit int + MinScore float64 + Region string + Role string + type Frame struct + CSSHeight float64 + CSSWidth float64 + Data []byte + Height int + Marks []FrameMark + TS time.Time + Width int + type FrameMark struct + Command string + TS time.Time + X float64 + Y float64 + type JSError struct + Message string + Stack string + func JSException(err error) (*JSError, bool) + func (e *JSError) Error() string + type KeyOpts struct + Delay time.Duration + Query QueryOpts + Repeat int + type KeyStroke struct + Code string + Key string + KeyCode int64 + Modifiers int64 + Text string + func ParseKeys(spec string) ([]KeyStroke, error) + func (k KeyStroke) String() string + type NetCond struct + Body bool + Failed bool + Headers bool + Methods []string + NoRedact bool + Status string + Types []string + URL string + type NetOpts struct + Body bool + Clear bool + Failed bool + Headers bool + Limit int + Methods []string + NoRedact bool + Since time.Duration + Status string + Types []string + URL string + type NetStatusMatcher func(status int64, hasStatus bool) bool + func ParseNetStatus(spec string) (NetStatusMatcher, error) type Options + ConsentPendingAfter time.Duration + ConsentTimeout time.Duration + ConsoleBuffer int + ConsoleMaxEntry int + NetBuffer int + NetMaxBody int + OnConsentPending func() + RecordBuffer int + RecordMaxBytes int + type PDFOpts struct + Background bool + Footer string + Header string + Landscape bool + MarginBottom float64 + MarginLeft float64 + MarginRight float64 + MarginTop float64 + Pages string + PaperHeight float64 + PaperWidth float64 + Scale float64 + type Point struct + X float64 + Y float64 + type PointerAction string + const PointerClick + const PointerDblClick + const PointerDrag + const PointerHover + const PointerRClick + const PointerTripleClick + type PointerOpts struct + Action PointerAction + At *Point + Dx float64 + Dy float64 + Hold time.Duration + Modifiers int64 + Query QueryOpts + Steps int + To string + ToAt *Point + ToQuery QueryOpts + type RecordOpts struct + Annotate bool + FPS float64 + MaxDuration time.Duration + MaxFrames int + Quality int + Scale float64 + type Rect struct + Height float64 + Width float64 + X float64 + Y float64 type ScrollOpts + At *Point + type ShotMode string + const ShotElement + const ShotFullPage + const ShotRegion + const ShotViewport + type ShotOpts struct + Format string + FullPage bool + Padding float64 + Quality int + Query QueryOpts + Region *Rect + Scale float64 + Selector string + type TextOpts struct + Article bool + Markdown bool + MinChars int + Query QueryOpts + type Upgrade struct + State browser.WSState + func AwaitUpgrade(wsURL string, t UpgradeTimings, onPending func()) *Upgrade + func (u *Upgrade) Close() + type UpgradeTimings struct + PendingAfter time.Duration + Total time.Duration + type UploadOpts struct + Append bool + Drop string + DropAt *Point + Query QueryOpts + type WindowBounds struct + Height int64 + Left int64 + State string + Top int64 + Width int64 + type WindowOpts struct + Height int64 + Width int64 v0.1.0 Jul 16, 2026 Changes in this version + func Reachable(wsURL string) bool + type Browser interface + AttrGet func(ctx context.Context, targetID, selector, name string, q QueryOpts) (map[string]any, error) + AttrList func(ctx context.Context, targetID, selector string, q QueryOpts) (map[string]any, error) + AttrRemove func(ctx context.Context, targetID, selector, name string, q QueryOpts) (map[string]any, error) + AttrSet func(ctx context.Context, targetID, selector, name, value string, q QueryOpts) (map[string]any, error) + Click func(ctx context.Context, targetID, selector string, q QueryOpts) (map[string]any, error) + Close func() error + CookieClear func(ctx context.Context, targetID string) (map[string]any, error) + CookieDelete func(ctx context.Context, targetID, name string) (map[string]any, error) + CookieList func(ctx context.Context, targetID string) (any, error) + CookieSet func(ctx context.Context, targetID, name, value, domain, path string) (map[string]any, error) + EmulateGeo func(ctx context.Context, targetID string, lat, lon float64) (map[string]any, error) + EmulateReset func(ctx context.Context, targetID string) (map[string]any, error) + EmulateViewport func(ctx context.Context, targetID string, width, height int64) (map[string]any, error) + Eval func(ctx context.Context, targetID, expr string) (any, error) + Fill func(ctx context.Context, targetID, selector, value string, q QueryOpts) (map[string]any, error) + Frames func(ctx context.Context, targetID string) (any, error) + Grid func(ctx context.Context, targetID, selector string, q QueryOpts) (any, error) + HTML func(ctx context.Context, targetID, selector string, inner bool, q QueryOpts) (map[string]any, error) + List func(ctx context.Context) ([]target.Info, error) + Navigate func(ctx context.Context, targetID, url string) (map[string]any, error) + Open func(ctx context.Context, url string) (map[string]any, error) + PDF func(ctx context.Context, targetID string) ([]byte, error) + Raw func(ctx context.Context, targetID, method string, params json.RawMessage) (any, error) + Screenshot func(ctx context.Context, targetID string) ([]byte, error) + Scroll func(ctx context.Context, targetID, selector string, opts ScrollOpts) (map[string]any, error) + Select func(ctx context.Context, targetID, field, option string, opts SelectOpts) (map[string]any, error) + SetHeaders func(ctx context.Context, targetID string, headers map[string]string) (map[string]any, error) + Snapshot func(ctx context.Context, targetID string, opts SnapOpts) (any, error) + Text func(ctx context.Context, targetID, selector string, q QueryOpts) (map[string]any, error) + Type func(ctx context.Context, targetID, selector, text string, q QueryOpts) (map[string]any, error) + Value func(ctx context.Context, targetID, selector string, q QueryOpts) (map[string]any, error) + Values func(ctx context.Context, targetID, selector string, q QueryOpts) (map[string]any, error) + Wait func(ctx context.Context, targetID string, cond WaitCond) (map[string]any, error) + type CDP struct + func Connect(_ context.Context, opts Options) (*CDP, error) + func (c *CDP) AttrGet(ctx context.Context, id, selector, name string, q QueryOpts) (map[string]any, error) + func (c *CDP) AttrList(ctx context.Context, id, selector string, q QueryOpts) (map[string]any, error) + func (c *CDP) AttrRemove(ctx context.Context, id, selector, name string, q QueryOpts) (map[string]any, error) + func (c *CDP) AttrSet(ctx context.Context, id, selector, name, value string, q QueryOpts) (map[string]any, error) + func (c *CDP) Click(ctx context.Context, id, selector string, q QueryOpts) (map[string]any, error) + func (c *CDP) Close() error + func (c *CDP) CookieClear(ctx context.Context, id string) (map[string]any, error) + func (c *CDP) CookieDelete(ctx context.Context, id, name string) (map[string]any, error) + func (c *CDP) CookieList(ctx context.Context, id string) (any, error) + func (c *CDP) CookieSet(ctx context.Context, id, name, value, domain, path string) (map[string]any, error) + func (c *CDP) EmulateGeo(ctx context.Context, id string, lat, lon float64) (map[string]any, error) + func (c *CDP) EmulateReset(ctx context.Context, id string) (map[string]any, error) + func (c *CDP) EmulateViewport(ctx context.Context, id string, width, height int64) (map[string]any, error) + func (c *CDP) Eval(ctx context.Context, id, expr string) (any, error) + func (c *CDP) Fill(ctx context.Context, id, selector, value string, q QueryOpts) (map[string]any, error) + func (c *CDP) Frames(ctx context.Context, id string) (any, error) + func (c *CDP) Grid(ctx context.Context, id, selector string, q QueryOpts) (any, error) + func (c *CDP) HTML(ctx context.Context, id, selector string, inner bool, q QueryOpts) (map[string]any, error) + func (c *CDP) List(_ context.Context) ([]target.Info, error) + func (c *CDP) Navigate(ctx context.Context, id, url string) (map[string]any, error) + func (c *CDP) Open(ctx context.Context, url string) (map[string]any, error) + func (c *CDP) PDF(ctx context.Context, id string) ([]byte, error) + func (c *CDP) Raw(ctx context.Context, id, method string, params json.RawMessage) (any, error) + func (c *CDP) Screenshot(ctx context.Context, id string) ([]byte, error) + func (c *CDP) Scroll(ctx context.Context, id, selector string, opts ScrollOpts) (map[string]any, error) + func (c *CDP) Select(ctx context.Context, id, field, option string, opts SelectOpts) (map[string]any, error) + func (c *CDP) SetHeaders(ctx context.Context, id string, headers map[string]string) (map[string]any, error) + func (c *CDP) Snapshot(ctx context.Context, id string, opts SnapOpts) (any, error) + func (c *CDP) Text(ctx context.Context, id, selector string, q QueryOpts) (map[string]any, error) + func (c *CDP) Type(ctx context.Context, id, selector, text string, q QueryOpts) (map[string]any, error) + func (c *CDP) Value(ctx context.Context, id, selector string, q QueryOpts) (map[string]any, error) + func (c *CDP) Values(ctx context.Context, id, selector string, q QueryOpts) (map[string]any, error) + func (c *CDP) Wait(ctx context.Context, id string, cond WaitCond) (map[string]any, error) + type ConnectError struct + Code string + Message string + func (e *ConnectError) Error() string + type Options struct + Headless bool + NoLaunch bool + Port int + PortFile string + ProfileDir string + type QueryOpts struct + By string + InRow string + Match string + Nth int + OnDialog string + Pierce bool + Role string + Wait string + type ScrollOpts struct + Dx float64 + Dy float64 + Into bool + Query QueryOpts + Wheel bool + type SelectOpts struct + Filter string + OptionMatch string + Query QueryOpts + Sep string + type SnapOpts struct + Dedupe bool + Grep string + Region string + Role string + type WaitCond struct + Gone string + Idle bool + Query QueryOpts + Stable bool + Text string + URL string + Visible string