README

🎭 Playwright for

PkgGoDev License Build Status Join Slack Coverage Status Chromium version Firefox version WebKit version

API reference | Example recipes

Playwright is a Go library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.

Linux macOS Windows
Chromium 86.0.4217.0
WebKit 14.0
Firefox 80.0b8

Headless execution is supported for all the browsers on all platforms.

Installation

go get github.com/mxschmitt/playwright-go

Capabilities

Playwright is built to automate the broad and growing set of web browser capabilities used by Single Page Apps and Progressive Web Apps.

  • Scenarios that span multiple page, domains and iframes
  • Auto-wait for elements to be ready before executing actions (like click, fill)
  • Intercept network activity for stubbing and mocking network requests
  • Emulate mobile devices, geolocation, permissions
  • Support for web components via shadow-piercing selectors
  • Native input events for mouse and keyboard
  • Upload and download files

Is Playwright for Go ready?

We are ready for your feedback, but we are still covering Playwright Go with the tests, so expect a bumpy ride and don't use for production.

Resources

Expand ▾ Collapse ▴

Documentation

Overview

Package playwright is a library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.

Index

Examples

Constants

const DEFAULT_TIMEOUT = 30 * 1000

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func Float

func Float(v float64) *float64

Float is a helper routine that allocates a new float64 value to store v and returns a pointer to it.

func Install

func Install() error

Install does download the driver and the browsers. If not called manually before playwright.Run() it will get executed there and might take a few seconds to download the Playwright suite.

func Int

func Int(v int) *int

Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it.

func Null

func Null() interface{}

Null will be used in certain scenarios where a strict nil pointer check is not possible

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

Types

type AccessibilitySnapshotOptions

type AccessibilitySnapshotOptions struct {
	InterestingOnly *bool          `json:"interestingOnly"`
	Root            *ElementHandle `json:"root"`
}

type BindingCall

type BindingCall struct {
	ChannelOwner
}

type Browser

type Browser struct {
	ChannelOwner
	IsConnected bool
	// contains filtered or unexported fields
}

func (*Browser) Close

func (b *Browser) Close() error

func (*Browser) Contexts

func (b *Browser) Contexts() []*BrowserContext

func (*Browser) NewContext

func (b *Browser) NewContext(options ...BrowserNewContextOptions) (*BrowserContext, error)

func (*Browser) NewPage

func (b *Browser) NewPage(options ...BrowserNewContextOptions) (*Page, error)

func (*Browser) Version

func (b *Browser) Version() string

type BrowserContext

type BrowserContext struct {
	ChannelOwner
	// contains filtered or unexported fields
}

func (*BrowserContext) AddCookies

func (b *BrowserContext) AddCookies(cookies ...SetNetworkCookieParam) error

func (*BrowserContext) AddInitScript

func (b *BrowserContext) AddInitScript(options BrowserContextAddInitScriptOptions) error

func (*BrowserContext) ClearCookies

func (b *BrowserContext) ClearCookies() error

func (*BrowserContext) ClearPermissions

func (b *BrowserContext) ClearPermissions() error

func (*BrowserContext) Close

func (b *BrowserContext) Close() error

func (*BrowserContext) Cookies

func (b *BrowserContext) Cookies(urls ...string) ([]*NetworkCookie, error)

func (*BrowserContext) ExpectEvent

func (b *BrowserContext) ExpectEvent(event string, cb func() error) (interface{}, error)

func (*BrowserContext) GrantPermissions

func (b *BrowserContext) GrantPermissions(permissions []string, options ...BrowserContextGrantPermissionsOptions) error

func (*BrowserContext) NewPage

func (b *BrowserContext) NewPage(options ...BrowserNewPageOptions) (*Page, error)

func (*BrowserContext) Pages

func (b *BrowserContext) Pages() []*Page

func (*BrowserContext) SetDefaultNavigationTimeout

func (b *BrowserContext) SetDefaultNavigationTimeout(timeout int)

func (*BrowserContext) SetDefaultTimeout

func (b *BrowserContext) SetDefaultTimeout(timeout int)

func (*BrowserContext) SetExtraHTTPHeaders

func (b *BrowserContext) SetExtraHTTPHeaders(headers map[string]string) error

func (*BrowserContext) SetGeolocation

func (b *BrowserContext) SetGeolocation(gelocation *SetGeolocationOptions) error

func (*BrowserContext) SetOffline

func (b *BrowserContext) SetOffline(offline bool) error

func (*BrowserContext) WaitForEvent

func (b *BrowserContext) WaitForEvent(event string, predicate ...interface{}) interface{}

type BrowserContextAddInitScriptOptions

type BrowserContextAddInitScriptOptions struct {
	Path   *string
	Script *string
}

type BrowserContextGrantPermissionsOptions

type BrowserContextGrantPermissionsOptions struct {
	Origin *string `json:"origin"`
}

type BrowserContextWaitForEventOptions

type BrowserContextWaitForEventOptions struct {
	Predicate interface{} `json:"predicate"`
	Timeout   *int        `json:"timeout"`
}

type BrowserNewContextGeolocation

type BrowserNewContextGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type BrowserNewContextHttpCredentials

type BrowserNewContextHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type BrowserNewContextOptions

type BrowserNewContextOptions struct {
	AcceptDownloads   *bool                             `json:"acceptDownloads"`
	IgnoreHTTPSErrors *bool                             `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                             `json:"bypassCSP"`
	Viewport          *BrowserNewContextViewport        `json:"viewport"`
	UserAgent         *string                           `json:"userAgent"`
	DeviceScaleFactor *int                              `json:"deviceScaleFactor"`
	IsMobile          *bool                             `json:"isMobile"`
	HasTouch          *bool                             `json:"hasTouch"`
	JavaScriptEnabled *bool                             `json:"javaScriptEnabled"`
	TimezoneId        *string                           `json:"timezoneId"`
	Geolocation       *BrowserNewContextGeolocation     `json:"geolocation"`
	Locale            *string                           `json:"locale"`
	Permissions       []string                          `json:"permissions"`
	ExtraHTTPHeaders  map[string]string                 `json:"extraHTTPHeaders"`
	Offline           *bool                             `json:"offline"`
	HttpCredentials   *BrowserNewContextHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                           `json:"colorScheme"`
	Logger            interface{}                       `json:"logger"`
	RecordVideos      *BrowserNewContextRecordVideos    `json:"_recordVideos"`
}

type BrowserNewContextRecordVideos

type BrowserNewContextRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type BrowserNewContextViewport

type BrowserNewContextViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type BrowserNewPageGeolocation

type BrowserNewPageGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type BrowserNewPageHttpCredentials

type BrowserNewPageHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type BrowserNewPageOptions

type BrowserNewPageOptions struct {
	AcceptDownloads   *bool                          `json:"acceptDownloads"`
	IgnoreHTTPSErrors *bool                          `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                          `json:"bypassCSP"`
	Viewport          *BrowserNewPageViewport        `json:"viewport"`
	UserAgent         *string                        `json:"userAgent"`
	DeviceScaleFactor *int                           `json:"deviceScaleFactor"`
	IsMobile          *bool                          `json:"isMobile"`
	HasTouch          *bool                          `json:"hasTouch"`
	JavaScriptEnabled *bool                          `json:"javaScriptEnabled"`
	TimezoneId        *string                        `json:"timezoneId"`
	Geolocation       *BrowserNewPageGeolocation     `json:"geolocation"`
	Locale            *string                        `json:"locale"`
	Permissions       []string                       `json:"permissions"`
	ExtraHTTPHeaders  map[string]string              `json:"extraHTTPHeaders"`
	Offline           *bool                          `json:"offline"`
	HttpCredentials   *BrowserNewPageHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                        `json:"colorScheme"`
	Logger            interface{}                    `json:"logger"`
	RecordVideos      *BrowserNewPageRecordVideos    `json:"_recordVideos"`
}

type BrowserNewPageRecordVideos

type BrowserNewPageRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type BrowserNewPageViewport

type BrowserNewPageViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type BrowserType

type BrowserType struct {
	ChannelOwner
}

func (*BrowserType) ExecutablePath

func (b *BrowserType) ExecutablePath() string

func (*BrowserType) Launch

func (b *BrowserType) Launch(options ...BrowserTypeLaunchOptions) (*Browser, error)

func (*BrowserType) LaunchPersistentContext

func (b *BrowserType) LaunchPersistentContext(userDataDir string, options ...BrowserTypeLaunchPersistentContextOptions) (*BrowserContext, error)

func (*BrowserType) Name

func (b *BrowserType) Name() string

type BrowserTypeConnectOptions

type BrowserTypeConnectOptions struct {
	WsEndpoint *string     `json:"wsEndpoint"`
	SlowMo     *int        `json:"slowMo"`
	Logger     interface{} `json:"logger"`
	Timeout    *int        `json:"timeout"`
}

