browser

package
v0.0.0-...-c33a69e Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMaxTabs is returned when the maximum number of tabs is reached
	ErrMaxTabs       = fmt.Errorf("maximum number of tabs reached")
	ErrMaxTabsNotSet = fmt.Errorf("maximum number of tabs not set")
)

Functions

This section is empty.

Types

type Chrome

type Chrome struct {
	Cancel context.CancelFunc
	// contains filtered or unexported fields
}

func NewChrome

func NewChrome(ctx context.Context, options ...ChromeOption) (*Chrome, error)

func (*Chrome) AcquireTab

func (b *Chrome) AcquireTab() (headless.Browser, error)

func (*Chrome) Get

func (b *Chrome) Get(url string, headers http.Header) (*http.Response, error)

type ChromeOption

type ChromeOption func(*Chrome) error

func AsFirefox

func AsFirefox() ChromeOption

func CDPOptions

func CDPOptions(cdps ...chromedp.ExecAllocatorOption) ChromeOption

func Headless

func Headless(h bool) ChromeOption

func MaxTabs

func MaxTabs(n int) ChromeOption

func TabAcquireTimeout

func TabAcquireTimeout(d time.Duration) ChromeOption

func UserAgentIfNotEmpty

func UserAgentIfNotEmpty(uas ...string) ChromeOption

func WindowSize

func WindowSize(w, h int) ChromeOption

Jump to

Keyboard shortcuts

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