network

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const BlankPageURL = "about:blank"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookies added in v0.14.0

type Cookies map[string]*drivers.HTTPCookies

type Filter added in v0.14.0

type Filter struct {
	Patterns []drivers.ResourceFilter
}

type FrameLoadedListener

type FrameLoadedListener = func(ctx context.Context, frame page.Frame)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func New

func New(
	logger *zerolog.Logger,
	client *cdp.Client,
	options Options,
) (*Manager, error)

func (*Manager) AddFrameLoadedListener

func (m *Manager) AddFrameLoadedListener(listener FrameLoadedListener) events.ListenerID

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) DeleteCookies

func (m *Manager) DeleteCookies(ctx context.Context, url string, cookies *drivers.HTTPCookies) error

func (*Manager) GetCookies

func (m *Manager) GetCookies(ctx context.Context) (*drivers.HTTPCookies, error)

func (*Manager) GetHeaders

func (m *Manager) GetHeaders(_ context.Context) (*drivers.HTTPHeaders, error)

func (*Manager) GetResponse

func (m *Manager) GetResponse(_ context.Context, frameID page.FrameID) (drivers.HTTPResponse, error)

func (*Manager) Navigate

func (m *Manager) Navigate(ctx context.Context, url values.String) error

func (*Manager) NavigateBack

func (m *Manager) NavigateBack(ctx context.Context, skip values.Int) (values.Boolean, error)

func (*Manager) NavigateForward

func (m *Manager) NavigateForward(ctx context.Context, skip values.Int) (values.Boolean, error)

func (*Manager) RemoveFrameLoadedListener

func (m *Manager) RemoveFrameLoadedListener(id events.ListenerID)

func (*Manager) SetCookies

func (m *Manager) SetCookies(ctx context.Context, url string, cookies *drivers.HTTPCookies) error

func (*Manager) SetHeaders

func (m *Manager) SetHeaders(ctx context.Context, headers *drivers.HTTPHeaders) error

func (*Manager) WaitForFrameNavigation

func (m *Manager) WaitForFrameNavigation(ctx context.Context, frameID page.FrameID, urlPattern *regexp.Regexp) error

func (*Manager) WaitForNavigation

func (m *Manager) WaitForNavigation(ctx context.Context, pattern *regexp.Regexp) error

type Options added in v0.14.0

type Options struct {
	Cookies Cookies
	Headers *drivers.HTTPHeaders
	Filter  *Filter
}

Jump to

Keyboard shortcuts

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