type BrowserTypeLaunchOptions

type BrowserTypeLaunchOptions struct {
	Headless          *bool                   `json:"headless"`
	ExecutablePath    *string                 `json:"executablePath"`
	Args              []string                `json:"args"`
	IgnoreDefaultArgs interface{}             `json:"ignoreDefaultArgs"`
	Proxy             *BrowserTypeLaunchProxy `json:"proxy"`
	DownloadsPath     *string                 `json:"downloadsPath"`
	VideosPath        *string                 `json:"_videosPath"`
	ChromiumSandbox   *bool                   `json:"chromiumSandbox"`
	FirefoxUserPrefs  map[string]interface{}  `json:"firefoxUserPrefs"`
	HandleSIGINT      *bool                   `json:"handleSIGINT"`
	HandleSIGTERM     *bool                   `json:"handleSIGTERM"`
	HandleSIGHUP      *bool                   `json:"handleSIGHUP"`
	Logger            interface{}             `json:"logger"`
	Timeout           *int                    `json:"timeout"`
	Env               map[string]interface{}  `json:"env"`
	Devtools          *bool                   `json:"devtools"`
	SlowMo            *int                    `json:"slowMo"`
}

type BrowserTypeLaunchPersistentContextGeolocation

type BrowserTypeLaunchPersistentContextGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type BrowserTypeLaunchPersistentContextHttpCredentials

type BrowserTypeLaunchPersistentContextHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type BrowserTypeLaunchPersistentContextOptions

type BrowserTypeLaunchPersistentContextOptions struct {
	Headless          *bool                                              `json:"headless"`
	ExecutablePath    *string                                            `json:"executablePath"`
	Args              []string                                           `json:"args"`
	IgnoreDefaultArgs interface{}                                        `json:"ignoreDefaultArgs"`
	Proxy             *BrowserTypeLaunchPersistentContextProxy           `json:"proxy"`
	AcceptDownloads   *bool                                              `json:"acceptDownloads"`
	DownloadsPath     *string                                            `json:"downloadsPath"`
	ChromiumSandbox   *bool                                              `json:"chromiumSandbox"`
	HandleSIGINT      *bool                                              `json:"handleSIGINT"`
	HandleSIGTERM     *bool                                              `json:"handleSIGTERM"`
	HandleSIGHUP      *bool                                              `json:"handleSIGHUP"`
	Logger            interface{}                                        `json:"logger"`
	Timeout           *int                                               `json:"timeout"`
	Env               map[string]interface{}                             `json:"env"`
	Devtools          *bool                                              `json:"devtools"`
	SlowMo            *int                                               `json:"slowMo"`
	IgnoreHTTPSErrors *bool                                              `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                                              `json:"bypassCSP"`
	Viewport          *BrowserTypeLaunchPersistentContextViewport        `json:"viewport"`
	UserAgent         *string                                            `json:"userAgent"`
	DeviceScaleFactor *int                                               `json:"deviceScaleFactor"`
	IsMobile          *bool                                              `json:"isMobile"`
	HasTouch          *bool                                              `json:"hasTouch"`
	JavaScriptEnabled *bool                                              `json:"javaScriptEnabled"`
	TimezoneId        *string                                            `json:"timezoneId"`
	Geolocation       *BrowserTypeLaunchPersistentContextGeolocation     `json:"geolocation"`
	Locale            *string                                            `json:"locale"`
	Permissions       []string                                           `json:"permissions"`
	ExtraHTTPHeaders  map[string]string                                  `json:"extraHTTPHeaders"`
	Offline           *bool                                              `json:"offline"`
	HttpCredentials   *BrowserTypeLaunchPersistentContextHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                                            `json:"colorScheme"`
	VideosPath        *string                                            `json:"_videosPath"`
	RecordVideos      *BrowserTypeLaunchPersistentContextRecordVideos    `json:"_recordVideos"`
}

type BrowserTypeLaunchPersistentContextProxy

type BrowserTypeLaunchPersistentContextProxy struct {
	Server   *string `json:"server"`
	Bypass   *string `json:"bypass"`
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type BrowserTypeLaunchPersistentContextRecordVideos

type BrowserTypeLaunchPersistentContextRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type BrowserTypeLaunchPersistentContextViewport

type BrowserTypeLaunchPersistentContextViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type BrowserTypeLaunchProxy

type BrowserTypeLaunchProxy struct {
	Server   *string `json:"server"`
	Bypass   *string `json:"bypass"`
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type BrowserTypeLaunchServerOptions

type BrowserTypeLaunchServerOptions struct {
	Headless          *bool                         `json:"headless"`
	Port              *int                          `json:"port"`
	ExecutablePath    *string                       `json:"executablePath"`
	Args              []string                      `json:"args"`
	IgnoreDefaultArgs interface{}                   `json:"ignoreDefaultArgs"`
	Proxy             *BrowserTypeLaunchServerProxy `json:"proxy"`
	DownloadsPath     *string                       `json:"downloadsPath"`
	VideosPath        *string                       `json:"_videosPath"`
	ChromiumSandbox   *bool                         `json:"chromiumSandbox"`
	FirefoxUserPrefs  map[string]interface{}        `json:"firefoxUserPrefs"`
	HandleSIGINT      *bool                         `json:"handleSIGINT"`
	HandleSIGTERM     *bool                         `json:"handleSIGTERM"`
	HandleSIGHUP      *bool                         `json:"handleSIGHUP"`
	Logger            interface{}                   `json:"logger"`
	Timeout           *int                          `json:"timeout"`
	Env               map[string]interface{}        `json:"env"`
	Devtools          *bool                         `json:"devtools"`
}

type BrowserTypeLaunchServerProxy

type BrowserTypeLaunchServerProxy struct {
	Server   *string `json:"server"`
	Bypass   *string `json:"bypass"`
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type Channel

type Channel struct {
	EventEmitter
	// contains filtered or unexported fields
}

func (*Channel) Send

func (c *Channel) Send(method string, options ...interface{}) (interface{}, error)

func (*Channel) SendNoReply

func (c *Channel) SendNoReply(method string, options ...interface{})

type ChannelOwner

type ChannelOwner struct {
	EventEmitter
	// contains filtered or unexported fields
}

func (*ChannelOwner) Dispose

func (c *ChannelOwner) Dispose()

type ChromiumBrowserContextGrantPermissionsOptions

type ChromiumBrowserContextGrantPermissionsOptions struct {
	Origin *string `json:"origin"`
}

type ChromiumBrowserContextWaitForEventOptions

type ChromiumBrowserContextWaitForEventOptions struct {
	Predicate interface{} `json:"predicate"`
	Timeout   *int        `json:"timeout"`
}

type ChromiumBrowserNewContextGeolocation

type ChromiumBrowserNewContextGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type ChromiumBrowserNewContextHttpCredentials

type ChromiumBrowserNewContextHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type ChromiumBrowserNewContextOptions

type ChromiumBrowserNewContextOptions struct {
	AcceptDownloads   *bool                                     `json:"acceptDownloads"`
	IgnoreHTTPSErrors *bool                                     `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                                     `json:"bypassCSP"`
	Viewport          *ChromiumBrowserNewContextViewport        `json:"viewport"`
	UserAgent         *string                                   `json:"userAgent"`
	DeviceScaleFactor *int                                      `json:"deviceScaleFactor"`
	IsMobile          *bool                                     `json:"isMobile"`
	HasTouch          *bool                                     `json:"hasTouch"`
	JavaScriptEnabled *bool                                     `json:"javaScriptEnabled"`
	TimezoneId        *string                                   `json:"timezoneId"`
	Geolocation       *ChromiumBrowserNewContextGeolocation     `json:"geolocation"`
	Locale            *string                                   `json:"locale"`
	Permissions       []string                                  `json:"permissions"`
	ExtraHTTPHeaders  map[string]string                         `json:"extraHTTPHeaders"`
	Offline           *bool                                     `json:"offline"`
	HttpCredentials   *ChromiumBrowserNewContextHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                                   `json:"colorScheme"`
	Logger            interface{}                               `json:"logger"`
	RecordVideos      *ChromiumBrowserNewContextRecordVideos    `json:"_recordVideos"`
}

type ChromiumBrowserNewContextRecordVideos

type ChromiumBrowserNewContextRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type ChromiumBrowserNewContextViewport

type ChromiumBrowserNewContextViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type ChromiumBrowserNewPageGeolocation

type ChromiumBrowserNewPageGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type ChromiumBrowserNewPageHttpCredentials

type ChromiumBrowserNewPageHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type ChromiumBrowserNewPageOptions

