Versions in this module Expand all Collapse all v0 v0.2.0 Dec 9, 2022 Changes in this version + var DefaultExecAllocatorOptions = [...]ExecAllocatorOption + func ButtonLeft(p *input.DispatchMouseEventParams) *input.DispatchMouseEventParams + func ButtonMiddle(p *input.DispatchMouseEventParams) *input.DispatchMouseEventParams + func ButtonNone(p *input.DispatchMouseEventParams) *input.DispatchMouseEventParams + func ButtonRight(p *input.DispatchMouseEventParams) *input.DispatchMouseEventParams + func ByID(s *Selector) + func ByJSPath(s *Selector) + func ByNodeID(s *Selector) + func ByQuery(s *Selector) + func ByQueryAll(s *Selector) + func BySearch(s *Selector) + func Cancel(ctx context.Context) error + func DisableGPU(a *ExecAllocator) + func EmulateLandscape(p1 *emulation.SetDeviceMetricsOverrideParams, ...) + func EmulateMobile(p1 *emulation.SetDeviceMetricsOverrideParams, ...) + func EmulatePortrait(p1 *emulation.SetDeviceMetricsOverrideParams, ...) + func EmulateTouch(p1 *emulation.SetDeviceMetricsOverrideParams, ...) + func EvalAsValue(p *runtime.EvaluateParams) *runtime.EvaluateParams + func EvalIgnoreExceptions(p *runtime.EvaluateParams) *runtime.EvaluateParams + func EvalWithCommandLineAPI(p *runtime.EvaluateParams) *runtime.EvaluateParams + func Headless(a *ExecAllocator) + func IgnoreCertErrors(a *ExecAllocator) + func ListenBrowser(ctx context.Context, fn func(ev interface{})) + func ListenTarget(ctx context.Context, fn func(ev interface{})) + func NewContext(parent context.Context, opts ...ContextOption) (context.Context, context.CancelFunc) + func NewExecAllocator(parent context.Context, opts ...ExecAllocatorOption) (context.Context, context.CancelFunc) + func NewRemoteAllocator(parent context.Context, url string, opts ...RemoteAllocatorOption) (context.Context, context.CancelFunc) + func NoDefaultBrowserCheck(a *ExecAllocator) + func NoFirstRun(a *ExecAllocator) + func NoModifyURL(a *RemoteAllocator) + func NoSandbox(a *ExecAllocator) + func NodeEnabled(s *Selector) + func NodeNotPresent(s *Selector) + func NodeNotVisible(s *Selector) + func NodeReady(s *Selector) + func NodeSelected(s *Selector) + func NodeVisible(s *Selector) + func Run(ctx context.Context, actions ...Action) error + func RunResponse(ctx context.Context, actions ...Action) (*network.Response, error) + func Targets(ctx context.Context) ([]*target.Info, error) + func WaitNewTarget(ctx context.Context, fn func(*target.Info) bool) <-chan target.ID + type Action interface + Do func(context.Context) error + func CaptureScreenshot(res *[]byte) Action + func Location(urlstr *string) Action + func NavigationEntries(currentIndex *int64, entries *[]*page.NavigationEntry) Action + func Sleep(d time.Duration) Action + func Stop() Action + func Title(title *string) Action + type ActionFunc func(context.Context) error + func (f ActionFunc) Do(ctx context.Context) error + type Allocator interface + Allocate func(context.Context, ...BrowserOption) (*Browser, error) + Wait func() + type Browser struct + LostConnection chan struct{} + func NewBrowser(ctx context.Context, urlstr string, opts ...BrowserOption) (*Browser, error) + func (b *Browser) Execute(ctx context.Context, method string, params easyjson.Marshaler, ...) error + func (b *Browser) Process() *os.Process + type BrowserOption = func(*Browser) + func WithBrowserDebugf(f func(string, ...interface{})) BrowserOption + func WithBrowserErrorf(f func(string, ...interface{})) BrowserOption + func WithBrowserLogf(f func(string, ...interface{})) BrowserOption + func WithConsolef(f func(string, ...interface{})) BrowserOption + func WithDialTimeout(d time.Duration) BrowserOption + type CallAction Action + func CallFunctionOn(functionDeclaration string, res interface{}, opt CallOption, ...) CallAction + type CallOption = func(params *runtime.CallFunctionOnParams) *runtime.CallFunctionOnParams + type Conn struct + func DialContext(ctx context.Context, urlstr string, opts ...DialOption) (*Conn, error) + func (c *Conn) Close() error + func (c *Conn) Read(_ context.Context, msg *cdproto.Message) error + func (c *Conn) Write(_ context.Context, msg *cdproto.Message) error + type Context struct + Allocator Allocator + Browser *Browser + Target *Target + func FromContext(ctx context.Context) *Context + type ContextOption = func(*Context) + func WithBrowserOption(opts ...BrowserOption) ContextOption + func WithDebugf(f func(string, ...interface{})) ContextOption + func WithErrorf(f func(string, ...interface{})) ContextOption + func WithLogf(f func(string, ...interface{})) ContextOption + func WithTargetID(id target.ID) ContextOption + type Device interface + Device func() device.Info + type DialOption = func(*Conn) + func WithConnDebugf(f func(string, ...interface{})) DialOption + type EmulateAction Action + func Emulate(device Device) EmulateAction + func EmulateReset() EmulateAction + func EmulateViewport(width, height int64, opts ...EmulateViewportOption) EmulateAction + func FullScreenshot(res *[]byte, quality int) EmulateAction + func ResetViewport() EmulateAction + type EmulateViewportOption = func(*emulation.SetDeviceMetricsOverrideParams, ...) + func EmulateOrientation(orientation emulation.OrientationType, angle int64) EmulateViewportOption + func EmulateScale(scale float64) EmulateViewportOption + type Error string + const ErrChannelClosed + const ErrDisabled + const ErrHasResults + const ErrInvalidBoxModel + const ErrInvalidContext + const ErrInvalidDimensions + const ErrInvalidTarget + const ErrInvalidWebsocketMessage + const ErrNoResults + const ErrNotSelected + const ErrNotVisible + const ErrPollingTimeout + const ErrVisible + func (err Error) Error() string + type EvaluateAction Action + func Evaluate(expression string, res interface{}, opts ...EvaluateOption) EvaluateAction + func EvaluateAsDevTools(expression string, res interface{}, opts ...EvaluateOption) EvaluateAction + type EvaluateOption = func(*runtime.EvaluateParams) *runtime.EvaluateParams + func EvalObjectGroup(objectGroup string) EvaluateOption + type ExecAllocator struct + func (a *ExecAllocator) Allocate(ctx context.Context, opts ...BrowserOption) (*Browser, error) + func (a *ExecAllocator) Wait() + type ExecAllocatorOption = func(*ExecAllocator) + func CombinedOutput(w io.Writer) ExecAllocatorOption + func Env(vars ...string) ExecAllocatorOption + func ExecPath(path string) ExecAllocatorOption + func Flag(name string, value interface{}) ExecAllocatorOption + func ModifyCmdFunc(f func(cmd *exec.Cmd)) ExecAllocatorOption + func ProxyServer(proxy string) ExecAllocatorOption + func UserAgent(userAgent string) ExecAllocatorOption + func UserDataDir(dir string) ExecAllocatorOption + func WSURLReadTimeout(t time.Duration) ExecAllocatorOption + func WindowSize(width, height int) ExecAllocatorOption + type KeyAction Action + func KeyEvent(keys string, opts ...KeyOption) KeyAction + func KeyEventNode(n *cdp.Node, keys string, opts ...KeyOption) KeyAction + type KeyOption = func(*input.DispatchKeyEventParams) *input.DispatchKeyEventParams + func KeyModifiers(modifiers ...input.Modifier) KeyOption + type MouseAction Action + func MouseClickNode(n *cdp.Node, opts ...MouseOption) MouseAction + func MouseClickXY(x, y float64, opts ...MouseOption) MouseAction + func MouseEvent(typ input.MouseType, x, y float64, opts ...MouseOption) MouseAction + type MouseOption = func(*input.DispatchMouseEventParams) *input.DispatchMouseEventParams + func Button(btn string) MouseOption + func ButtonModifiers(modifiers ...input.Modifier) MouseOption + func ButtonType(button input.MouseButton) MouseOption + func ClickCount(n int) MouseOption + type NavigateAction Action + func Navigate(urlstr string) NavigateAction + func NavigateBack() NavigateAction + func NavigateForward() NavigateAction + func NavigateToHistoryEntry(entryID int64) NavigateAction + func Reload() NavigateAction + type PollAction Action + func Poll(expression string, res interface{}, opts ...PollOption) PollAction + func PollFunction(pageFunction string, res interface{}, opts ...PollOption) PollAction + type PollOption = func(task *pollTask) + func WithPollingArgs(args ...interface{}) PollOption + func WithPollingInFrame(frame *cdp.Node) PollOption + func WithPollingInterval(interval time.Duration) PollOption + func WithPollingMutation() PollOption + func WithPollingTimeout(timeout time.Duration) PollOption + type QueryAction Action + func AttributeValue(sel interface{}, name string, value *string, ok *bool, opts ...QueryOption) QueryAction + func Attributes(sel interface{}, attributes *map[string]string, opts ...QueryOption) QueryAction + func AttributesAll(sel interface{}, attributes *[]map[string]string, opts ...QueryOption) QueryAction + func Blur(sel interface{}, opts ...QueryOption) QueryAction + func Clear(sel interface{}, opts ...QueryOption) QueryAction + func Click(sel interface{}, opts ...QueryOption) QueryAction + func ComputedStyle(sel interface{}, style *[]*css.ComputedStyleProperty, opts ...QueryOption) QueryAction + func Dimensions(sel interface{}, model **dom.BoxModel, opts ...QueryOption) QueryAction + func DoubleClick(sel interface{}, opts ...QueryOption) QueryAction + func Focus(sel interface{}, opts ...QueryOption) QueryAction + func InnerHTML(sel interface{}, html *string, opts ...QueryOption) QueryAction + func JavascriptAttribute(sel interface{}, name string, res interface{}, opts ...QueryOption) QueryAction + func MatchedStyle(sel interface{}, style **css.GetMatchedStylesForNodeReturns, ...) QueryAction + func NodeIDs(sel interface{}, ids *[]cdp.NodeID, opts ...QueryOption) QueryAction + func Nodes(sel interface{}, nodes *[]*cdp.Node, opts ...QueryOption) QueryAction + func OuterHTML(sel interface{}, html *string, opts ...QueryOption) QueryAction + func Query(sel interface{}, opts ...QueryOption) QueryAction + func QueryAfter(sel interface{}, ...) QueryAction + func RemoveAttribute(sel interface{}, name string, opts ...QueryOption) QueryAction + func Reset(sel interface{}, opts ...QueryOption) QueryAction + func Screenshot(sel interface{}, picbuf *[]byte, opts ...QueryOption) QueryAction + func ScrollIntoView(sel interface{}, opts ...QueryOption) QueryAction + func SendKeys(sel interface{}, v string, opts ...QueryOption) QueryAction + func SetAttributeValue(sel interface{}, name, value string, opts ...QueryOption) QueryAction + func SetAttributes(sel interface{}, attributes map[string]string, opts ...QueryOption) QueryAction + func SetJavascriptAttribute(sel interface{}, name, value string, opts ...QueryOption) QueryAction + func SetUploadFiles(sel interface{}, files []string, opts ...QueryOption) QueryAction + func SetValue(sel interface{}, value string, opts ...QueryOption) QueryAction + func Submit(sel interface{}, opts ...QueryOption) QueryAction + func Text(sel interface{}, text *string, opts ...QueryOption) QueryAction + func TextContent(sel interface{}, text *string, opts ...QueryOption) QueryAction + func Value(sel interface{}, value *string, opts ...QueryOption) QueryAction + func WaitEnabled(sel interface{}, opts ...QueryOption) QueryAction + func WaitNotPresent(sel interface{}, opts ...QueryOption) QueryAction + func WaitNotVisible(sel interface{}, opts ...QueryOption) QueryAction + func WaitReady(sel interface{}, opts ...QueryOption) QueryAction + func WaitSelected(sel interface{}, opts ...QueryOption) QueryAction + func WaitVisible(sel interface{}, opts ...QueryOption) QueryAction + type QueryOption = func(*Selector) + func After(f func(context.Context, runtime.ExecutionContextID, ...*cdp.Node) error) QueryOption + func AtLeast(n int) QueryOption + func ByFunc(f func(context.Context, *cdp.Node) ([]cdp.NodeID, error)) QueryOption + func FromNode(node *cdp.Node) QueryOption + func RetryInterval(interval time.Duration) QueryOption + func WaitFunc(...) QueryOption + type RemoteAllocator struct + func (a *RemoteAllocator) Allocate(ctx context.Context, opts ...BrowserOption) (*Browser, error) + func (a *RemoteAllocator) Wait() + type RemoteAllocatorOption = func(*RemoteAllocator) + type Selector struct + func (s *Selector) Do(ctx context.Context) error + type Target struct + SessionID target.SessionID + TargetID target.ID + func (t *Target) Execute(ctx context.Context, method string, params easyjson.Marshaler, ...) error + type Tasks []Action + func (t Tasks) Do(ctx context.Context) error + type Transport interface + Read func(context.Context, *cdproto.Message) error + Write func(context.Context, *cdproto.Message) error