browser

package
v0.0.0-...-c923896 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChromeDPExecutor

type ChromeDPExecutor struct{}

ChromeDPExecutor implements the Executor library as a chromedp wrapper.

func New

func New() *ChromeDPExecutor

New returns a new ChromeDPExecutor.

func (*ChromeDPExecutor) ListenTarget

func (e *ChromeDPExecutor) ListenTarget(ctx context.Context, fn func(ev interface{}))

ListenTarget registers a new function as a listener, which is triggered on incoming CDP events. See chromedp documentation for further details.

func (*ChromeDPExecutor) Run

func (e *ChromeDPExecutor) Run(ctx context.Context, actions ...chromedp.Action) error

Run executes a chromedp Run method, performing the actual request on a browser. See chromedp documentation for further details.

type Executor

type Executor interface {
	Run(ctx context.Context, actions ...chromedp.Action) error
	ListenTarget(ctx context.Context, fn func(ev interface{}))
}

Executor abstracts away the implementation details of communicating to a Chrome Devtools protocol capable library.

Jump to

Keyboard shortcuts

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