type ChromiumBrowserNewPageOptions struct {
	AcceptDownloads   *bool                                  `json:"acceptDownloads"`
	IgnoreHTTPSErrors *bool                                  `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                                  `json:"bypassCSP"`
	Viewport          *ChromiumBrowserNewPageViewport        `json:"viewport"`
	UserAgent         *string                                `json:"userAgent"`
	DeviceScaleFactor *int                                   `json:"deviceScaleFactor"`
	IsMobile          *bool                                  `json:"isMobile"`
	HasTouch          *bool                                  `json:"hasTouch"`
	JavaScriptEnabled *bool                                  `json:"javaScriptEnabled"`
	TimezoneId        *string                                `json:"timezoneId"`
	Geolocation       *ChromiumBrowserNewPageGeolocation     `json:"geolocation"`
	Locale            *string                                `json:"locale"`
	Permissions       []string                               `json:"permissions"`
	ExtraHTTPHeaders  map[string]string                      `json:"extraHTTPHeaders"`
	Offline           *bool                                  `json:"offline"`
	HttpCredentials   *ChromiumBrowserNewPageHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                                `json:"colorScheme"`
	Logger            interface{}                            `json:"logger"`
	RecordVideos      *ChromiumBrowserNewPageRecordVideos    `json:"_recordVideos"`
}

type ChromiumBrowserNewPageRecordVideos

type ChromiumBrowserNewPageRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type ChromiumBrowserNewPageViewport

type ChromiumBrowserNewPageViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type ChromiumBrowserStartTracingOptions

type ChromiumBrowserStartTracingOptions struct {
	Page        interface{} `json:"page"`
	Path        *string     `json:"path"`
	Screenshots *bool       `json:"screenshots"`
	Categories  []string    `json:"categories"`
}

type ChromiumCoverageStartCSSCoverageOptions

type ChromiumCoverageStartCSSCoverageOptions struct {
	ResetOnNavigation *bool `json:"resetOnNavigation"`
}

type ChromiumCoverageStartJSCoverageOptions

type ChromiumCoverageStartJSCoverageOptions struct {
	ResetOnNavigation      *bool `json:"resetOnNavigation"`
	ReportAnonymousScripts *bool `json:"reportAnonymousScripts"`
}

type Connection

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

func (*Connection) CallOnObjectWithKnownName

func (c *Connection) CallOnObjectWithKnownName(name string) (interface{}, error)

func (*Connection) Dispatch

func (c *Connection) Dispatch(msg *Message)

func (*Connection) SendMessageToServer

func (c *Connection) SendMessageToServer(guid string, method string, params interface{}) (interface{}, error)

func (*Connection) Start

func (c *Connection) Start() error

func (*Connection) Stop

func (c *Connection) Stop() error

type ConsoleMessage

type ConsoleMessage struct {
	ChannelOwner
}

func (*ConsoleMessage) Args

func (c *ConsoleMessage) Args() []*JSHandle

func (*ConsoleMessage) Location

func (c *ConsoleMessage) Location() ConsoleMessageLocation

func (*ConsoleMessage) String

func (c *ConsoleMessage) String() string

func (*ConsoleMessage) Text

func (c *ConsoleMessage) Text() string

func (*ConsoleMessage) Type

func (c *ConsoleMessage) Type() string

type ConsoleMessageLocation

type ConsoleMessageLocation struct {
	URL          string `json:"url"`
	LineNumber   int    `json:"lineNumber"`
	ColumnNumber int    `json:"columnNumber"`
}

type DeviceDescriptor

type DeviceDescriptor struct {
	UserAgent          string                     `json:"userAgent"`
	Viewport           *BrowserNewContextViewport `json:"viewport"`
	DeviceScaleFactor  int                        `json:"deviceScaleFactor"`
	IsMobile           bool                       `json:"isMobile"`
	HasTouch           bool                       `json:"hasTouch"`
	DefaultBrowserType string                     `json:"defaultBrowserType"`
}

type Dialog

type Dialog struct {
	ChannelOwner
}

func (*Dialog) Accept

func (d *Dialog) Accept(texts ...string) error

func (*Dialog) DefaultValue

func (d *Dialog) DefaultValue() string

func (*Dialog) Dismiss

func (d *Dialog) Dismiss() error

func (*Dialog) Message

func (d *Dialog) Message() string

func (*Dialog) Type

func (d *Dialog) Type() string

type Download

type Download struct {
	ChannelOwner
}

func (*Download) Delete

func (d *Download) Delete() error

func (*Download) Failure

func (d *Download) Failure() error

func (*Download) Path

func (d *Download) Path() (string, error)

func (*Download) SaveAs

func (d *Download) SaveAs(path string) error

func (*Download) String

func (d *Download) String() string

func (*Download) SuggestedFilename

func (d *Download) SuggestedFilename() string

func (*Download) URL

func (d *Download) URL() string

type ElementHandle

type ElementHandle struct {
	JSHandle
}

func (*ElementHandle) AsElement

func (e *ElementHandle) AsElement() *ElementHandle

func (*ElementHandle) BoundingBox

func (e *ElementHandle) BoundingBox() (*Rect, error)

func (*ElementHandle) Check

func (e *ElementHandle) Check(options ...ElementHandleCheckOptions) error

func (*ElementHandle) Click

func (e *ElementHandle) Click(options ...ElementHandleClickOptions) error

func (*ElementHandle) ContentFrame

func (e *ElementHandle) ContentFrame() (*Frame, error)

func (*ElementHandle) DblClick

func (e *ElementHandle) DblClick(options ...ElementHandleDblclickOptions) error

func (*ElementHandle) DispatchEvent

func (e *ElementHandle) DispatchEvent(typ string, initObjects ...interface{}) error

func (*ElementHandle) EvaluateOnSelector

func (e *ElementHandle) EvaluateOnSelector(selector string, expression string, options ...interface{}) (interface{}, error)

func (*ElementHandle) EvaluateOnSelectorAll

func (e *ElementHandle) EvaluateOnSelectorAll(selector string, expression string, options ...interface{}) (interface{}, error)

func (*ElementHandle) Fill

func (e *ElementHandle) Fill(value string, options ...ElementHandleFillOptions) error

func (*ElementHandle) Focus

func (e *ElementHandle) Focus() error

func (*ElementHandle) GetAttribute

func (e *ElementHandle) GetAttribute(name string) (string, error)

func (*ElementHandle) Hover

func (e *ElementHandle) Hover(options ...ElementHandleHoverOptions) error

func (*ElementHandle) InnerHTML

func (e *ElementHandle) InnerHTML() (string, error)

func (*ElementHandle) InnerText

func (e *ElementHandle) InnerText() (string, error)

func (*ElementHandle) OwnerFrame

func (e *ElementHandle) OwnerFrame() (*Frame, error)

func (*ElementHandle) Press

func (e *ElementHandle) Press(options ...ElementHandlePressOptions) error

func (*ElementHandle) QuerySelector

func (e *ElementHandle) QuerySelector(selector string) (*ElementHandle, error)

func (*ElementHandle) QuerySelectorAll

func (e *ElementHandle) QuerySelectorAll(selector string) ([]*ElementHandle, error)

func (*ElementHandle) Screenshot

func (e *ElementHandle) Screenshot(options ...ElementHandleScreenshotOptions) ([]byte, error)

func (*ElementHandle) ScrollIntoViewIfNeeded

func (e *ElementHandle) ScrollIntoViewIfNeeded(options ...ElementHandleScrollIntoViewIfNeededOptions) error

func (*ElementHandle) SelectText

func (e *ElementHandle) SelectText(options ...ElementHandleSelectTextOptions) error

func (*ElementHandle) SetInputFiles

func (e *ElementHandle) SetInputFiles(files []InputFile, options ...ElementHandleSetInputFilesOptions) error

func (*ElementHandle) TextContent

func (e *ElementHandle) TextContent() (string, error)

func (*ElementHandle) Type

func (e *ElementHandle) Type(value string, options ...ElementHandleTypeOptions) error

func (*ElementHandle) Uncheck

func (e *ElementHandle) Uncheck(options ...ElementHandleUncheckOptions) error

type ElementHandleCheckOptions

type ElementHandleCheckOptions struct {
	Force       *bool `json:"force"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type ElementHandleClickOptions

type ElementHandleClickOptions struct {
	Button      *string                     `json:"button"`
	ClickCount  *int                        `json:"clickCount"`
	Delay       *int                        `json:"delay"`
	Position    *ElementHandleClickPosition `json:"position"`
	Modifiers   interface{}                 `json:"modifiers"`
	Force       *bool                       `json:"force"`
	NoWaitAfter *bool                       `json:"noWaitAfter"`
	Timeout     *int                        `json:"timeout"`
}

type ElementHandleClickPosition

type ElementHandleClickPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type ElementHandleDblclickOptions

type ElementHandleDblclickOptions struct {
	Button      *string                        `json:"button"`
	Delay       *int                           `json:"delay"`
	Position    *ElementHandleDblclickPosition `json:"position"`
	Modifiers   interface{}                    `json:"modifiers"`
	Force       *bool                          `json:"force"`
	NoWaitAfter *bool                          `json:"noWaitAfter"`
	Timeout     *int                           `json:"timeout"`
}

type ElementHandleDblclickPosition

type ElementHandleDblclickPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type ElementHandleFillOptions

type ElementHandleFillOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type ElementHandleHoverOptions

type ElementHandleHoverOptions struct {
	Position  *ElementHandleHoverPosition `json:"position"`
	Modifiers interface{}                 `json:"modifiers"`
	Force     *bool                       `json:"force"`
	Timeout   *int                        `json:"timeout"`
}

type ElementHandleHoverPosition

type ElementHandleHoverPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type ElementHandlePressOptions

type ElementHandlePressOptions struct {
	Delay       *int  `json:"delay"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type ElementHandleScreenshotOptions

type ElementHandleScreenshotOptions struct {
	Path           *string `json:"path"`
	Type           *string `json:"type"`
	Quality        *int    `json:"quality"`
	OmitBackground *bool   `json:"omitBackground"`
	Timeout        *int    `json:"timeout"`
}

type ElementHandleScrollIntoViewIfNeededOptions

type ElementHandleScrollIntoViewIfNeededOptions struct {
	Timeout *int `json:"timeout"`
}

type ElementHandleSelectOptionOptions

type ElementHandleSelectOptionOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type ElementHandleSelectTextOptions

type ElementHandleSelectTextOptions struct {
	Timeout *int `json:"timeout"`
}

type ElementHandleSetInputFilesOptions

type ElementHandleSetInputFilesOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type ElementHandleTypeOptions

type ElementHandleTypeOptions struct {
	Delay       *int  `json:"delay"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type ElementHandleUncheckOptions

type ElementHandleUncheckOptions struct {
	Force       *bool `json:"force"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type ElementHandleWaitForElementStateOptions

type ElementHandleWaitForElementStateOptions struct {
	Timeout *int `json:"timeout"`
}

type ElementHandleWaitForSelectorOptions

type ElementHandleWaitForSelectorOptions struct {
	State   *string `json:"state"`
	Timeout *int    `json:"timeout"`
}

type Error

type Error struct {
	Message string
	Stack   string
}

func (*Error) Error

func (e *Error) Error() string

type EventEmitter

type EventEmitter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*EventEmitter) Emit

func (e *EventEmitter) Emit(name string, payload ...interface{})

func (*EventEmitter) ListenerCount

func (e *EventEmitter) ListenerCount(name string) int

func (*EventEmitter) On

func (e *EventEmitter) On(name string, handler interface{})

func (*EventEmitter) Once

func (e *EventEmitter) Once(name string, handler interface{})

func (*EventEmitter) RemoveListener

func (e *EventEmitter) RemoveListener(name string, handler interface{})

type FileChooser

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

func (*FileChooser) Element

func (f *FileChooser) Element() *ElementHandle

func (*FileChooser) IsMultiple

func (f *FileChooser) IsMultiple() bool

func (*FileChooser) Page

func (f *FileChooser) Page() *Page

func (*FileChooser) SetFiles

func (e *FileChooser) SetFiles(files []InputFile, options ...ElementHandleSetInputFilesOptions) error

type FileChooserSetFilesOptions

type FileChooserSetFilesOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type FirefoxBrowserNewContextGeolocation

type FirefoxBrowserNewContextGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type FirefoxBrowserNewContextHttpCredentials

type FirefoxBrowserNewContextHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type FirefoxBrowserNewContextOptions

type FirefoxBrowserNewContextOptions struct {
	AcceptDownloads   *bool                                    `json:"acceptDownloads"`
	IgnoreHTTPSErrors *bool                                    `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                                    `json:"bypassCSP"`
	Viewport          *FirefoxBrowserNewContextViewport        `json:"viewport"`
	UserAgent         *string                                  `json:"userAgent"`
	DeviceScaleFactor *int                                     `json:"deviceScaleFactor"`
	IsMobile          *bool                                    `json:"isMobile"`
	HasTouch          *bool                                    `json:"hasTouch"`
	JavaScriptEnabled *bool                                    `json:"javaScriptEnabled"`
	TimezoneId        *string                                  `json:"timezoneId"`
	Geolocation       *FirefoxBrowserNewContextGeolocation     `json:"geolocation"`
	Locale            *string                                  `json:"locale"`
	Permissions       []string                                 `json:"permissions"`
	ExtraHTTPHeaders  map[string]string                        `json:"extraHTTPHeaders"`
	Offline           *bool                                    `json:"offline"`
	HttpCredentials   *FirefoxBrowserNewContextHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                                  `json:"colorScheme"`
	Logger            interface{}                              `json:"logger"`
	RecordVideos      *FirefoxBrowserNewContextRecordVideos    `json:"_recordVideos"`
}

type FirefoxBrowserNewContextRecordVideos

type FirefoxBrowserNewContextRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type FirefoxBrowserNewContextViewport

type FirefoxBrowserNewContextViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type FirefoxBrowserNewPageGeolocation

type FirefoxBrowserNewPageGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type FirefoxBrowserNewPageHttpCredentials

type FirefoxBrowserNewPageHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type FirefoxBrowserNewPageOptions

type FirefoxBrowserNewPageOptions struct {
	AcceptDownloads   *bool                                 `json:"acceptDownloads"`
	IgnoreHTTPSErrors *bool                                 `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                                 `json:"bypassCSP"`
	Viewport          *FirefoxBrowserNewPageViewport        `json:"viewport"`
	UserAgent         *string                               `json:"userAgent"`
	DeviceScaleFactor *int                                  `json:"deviceScaleFactor"`
	IsMobile          *bool                                 `json:"isMobile"`
	HasTouch          *bool                                 `json:"hasTouch"`
	JavaScriptEnabled *bool                                 `json:"javaScriptEnabled"`
	TimezoneId        *string                               `json:"timezoneId"`
	Geolocation       *FirefoxBrowserNewPageGeolocation     `json:"geolocation"`
	Locale            *string                               `json:"locale"`
	Permissions       []string                              `json:"permissions"`
	ExtraHTTPHeaders  map[string]string                     `json:"extraHTTPHeaders"`
	Offline           *bool                                 `json:"offline"`
	HttpCredentials   *FirefoxBrowserNewPageHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                               `json:"colorScheme"`
	Logger            interface{}                           `json:"logger"`
	RecordVideos      *FirefoxBrowserNewPageRecordVideos    `json:"_recordVideos"`
}

type FirefoxBrowserNewPageRecordVideos

type FirefoxBrowserNewPageRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type FirefoxBrowserNewPageViewport

type FirefoxBrowserNewPageViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type Frame

type Frame struct {
	ChannelOwner
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Frame) AddScriptTag

func (f *Frame) AddScriptTag(options PageAddScriptTagOptions) (*ElementHandle, error)

func (*Frame) AddStyleTag

func (f *Frame) AddStyleTag(options PageAddStyleTagOptions) (*ElementHandle, error)

func (*Frame) Check

func (f *Frame) Check(selector string, options ...FrameCheckOptions) error

func (*Frame) ChildFrames

func (f *Frame) ChildFrames() []*Frame

func (*Frame) Click

func (f *Frame) Click(selector string, options ...PageClickOptions) error

func (*Frame) Content

func (f *Frame) Content() (string, error)

func (*Frame) DblClick

func (f *Frame) DblClick(selector string, options ...FrameDblclickOptions) error

func (*Frame) DispatchEvent

func (f *Frame) DispatchEvent(selector, typ string, options ...PageDispatchEventOptions) error

func (*Frame) Evaluate

func (f *Frame) Evaluate(expression string, options ...interface{}) (interface{}, error)

func (*Frame) EvaluateHandle

func (f *Frame) EvaluateHandle(expression string, options ...interface{}) (interface{}, error)

func (*Frame) EvaluateOnSelector

func (f *Frame) EvaluateOnSelector(selector string, expression string, options ...interface{}) (interface{}, error)

func (*Frame) EvaluateOnSelectorAll

func (f *Frame) EvaluateOnSelectorAll(selector string, expression string, options ...interface{}) (interface{}, error)

func (*Frame) Fill

func (f *Frame) Fill(selector string, value string, options ...FrameFillOptions) error

func (*Frame) Focus

func (f *Frame) Focus(selector string, options ...FrameFocusOptions) error

func (*Frame) FrameElement

func (f *Frame) FrameElement() (*ElementHandle, error)

func (*Frame) GetAttribute

func (f *Frame) GetAttribute(selector string, name string, options ...PageGetAttributeOptions) (string, error)

func (*Frame) Goto

func (f *Frame) Goto(url string, options ...PageGotoOptions) (*Response, error)

func (*Frame) Hover

func (f *Frame) Hover(selector string, options ...PageHoverOptions) error

func (*Frame) InnerHTML

func (f *Frame) InnerHTML(selector string, options ...PageInnerHTMLOptions) (string, error)

func (*Frame) InnerText

func (f *Frame) InnerText(selector string, options ...PageInnerTextOptions) (string, error)

func (*Frame) IsDetached

func (f *Frame) IsDetached() bool

func (*Frame) Name

func (f *Frame) Name() string

func (*Frame) Page

func (f *Frame) Page() *Page

func (*Frame) ParentFrame

func (f *Frame) ParentFrame() *Frame

func (*Frame) Press

func (f *Frame) Press(selector, key string, options ...PagePressOptions) error

func (*Frame) QuerySelector

func (f *Frame) QuerySelector(selector string) (*ElementHandle, error)

func (*Frame) QuerySelectorAll

func (f *Frame) QuerySelectorAll(selector string) ([]*ElementHandle, error)

func (*Frame) SetContent

func (f *Frame) SetContent(content string, options ...PageSetContentOptions) error

func (*Frame) SetInputFiles

func (e *Frame) SetInputFiles(selector string, files []InputFile, options ...FrameSetInputFilesOptions) error

func (*Frame) TextContent

func (f *Frame) TextContent(selector string, options ...FrameTextContentOptions) (string, error)

func (*Frame) Title

func (f *Frame) Title() (string, error)

func (*Frame) Type

func (f *Frame) Type(selector, text string, options ...PageTypeOptions) error

func (*Frame) URL

func (f *Frame) URL() string

func (*Frame) Uncheck

func (f *Frame) Uncheck(selector string, options ...FrameUncheckOptions) error

func (*Frame) WaitForEvent

func (f *Frame) WaitForEvent(event string, predicate ...interface{}) interface{}

func (*Frame) WaitForEventCh

func (f *Frame) WaitForEventCh(event string, predicate ...interface{}) <-chan interface{}

func (*Frame) WaitForFunction

func (f *Frame) WaitForFunction(expression string, options ...FrameWaitForFunctionOptions) (*JSHandle, error)

func (*Frame) WaitForLoadState

func (f *Frame) WaitForLoadState(given ...string)

func (*Frame) WaitForNavigation

func (f *Frame) WaitForNavigation(options ...PageWaitForNavigationOptions) (*Response, error)

func (*Frame) WaitForSelector

func (f *Frame) WaitForSelector(selector string, options ...PageWaitForSelectorOptions) (*ElementHandle, error)

func (*Frame) WaitForTimeout

func (f *Frame) WaitForTimeout(timeout int)

type FrameAddScriptTagOptions

type FrameAddScriptTagOptions struct {
	Url     *string `json:"url"`
	Path    *string `json:"path"`
	Content *string `json:"content"`
	Type    *string `json:"type"`
}

type FrameAddStyleTagOptions

type FrameAddStyleTagOptions struct {
	Url     *string `json:"url"`
	Path    *string `json:"path"`
	Content *string `json:"content"`
}

type FrameCheckOptions

type FrameCheckOptions struct {
	Force       *bool `json:"force"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type FrameClickOptions

type FrameClickOptions struct {
	Button      *string             `json:"button"`
	ClickCount  *int                `json:"clickCount"`
	Delay       *int                `json:"delay"`
	Position    *FrameClickPosition `json:"position"`
	Modifiers   interface{}         `json:"modifiers"`
	Force       *bool               `json:"force"`
	NoWaitAfter *bool               `json:"noWaitAfter"`
	Timeout     *int                `json:"timeout"`
}

type FrameClickPosition

type FrameClickPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type FrameDblclickOptions

type FrameDblclickOptions struct {
	Button      *string                `json:"button"`
	Delay       *int                   `json:"delay"`
	Position    *FrameDblclickPosition `json:"position"`
	Modifiers   interface{}            `json:"modifiers"`
	Force       *bool                  `json:"force"`
	NoWaitAfter *bool                  `json:"noWaitAfter"`
	Timeout     *int                   `json:"timeout"`
}

type FrameDblclickPosition

type FrameDblclickPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type FrameDispatchEventOptions

type FrameDispatchEventOptions struct {
	EventInit interface{} `json:"eventInit"`
	Timeout   *int        `json:"timeout"`
}

type FrameFillOptions

type FrameFillOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type FrameFocusOptions

type FrameFocusOptions struct {
	Timeout *int `json:"timeout"`
}

type FrameGetAttributeOptions

type FrameGetAttributeOptions struct {
	Timeout *int `json:"timeout"`
}

type FrameGotoOptions

type FrameGotoOptions struct {
	Timeout   *int    `json:"timeout"`
	WaitUntil *string `json:"waitUntil"`
	Referer   *string `json:"referer"`
}

type FrameHoverOptions

type FrameHoverOptions struct {
	Position  *FrameHoverPosition `json:"position"`
	Modifiers interface{}         `json:"modifiers"`
	Force     *bool               `json:"force"`
	Timeout   *int                `json:"timeout"`
}

type FrameHoverPosition

type FrameHoverPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type FrameInnerHTMLOptions

type FrameInnerHTMLOptions struct {
	Timeout *int `json:"timeout"`
}

type FrameInnerTextOptions

type FrameInnerTextOptions struct {
	Timeout *int `json:"timeout"`
}

type FramePressOptions

type FramePressOptions struct {
	Delay       *int  `json:"delay"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type FrameSelectOptionOptions

type FrameSelectOptionOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type FrameSetContentOptions

type FrameSetContentOptions struct {
	Timeout   *int    `json:"timeout"`
	WaitUntil *string `json:"waitUntil"`
}

type FrameSetInputFilesOptions

type FrameSetInputFilesOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type FrameTextContentOptions

type FrameTextContentOptions struct {
	Timeout *int `json:"timeout"`
}

type FrameTypeOptions

type FrameTypeOptions struct {
	Delay       *int  `json:"delay"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type FrameUncheckOptions

type FrameUncheckOptions struct {
	Force       *bool `json:"force"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type FrameWaitForFunctionOptions

type FrameWaitForFunctionOptions struct {
	Arg     interface{} `json:"arg"`
	Polling interface{} `json:"polling"`
	Timeout *int        `json:"timeout"`
}

type FrameWaitForLoadStateOptions

type FrameWaitForLoadStateOptions struct {
	State   *string `json:"state"`
	Timeout *int    `json:"timeout"`
}

type FrameWaitForNavigationOptions

type FrameWaitForNavigationOptions struct {
	Timeout   *int        `json:"timeout"`
	Url       interface{} `json:"url"`
	WaitUntil *string     `json:"waitUntil"`
}

type FrameWaitForSelectorOptions

type FrameWaitForSelectorOptions struct {
	State   *string `json:"state"`
	Timeout *int    `json:"timeout"`
}

type InputFile

type InputFile struct {
	Name     string
	MimeType string
	Buffer   []byte
}

type JSHandle

type JSHandle struct {
	ChannelOwner
	// contains filtered or unexported fields
}

func (*JSHandle) AsElement

func (j *JSHandle) AsElement() *ElementHandle

func (*JSHandle) Dispose

func (j *JSHandle) Dispose() error

func (*JSHandle) Evaluate

func (f *JSHandle) Evaluate(expression string, options ...interface{}) (interface{}, error)

func (*JSHandle) EvaluateHandle

func (f *JSHandle) EvaluateHandle(expression string, options ...interface{}) (interface{}, error)

func (*JSHandle) GetProperties

func (j *JSHandle) GetProperties() (map[string]*JSHandle, error)

func (*JSHandle) GetProperty

func (j *JSHandle) GetProperty(name string) (*JSHandle, error)

func (*JSHandle) JSONValue

func (j *JSHandle) JSONValue() (interface{}, error)

func (*JSHandle) String

func (j *JSHandle) String() string

type Keyboard

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

func (*Keyboard) Down

func (m *Keyboard) Down(key string) error

func (*Keyboard) InsertText

func (m *Keyboard) InsertText(text string) error

func (*Keyboard) Press

func (m *Keyboard) Press(key string, options ...KeyboardPressOptions) error

func (*Keyboard) Type

func (m *Keyboard) Type(text string, options ...KeyboardTypeOptions) error

func (*Keyboard) Up

func (m *Keyboard) Up(key string) error

type KeyboardPressOptions

type KeyboardPressOptions struct {
	Delay *int `json:"delay"`
}

type KeyboardTypeOptions

type KeyboardTypeOptions struct {
	Delay *int `json:"delay"`
}

type Message

type Message struct {
	ID     int                    `json:"id"`
	GUID   string                 `json:"guid"`
	Method string                 `json:"method"`
	Params map[string]interface{} `json:"params"`
	Result interface{}            `json:"result"`
	Error  *struct {
		Error errorPayload `json:"error"`
	} `json:"error"`
}

type Mouse

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

func (*Mouse) Click

func (m *Mouse) Click(x, y float64, options ...MouseClickOptions) error

func (*Mouse) DblClick

func (m *Mouse) DblClick(x, y float64, options ...MouseDblclickOptions) error

func (*Mouse) Down

func (m *Mouse) Down(options ...MouseDownOptions) error

func (*Mouse) Move

func (m *Mouse) Move(x float64, y float64, options ...MouseMoveOptions) error

func (*Mouse) Up

func (m *Mouse) Up(options ...MouseUpOptions) error

type MouseClickOptions

type MouseClickOptions struct {
	Button     *string `json:"button"`
	ClickCount *int    `json:"clickCount"`
	Delay      *int    `json:"delay"`
}

type MouseDblclickOptions

type MouseDblclickOptions struct {
	Button *string `json:"button"`
	Delay  *int    `json:"delay"`
}

type MouseDownOptions

type MouseDownOptions struct {
	Button     *string `json:"button"`
	ClickCount *int    `json:"clickCount"`
}

type MouseMoveOptions

type MouseMoveOptions struct {
	Steps *int `json:"steps"`
}

type MouseUpOptions

type MouseUpOptions struct {
	Button     *string `json:"button"`
	ClickCount *int    `json:"clickCount"`
}

type NetworkCookie

type NetworkCookie struct {
	Name     string `json:"name"`
	Value    string `json:"value"`
	Domain   string `json:"domain"`
	Path     string `json:"path"`
	Expires  int    `json:"expires"`
	HttpOnly bool   `json:"httpOnly"`
	Secure   bool   `json:"secure"`
	SameSite string `json:"sameSite"`
}

type Page

type Page struct {
	ChannelOwner

	Mouse    *Mouse
	Keyboard *Keyboard
	// contains filtered or unexported fields
}

func (*Page) AddInitScript

func (b *Page) AddInitScript(options BrowserContextAddInitScriptOptions) error

func (*Page) AddScriptTag

func (p *Page) AddScriptTag(options PageAddScriptTagOptions) (*ElementHandle, error)

func (*Page) AddStyleTag

func (p *Page) AddStyleTag(options PageAddStyleTagOptions) (*ElementHandle, error)

func (*Page) BringToFront

func (p *Page) BringToFront() error

func (*Page) Check

func (p *Page) Check(selector string, options ...FrameCheckOptions) error

func (*Page) Click

func (p *Page) Click(selector string, options ...PageClickOptions) error

func (*Page) Close

func (p *Page) Close(options ...PageCloseOptions) error

func (*Page) Content

func (p *Page) Content() (string, error)

func (*Page) Context

func (p *Page) Context() *BrowserContext

func (*Page) DblClick

func (p *Page) DblClick(expression string, options ...FrameDblclickOptions) error

func (*Page) DispatchEvent

func (p *Page) DispatchEvent(selector string, typ string, options ...PageDispatchEventOptions) error

func (*Page) EmulateMedia

func (p *Page) EmulateMedia(options ...PageEmulateMediaOptions) error

func (*Page) Evaluate

func (p *Page) Evaluate(expression string, options ...interface{}) (interface{}, error)

func (*Page) EvaluateHandle

func (p *Page) EvaluateHandle(expression string, options ...interface{}) (interface{}, error)

func (*Page) EvaluateOnSelector

func (p *Page) EvaluateOnSelector(selector string, expression string, options ...interface{}) (interface{}, error)

func (*Page) EvaluateOnSelectorAll

func (p *Page) EvaluateOnSelectorAll(selector string, expression string, options ...interface{}) (interface{}, error)

func (*Page) ExpectConsoleMessage

func (p *Page) ExpectConsoleMessage(cb func() error) (*ConsoleMessage, error)

func (*Page) ExpectDownload

func (p *Page) ExpectDownload(cb func() error) (*Download, error)

func (*Page) ExpectEvent

func (p *Page) ExpectEvent(event string, cb func() error, predicates ...interface{}) (interface{}, error)

func (*Page) ExpectFileChooser

func (p *Page) ExpectFileChooser(cb func() error) (*FileChooser, error)

func (*Page) ExpectLoadState

func (p *Page) ExpectLoadState(state string, cb func() error) (*ConsoleMessage, error)

func (*Page) ExpectNavigation

func (p *Page) ExpectNavigation(cb func() error, options ...PageWaitForNavigationOptions) (*Response, error)

func (*Page) ExpectPopup

func (p *Page) ExpectPopup(cb func() error) (*Page, error)

func (*Page) ExpectRequest

func (p *Page) ExpectRequest(url interface{}, cb func() error, options ...interface{}) (*Request, error)

func (*Page) ExpectResponse

func (p *Page) ExpectResponse(url interface{}, cb func() error, options ...interface{}) (*Response, error)

func (*Page) ExpectWorker

func (p *Page) ExpectWorker(cb func() error) (*Worker, error)

func (*Page) ExpectedDialog

func (p *Page) ExpectedDialog(cb func() error) (*Download, error)

func (*Page) Fill

func (p *Page) Fill(selector, text string, options ...FrameFillOptions) error

func (*Page) Focus

func (p *Page) Focus(expression string, options ...FrameFocusOptions) error

func (*Page) Frames

func (p *Page) Frames() []*Frame

func (*Page) GetAttribute

func (p *Page) GetAttribute(selector string, name string, options ...PageGetAttributeOptions) (string, error)

func (*Page) GoBack

func (p *Page) GoBack(options ...PageGoBackOptions) (*Response, error)

func (*Page) GoForward

func (p *Page) GoForward(options ...PageGoForwardOptions) (*Response, error)

func (*Page) Goto

func (p *Page) Goto(url string, options ...PageGotoOptions) (*Response, error)

func (*Page) Hover

func (p *Page) Hover(selector string, options ...PageHoverOptions) error

func (*Page) InnerHTML

func (p *Page) InnerHTML(selector string, options ...PageInnerHTMLOptions) (string, error)

func (*Page) InnerText

func (p *Page) InnerText(selector string, options ...PageInnerTextOptions) (string, error)

func (*Page) Isclosed

func (p *Page) Isclosed() bool

func (*Page) MainFrame

func (p *Page) MainFrame() *Frame

func (*Page) Opener

func (p *Page) Opener() (*Page, error)

func (*Page) PDF

func (p *Page) PDF(options ...PagePdfOptions) ([]byte, error)

func (*Page) Press

func (p *Page) Press(selector, key string, options ...PagePressOptions) error

func (*Page) QuerySelector

func (p *Page) QuerySelector(selector string) (*ElementHandle, error)

func (*Page) QuerySelectorAll

func (p *Page) QuerySelectorAll(selector string) ([]*ElementHandle, error)

func (*Page) Reload

func (p *Page) Reload(options ...PageReloadOptions) (*Response, error)

func (*Page) Route

func (p *Page) Route(url interface{}, handler routeHandler) error

func (*Page) Screenshot

func (p *Page) Screenshot(options ...PageScreenshotOptions) ([]byte, error)

func (*Page) SetContent

func (p *Page) SetContent(content string, options ...PageSetContentOptions) error

func (*Page) SetDefaultNavigationTimeout

func (p *Page) SetDefaultNavigationTimeout(timeout int)

func (*Page) SetDefaultTimeout

func (p *Page) SetDefaultTimeout(timeout int)

func (*Page) SetExtraHTTPHeaders

func (p *Page) SetExtraHTTPHeaders(headers map[string]string) error

func (*Page) SetInputFiles

func (p *Page) SetInputFiles(selector string, files []InputFile, options ...FrameSetInputFilesOptions) error

func (*Page) SetViewportSize

func (p *Page) SetViewportSize(width, height int) error

func (*Page) TextContent

func (p *Page) TextContent(selector string, options ...FrameTextContentOptions) (string, error)

func (*Page) Title

func (p *Page) Title() (string, error)

func (*Page) Type

func (p *Page) Type(selector, text string, options ...PageTypeOptions) error

func (*Page) URL

func (p *Page) URL() string

func (*Page) Uncheck

func (p *Page) Uncheck(selector string, options ...FrameUncheckOptions) error

func (*Page) ViewportSize

func (p *Page) ViewportSize() ViewportSize

func (*Page) WaitForEvent

func (p *Page) WaitForEvent(event string, predicate ...interface{}) interface{}

func (*Page) WaitForFunction

func (p *Page) WaitForFunction(expression string, options ...FrameWaitForFunctionOptions) (*JSHandle, error)

func (*Page) WaitForLoadState

func (p *Page) WaitForLoadState(state ...string)

func (*Page) WaitForNavigation

func (p *Page) WaitForNavigation(options ...PageWaitForNavigationOptions) (*Response, error)

func (*Page) WaitForRequest

func (p *Page) WaitForRequest(url interface{}, options ...interface{}) *Request

func (*Page) WaitForResponse

func (p *Page) WaitForResponse(url interface{}, options ...interface{}) *Response

func (*Page) WaitForSelector

func (p *Page) WaitForSelector(selector string, options ...PageWaitForSelectorOptions) (*ElementHandle, error)

func (*Page) WaitForTimeout

func (p *Page) WaitForTimeout(timeout int)

func (*Page) Workers

func (p *Page) Workers() []*Worker

type PageAddScriptTagOptions

type PageAddScriptTagOptions struct {
	Url     *string `json:"url"`
	Path    *string `json:"path"`
	Content *string `json:"content"`
	Type    *string `json:"type"`
}

type PageAddStyleTagOptions

type PageAddStyleTagOptions struct {
	Url     *string `json:"url"`
	Path    *string `json:"path"`
	Content *string `json:"content"`
}

type PageCheckOptions

type PageCheckOptions struct {
	Force       *bool `json:"force"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type PageClickOptions

type PageClickOptions struct {
	Button      *string            `json:"button"`
	ClickCount  *int               `json:"clickCount"`
	Delay       *int               `json:"delay"`
	Position    *PageClickPosition `json:"position"`
	Modifiers   interface{}        `json:"modifiers"`
	Force       *bool              `json:"force"`
	NoWaitAfter *bool              `json:"noWaitAfter"`
	Timeout     *int               `json:"timeout"`
}

type PageClickPosition

type PageClickPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type PageCloseOptions

type PageCloseOptions struct {
	RunBeforeUnload *bool `json:"runBeforeUnload"`
}

type PageDblclickOptions

type PageDblclickOptions struct {
	Button      *string               `json:"button"`
	Delay       *int                  `json:"delay"`
	Position    *PageDblclickPosition `json:"position"`
	Modifiers   interface{}           `json:"modifiers"`
	Force       *bool                 `json:"force"`
	NoWaitAfter *bool                 `json:"noWaitAfter"`
	Timeout     *int                  `json:"timeout"`
}

type PageDblclickPosition

type PageDblclickPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type PageDispatchEventOptions

type PageDispatchEventOptions struct {
	EventInit interface{} `json:"eventInit"`
	Timeout   *int        `json:"timeout"`
}

type PageEmulateMediaOptions

type PageEmulateMediaOptions struct {
	Media       interface{} `json:"media"`
	ColorScheme interface{} `json:"colorScheme"`
}

type PageFillOptions

type PageFillOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type PageFocusOptions

type PageFocusOptions struct {
	Timeout *int `json:"timeout"`
}

type PageFrameOptions

type PageFrameOptions struct {
	Name *string     `json:"name"`
	Url  interface{} `json:"url"`
}

type PageGetAttributeOptions

type PageGetAttributeOptions struct {
	Timeout *int `json:"timeout"`
}

type PageGoBackOptions

type PageGoBackOptions struct {
	Timeout   *int    `json:"timeout"`
	WaitUntil *string `json:"waitUntil"`
}

type PageGoForwardOptions

type PageGoForwardOptions struct {
	Timeout   *int    `json:"timeout"`
	WaitUntil *string `json:"waitUntil"`
}

type PageGotoOptions

type PageGotoOptions struct {
	Timeout   *int    `json:"timeout"`
	WaitUntil *string `json:"waitUntil"`
	Referer   *string `json:"referer"`
}

type PageHoverOptions

type PageHoverOptions struct {
	Position  *PageHoverPosition `json:"position"`
	Modifiers interface{}        `json:"modifiers"`
	Force     *bool              `json:"force"`
	Timeout   *int               `json:"timeout"`
}

type PageHoverPosition

type PageHoverPosition struct {
	X *int `json:"x"`
	Y *int `json:"y"`
}

type PageInnerHTMLOptions

type PageInnerHTMLOptions struct {
	Timeout *int `json:"timeout"`
}

type PageInnerTextOptions

type PageInnerTextOptions struct {
	Timeout *int `json:"timeout"`
}

type PagePdfMargin

type PagePdfMargin struct {
	Top    interface{} `json:"top"`
	Right  interface{} `json:"right"`
	Bottom interface{} `json:"bottom"`
	Left   interface{} `json:"left"`
}

type PagePdfOptions

type PagePdfOptions struct {
	Path                *string        `json:"path"`
	Scale               *int           `json:"scale"`
	DisplayHeaderFooter *bool          `json:"displayHeaderFooter"`
	HeaderTemplate      *string        `json:"headerTemplate"`
	FooterTemplate      *string        `json:"footerTemplate"`
	PrintBackground     *bool          `json:"printBackground"`
	Landscape           *bool          `json:"landscape"`
	PageRanges          *string        `json:"pageRanges"`
	Format              *string        `json:"format"`
	Width               interface{}    `json:"width"`
	Height              interface{}    `json:"height"`
	Margin              *PagePdfMargin `json:"margin"`
	PreferCSSPageSize   *bool          `json:"preferCSSPageSize"`
}

type PagePressOptions

type PagePressOptions struct {
	Delay       *int  `json:"delay"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type PageReloadOptions

type PageReloadOptions struct {
	Timeout   *int    `json:"timeout"`
	WaitUntil *string `json:"waitUntil"`
}

type PageScreenshotClip

type PageScreenshotClip struct {
	X      *int `json:"x"`
	Y      *int `json:"y"`
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type PageScreenshotOptions

type PageScreenshotOptions struct {
	Path           *string             `json:"path"`
	Type           *string             `json:"type"`
	Quality        *int                `json:"quality"`
	FullPage       *bool               `json:"fullPage"`
	Clip           *PageScreenshotClip `json:"clip"`
	OmitBackground *bool               `json:"omitBackground"`
	Timeout        *int                `json:"timeout"`
}

type PageSelectOptionOptions

type PageSelectOptionOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type PageSetContentOptions

type PageSetContentOptions struct {
	Timeout   *int    `json:"timeout"`
	WaitUntil *string `json:"waitUntil"`
}

type PageSetInputFilesOptions

type PageSetInputFilesOptions struct {
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type PageTextContentOptions

type PageTextContentOptions struct {
	Timeout *int `json:"timeout"`
}

type PageTypeOptions

type PageTypeOptions struct {
	Delay       *int  `json:"delay"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type PageUncheckOptions

type PageUncheckOptions struct {
	Force       *bool `json:"force"`
	NoWaitAfter *bool `json:"noWaitAfter"`
	Timeout     *int  `json:"timeout"`
}

type PageWaitForEventOptions

type PageWaitForEventOptions struct {
	Predicate interface{} `json:"predicate"`
	Timeout   *int        `json:"timeout"`
}

type PageWaitForFunctionOptions

type PageWaitForFunctionOptions struct {
	Arg     interface{} `json:"arg"`
	Polling interface{} `json:"polling"`
	Timeout *int        `json:"timeout"`
}

type PageWaitForLoadStateOptions

type PageWaitForLoadStateOptions struct {
	State   *string `json:"state"`
	Timeout *int    `json:"timeout"`
}

type PageWaitForNavigationOptions

type PageWaitForNavigationOptions struct {
	Timeout   *int        `json:"timeout"`
	Url       interface{} `json:"url"`
	WaitUntil *string     `json:"waitUntil"`
}

type PageWaitForRequestOptions

type PageWaitForRequestOptions struct {
	Timeout *int `json:"timeout"`
}

type PageWaitForResponseOptions

type PageWaitForResponseOptions struct {
	Timeout *int `json:"timeout"`
}

type PageWaitForSelectorOptions

type PageWaitForSelectorOptions struct {
	State   *string `json:"state"`
	Timeout *int    `json:"timeout"`
}

type Playwright

type Playwright struct {
	ChannelOwner
	Chromium *BrowserType
	Firefox  *BrowserType
	WebKit   *BrowserType
	Devices  map[string]*DeviceDescriptor
}

func Run

func Run() (*Playwright, error)
Example

Code:

package main

import (
	"log"

	"github.com/mxschmitt/playwright-go"
)

func assertErrorToNil(message string, err error) {
	if err != nil {
		log.Fatalf(message, err)
	}
}

func main() {
	pw, err := playwright.Run()
	assertErrorToNil("could not launch playwright: %w", err)
	browser, err := pw.Chromium.Launch()
	assertErrorToNil("could not launch Chromium: %w", err)
	context, err := browser.NewContext()
	assertErrorToNil("could not create context: %w", err)
	page, err := context.NewPage()
	assertErrorToNil("could not create page: %w", err)
	_, err = page.Goto("http://whatsmyuseragent.org/")
	assertErrorToNil("could not goto: %w", err)
	_, err = page.Screenshot(playwright.PageScreenshotOptions{
		Path: playwright.String("foo.png"),
	})
	assertErrorToNil("could not create screenshot: %w", err)
	assertErrorToNil("could not close browser: %v", browser.Close())
	assertErrorToNil("could not stop Playwright: %v", pw.Stop())
}

func (*Playwright) Stop

func (p *Playwright) Stop() error

type Rect

type Rect struct {
	Width  int `json:"width"`
	Height int `json:"height"`
	X      int `json:"x"`
	Y      int `json:"y"`
}

type Request

type Request struct {
	ChannelOwner
	// contains filtered or unexported fields
}

func (*Request) Failure

func (r *Request) Failure() *RequestFailure

func (*Request) Frame

func (r *Request) Frame() *Frame

func (*Request) Headers

func (r *Request) Headers() map[string]string

func (*Request) IsNavigationRequest

func (r *Request) IsNavigationRequest() bool

func (*Request) Method

func (r *Request) Method() string

func (*Request) PostData

func (r *Request) PostData() (string, error)

func (*Request) PostDataBuffer

func (r *Request) PostDataBuffer() ([]byte, error)

func (*Request) PostDataJSON

func (r *Request) PostDataJSON(v interface{}) error

func (*Request) RedirectedFrom

func (r *Request) RedirectedFrom() *Request

func (*Request) RedirectedTo

func (r *Request) RedirectedTo() *Request

func (*Request) ResourceType

func (r *Request) ResourceType() string

func (*Request) Response

func (r *Request) Response() (*Response, error)

func (*Request) URL

func (r *Request) URL() string

type RequestFailure

type RequestFailure struct {
	ErrorText string
}

type Response

type Response struct {
	ChannelOwner
}

func (*Response) Body

func (r *Response) Body() ([]byte, error)

func (*Response) Finished

func (r *Response) Finished() error

func (*Response) Frame

func (r *Response) Frame() *Frame

func (*Response) Headers

func (r *Response) Headers() map[string]string

func (*Response) JSON

func (r *Response) JSON(v interface{}) error

func (*Response) Ok

func (r *Response) Ok() bool

func (*Response) Request

func (r *Response) Request() *Request

func (*Response) Status

func (r *Response) Status() int

func (*Response) StatusText

func (r *Response) StatusText() string

func (*Response) Text

func (r *Response) Text() (string, error)

func (*Response) URL

func (r *Response) URL() string

type Route

type Route struct {
	ChannelOwner
}

func (*Route) Abort

func (r *Route) Abort(errorCode *string) error

func (*Route) Continue

func (r *Route) Continue(options ...RouteContinueOptions) error

func (*Route) Fulfill

func (r *Route) Fulfill(options RouteFulfillOptions) error

func (*Route) Request

func (r *Route) Request() *Request

type RouteContinueOptions

type RouteContinueOptions struct {
	Method   *string           `json:"method"`
	PostData interface{}       `json:"postData"`
	Headers  map[string]string `json:"headers"`
}

type RouteFulfillOptions

type RouteFulfillOptions struct {
	Status      *int              `json:"status"`
	Headers     map[string]string `json:"headers"`
	Body        interface{}       `json:"body"`
	Path        *string           `json:"path"`
	ContentType *string           `json:"contentType"`
}

type SelectorsRegisterOptions

type SelectorsRegisterOptions struct {
	ContentScript *bool `json:"contentScript"`
}

type SetGeolocationOptions

type SetGeolocationOptions struct {
	Longitude int  `json:"longitude"`
	Latitude  int  `json:"latitude"`
	Accuracy  *int `json:"accuracy"`
}

type SetNetworkCookieParam

type SetNetworkCookieParam struct {
	Name     string  `json:"name"`
	Value    string  `json:"value"`
	URL      *string `json:"url"`
	Domain   *string `json:"domain"`
	Path     *string `json:"path"`
	Expires  *int    `json:"expires"`
	HttpOnly *bool   `json:"httpOnly"`
	Secure   *bool   `json:"secure"`
	SameSite *string `json:"sameSite"`
}

type TimeoutError

type TimeoutError Error

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

type Transport

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

func (*Transport) Send

func (t *Transport) Send(message map[string]interface{}) error

func (*Transport) Start

func (t *Transport) Start() error

func (*Transport) Stop

func (t *Transport) Stop() error

type ViewportSize

type ViewportSize struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

type WebKitBrowserNewContextGeolocation

type WebKitBrowserNewContextGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type WebKitBrowserNewContextHttpCredentials

type WebKitBrowserNewContextHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type WebKitBrowserNewContextOptions

type WebKitBrowserNewContextOptions struct {
	AcceptDownloads   *bool                                   `json:"acceptDownloads"`
	IgnoreHTTPSErrors *bool                                   `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                                   `json:"bypassCSP"`
	Viewport          *WebKitBrowserNewContextViewport        `json:"viewport"`
	UserAgent         *string                                 `json:"userAgent"`
	DeviceScaleFactor *int                                    `json:"deviceScaleFactor"`
	IsMobile          *bool                                   `json:"isMobile"`
	HasTouch          *bool                                   `json:"hasTouch"`
	JavaScriptEnabled *bool                                   `json:"javaScriptEnabled"`
	TimezoneId        *string                                 `json:"timezoneId"`
	Geolocation       *WebKitBrowserNewContextGeolocation     `json:"geolocation"`
	Locale            *string                                 `json:"locale"`
	Permissions       []string                                `json:"permissions"`
	ExtraHTTPHeaders  map[string]string                       `json:"extraHTTPHeaders"`
	Offline           *bool                                   `json:"offline"`
	HttpCredentials   *WebKitBrowserNewContextHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                                 `json:"colorScheme"`
	Logger            interface{}                             `json:"logger"`
	RecordVideos      *WebKitBrowserNewContextRecordVideos    `json:"_recordVideos"`
}

type WebKitBrowserNewContextRecordVideos

type WebKitBrowserNewContextRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type WebKitBrowserNewContextViewport

type WebKitBrowserNewContextViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type WebKitBrowserNewPageGeolocation

type WebKitBrowserNewPageGeolocation struct {
	Latitude  *float64 `json:"latitude"`
	Longitude *float64 `json:"longitude"`
	Accuracy  *int     `json:"accuracy"`
}

type WebKitBrowserNewPageHttpCredentials

type WebKitBrowserNewPageHttpCredentials struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

type WebKitBrowserNewPageOptions

type WebKitBrowserNewPageOptions struct {
	AcceptDownloads   *bool                                `json:"acceptDownloads"`
	IgnoreHTTPSErrors *bool                                `json:"ignoreHTTPSErrors"`
	BypassCSP         *bool                                `json:"bypassCSP"`
	Viewport          *WebKitBrowserNewPageViewport        `json:"viewport"`
	UserAgent         *string                              `json:"userAgent"`
	DeviceScaleFactor *int                                 `json:"deviceScaleFactor"`
	IsMobile          *bool                                `json:"isMobile"`
	HasTouch          *bool                                `json:"hasTouch"`
	JavaScriptEnabled *bool                                `json:"javaScriptEnabled"`
	TimezoneId        *string                              `json:"timezoneId"`
	Geolocation       *WebKitBrowserNewPageGeolocation     `json:"geolocation"`
	Locale            *string                              `json:"locale"`
	Permissions       []string                             `json:"permissions"`
	ExtraHTTPHeaders  map[string]string                    `json:"extraHTTPHeaders"`
	Offline           *bool                                `json:"offline"`
	HttpCredentials   *WebKitBrowserNewPageHttpCredentials `json:"httpCredentials"`
	ColorScheme       *string                              `json:"colorScheme"`
	Logger            interface{}                          `json:"logger"`
	RecordVideos      *WebKitBrowserNewPageRecordVideos    `json:"_recordVideos"`
}

type WebKitBrowserNewPageRecordVideos

type WebKitBrowserNewPageRecordVideos struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type WebKitBrowserNewPageViewport

type WebKitBrowserNewPageViewport struct {
	Width  *int `json:"width"`
	Height *int `json:"height"`
}

type Worker

type Worker struct {
	ChannelOwner
	// contains filtered or unexported fields
}

func (*Worker) Evaluate

func (w *Worker) Evaluate(expression string, options ...interface{}) (interface{}, error)

func (*Worker) EvaluateHandle

func (w *Worker) EvaluateHandle(expression string, options ...interface{}) (*JSHandle, error)

func (*Worker) URL

func (w *Worker) URL() string