Documentation
¶
Index ¶
- Constants
- Variables
- func IsExitRequestedErr(err error) bool
- func IsNotImplementedErr(err error) bool
- func LocateChromeExecutable() string
- func StopAllActiveBrowsers()
- type BookmarkBarPreferences
- type Browser
- func (self *Browser) GetReaderForPath(path string) (io.ReadCloser, error)
- func (self *Browser) GetWriterForPath(path string) (string, io.Writer, bool)
- func (self *Browser) IsConnected() bool
- func (self *Browser) Launch() error
- func (self *Browser) RegisterPathHandler(handler PathHandlerFunc)
- func (self *Browser) RegisterPathReader(handler PathReaderFunc)
- func (self *Browser) SetScope(scopeable utils.Runtime)
- func (self *Browser) Stop() error
- func (self *Browser) Tab() *Tab
- func (self *Browser) Wait() error
- type BrowserPreferences
- type Button
- type Container
- type ContainerConfig
- type DistributionPreferences
- type DockerContainer
- func (self *DockerContainer) Address() string
- func (self *DockerContainer) Config() *ContainerConfig
- func (self *DockerContainer) ID() string
- func (self *DockerContainer) IsRunning() bool
- func (self *DockerContainer) Start() error
- func (self *DockerContainer) Stop() error
- func (self *DockerContainer) String() string
- func (self *DockerContainer) Validate() error
- type Event
- type EventCallbackFunc
- type EventWaiter
- type KeyboardAction
- type KeyboardActionConfig
- type MouseAction
- type MouseActionConfig
- type NetworkInterceptFunc
- type NetworkInterceptResponse
- type NetworkRequest
- type NetworkRequestPattern
- type PageInfo
- type PathHandlerFunc
- type PathReaderFunc
- type Preferences
- type RPC
- func (self *RPC) Call(method string, params map[string]interface{}, timeout time.Duration) (*RpcMessage, error)
- func (self *RPC) CallAsync(method string, params map[string]interface{}) error
- func (self *RPC) Close() error
- func (self *RPC) Messages() <-chan *RpcMessage
- func (self *RPC) Send(message *RpcMessage, timeout time.Duration) (*RpcMessage, error)
- func (self *RPC) SynthesizeEvent(message RpcMessage)
- type RpcError
- type RpcMessage
- type SessionPreferences
- type SyncPromoPreferences
- type Tab
- func (self *Tab) AddNetworkIntercept(urlPattern string, waitForHeaders bool, fn NetworkInterceptFunc) error
- func (self *Tab) AsyncRPC(module string, method string, args map[string]interface{}) error
- func (self *Tab) ClearNetworkIntercepts() error
- func (self *Tab) CreateAccumulator(filter string) (*eventAccumulator, error)
- func (self *Tab) CreateEventWaiter(eventGlob string) (*EventWaiter, error)
- func (self *Tab) Disconnect() error
- func (self *Tab) ElementPosition(element *dom.Element) (dom.Dimensions, error)
- func (self *Tab) ElementQuery(selector dom.Selector, parent *dom.Selector) ([]*dom.Element, error)
- func (self *Tab) Emit(method string, params map[string]interface{})
- func (self *Tab) Evaluate(stmt string, exposed ...string) (interface{}, error)
- func (self *Tab) EvaluateOn(element *dom.Element, stmt string, exposed ...string) (interface{}, error)
- func (self *Tab) GetLoaderRequest(id string) (netreq *NetworkRequest)
- func (self *Tab) GetMostRecentFrame() (int64, []byte, int, int)
- func (self *Tab) ID() string
- func (self *Tab) Info() *PageInfo
- func (self *Tab) IsScreencasting() bool
- func (self *Tab) MoveMouse(x float64, y float64, config *MouseActionConfig) error
- func (self *Tab) Navigate(url string) (*RpcMessage, error)
- func (self *Tab) PageSize() (float64, float64, error)
- func (self *Tab) RPC(module string, method string, args map[string]interface{}) (*RpcMessage, error)
- func (self *Tab) RegisterEventHandler(eventGlob string, callback EventCallbackFunc) (string, error)
- func (self *Tab) RemoveWaiter(id string)
- func (self *Tab) ResetMostRecentFrame()
- func (self *Tab) ResetNetworkRequests()
- func (self *Tab) SendKey(domKeyName string, config *KeyboardActionConfig) error
- func (self *Tab) StartScreencast(quality int, width int, height int) error
- func (self *Tab) StopScreencast() error
- func (self *Tab) WaitFor(eventGlob string, timeout time.Duration) (*Event, error)
- type TabID
Constants ¶
View Source
const ( Left Button = `left` Middle = `middle` Right = `right` )
View Source
const ( Pressed MouseAction = `mousePressed` Released = `mouseReleased` Moved = `mouseMoved` Scrolled = `mouseWheel` )
View Source
const ( KeyPressed KeyboardAction = `keyDown` KeyReleased = `keyUp` KeyRaw = `rawKeyDown` )
Variables ¶
View Source
var ContainerInspectTimeout = 3 * time.Second
View Source
var DebuggerInnerPort = 9222
View Source
var DefaultContainerMemory = `512m`
View Source
var DefaultContainerRuntime = `docker`
View Source
var DefaultContainerTargetAddr = `localhost`
View Source
var DefaultDebuggingPort = 0 // 0 = allocate an ephemeral port
View Source
var DefaultReplyTimeout = 30 * time.Second
View Source
var DefaultStartURL = `about:blank`
View Source
var DefaultStartWait = 10 * time.Second
View Source
var DefaultUserDirPath = `/var/tmp`
View Source
var ExitRequested = errors.New(`exit requested`)
View Source
var MaxUnreadEvents = 1024
View Source
var NotImplemented = errors.New(`Not Implemented`)
View Source
var ProcessExitCheckInterval = 125 * time.Millisecond
View Source
var ProcessExitMaxWait = 10 * time.Second
Functions ¶
func IsExitRequestedErr ¶
func IsNotImplementedErr ¶
func LocateChromeExecutable ¶
func LocateChromeExecutable() string
func StopAllActiveBrowsers ¶
func StopAllActiveBrowsers()
Types ¶
type BookmarkBarPreferences ¶
type BookmarkBarPreferences struct {
ShowOnAllTabs bool `json:"show_on_all_tabs"`
}
type Browser ¶
type Browser struct {
Command argonaut.CommandName `argonaut:",joiner=[=]"`
App string `argonaut:"app,long"`
DisableGPU bool `argonaut:"disable-gpu,long"`
HideScrollbars bool `argonaut:"hide-scrollbars,long"`
Headless bool `argonaut:"headless,long"`
Kiosk bool `argonaut:"kiosk,long"`
ProxyBypassList []string `argonaut:"proxy-bypass-list,long,delimiters=[;]"`
ProxyServer string `argonaut:"proxy-server,long"`
RemoteDebuggingPort int `argonaut:"remote-debugging-port,long"`
RemoteDebuggingAddress string `argonaut:"remote-debugging-address,long"`
UserDataDirectory string `argonaut:"user-data-dir,long"`
DefaultBackgroundColor string `argonaut:"default-background-color,long"`
DisableSessionCrashedBubble bool `argonaut:"disable-session-crashed-bubble,long"`
DisableInfobars bool `argonaut:"disable-infobars,long"`
SingleProcess bool `argonaut:"single-process,long"`
DisableSetuidSandbox bool `argonaut:"disable-setuid-sandbox,long"`
NoZygote bool `argonaut:"no-zygote,long"`
NoSandbox bool `argonaut:"no-sandbox,long"`
UserAgent string `argonaut:"user-agent,long"`
URL string `argonaut:",positional"`
StartWait time.Duration `argonaut:"-"`
Environment map[string]interface{} `argonaut:"-"`
Directory string `argonaut:"-"`
Preferences *Preferences `argonaut:"-"`
Container Container `argonaut:"-"`
ID string `argonaut:"-"`
RemoteAddress string
// contains filtered or unexported fields
}
func NewBrowser ¶
func NewBrowser() *Browser
func (*Browser) GetReaderForPath ¶
func (self *Browser) GetReaderForPath(path string) (io.ReadCloser, error)
func (*Browser) GetWriterForPath ¶
func (*Browser) IsConnected ¶
func (*Browser) RegisterPathHandler ¶
func (self *Browser) RegisterPathHandler(handler PathHandlerFunc)
func (*Browser) RegisterPathReader ¶
func (self *Browser) RegisterPathReader(handler PathReaderFunc)
type BrowserPreferences ¶
type BrowserPreferences struct {
ShowHomeButton bool `json:"show_home_button"`
CheckDefaultBrowser bool `json:"check_default_browser"`
DefaultBrowserInfobarLastDeclined string `json:"default_browser_infobar_last_declined"`
EnabledLabsExperiments []string `json:"enabled_labs_experiments,omitempty"`
}
type ContainerConfig ¶
type ContainerConfig struct {
Hostname string
Namespace string
Name string
User string
Env []string
Cmd []string
ImageName string
Memory string
Ports []string
Volumes []string
Labels map[string]string
Privileged bool
WorkingDir string
UserDirPath string
TargetAddr string
}
func (*ContainerConfig) AddPort ¶
func (self *ContainerConfig) AddPort(outer int, inner int, proto string)
func (*ContainerConfig) SetTargetPort ¶
func (self *ContainerConfig) SetTargetPort(port int) string
func (*ContainerConfig) Validate ¶
func (self *ContainerConfig) Validate() error
type DistributionPreferences ¶
type DistributionPreferences struct {
DoNotCreateAnyShortcuts bool `json:"do_not_create_any_shortcuts"`
DoNotCreateDesktopShortcut bool `json:"do_not_create_desktop_shortcut"`
DoNotCreateQuickLaunchShortcut bool `json:"do_not_create_quick_launch_shortcut"`
DoNotCreateTaskbarShortcut bool `json:"do_not_create_taskbar_shortcut"`
DoNotLaunchChrome bool `json:"do_not_launch_chrome"`
DoNotRegisterForUpdateLaunch bool `json:"do_not_register_for_update_launch"`
ImportBookmarks bool `json:"import_bookmarks"`
ImportBookmarksFromFile string `json:"import_bookmarks_from_file,omitempty"`
ImportHistory bool `json:"import_history"`
ImportHomePage bool `json:"import_home_page"`
ImportSearchEngine bool `json:"import_search_engine"`
MakeChromeDefault bool `json:"make_chrome_default"`
MakeChromeDefaultForUser bool `json:"make_chrome_default_for_user"`
PingDelay int `json:"ping_delay,omitempty"`
RequireEula bool `json:"require_eula"`
SuppressFirstRunBubble bool `json:"suppress_first_run_bubble"`
SuppressFirstRunDefaultBrowserPrompt bool `json:"suppress_first_run_default_browser_prompt"`
SystemLevel bool `json:"system_level"`
VerboseLogging bool `json:"verbose_logging"`
}
type DockerContainer ¶
type DockerContainer struct {
*ContainerConfig
// contains filtered or unexported fields
}
func NewDockerContainer ¶
func NewDockerContainer(url string) *DockerContainer
func (*DockerContainer) Address ¶
func (self *DockerContainer) Address() string
func (*DockerContainer) Config ¶
func (self *DockerContainer) Config() *ContainerConfig
func (*DockerContainer) ID ¶
func (self *DockerContainer) ID() string
func (*DockerContainer) IsRunning ¶
func (self *DockerContainer) IsRunning() bool
func (*DockerContainer) Start ¶
func (self *DockerContainer) Start() error
func (*DockerContainer) Stop ¶
func (self *DockerContainer) Stop() error
func (*DockerContainer) String ¶
func (self *DockerContainer) String() string
func (*DockerContainer) Validate ¶
func (self *DockerContainer) Validate() error
type Event ¶
type EventCallbackFunc ¶
type EventCallbackFunc func(event *Event)
type EventWaiter ¶
type EventWaiter struct {
Pattern glob.Glob
Events chan *Event
// contains filtered or unexported fields
}
func NewEventWaiter ¶
func NewEventWaiter(tab *Tab, eventGlob string) (*EventWaiter, error)
func (*EventWaiter) Match ¶
func (self *EventWaiter) Match(event *Event) bool
func (*EventWaiter) Remove ¶
func (self *EventWaiter) Remove()
type KeyboardAction ¶
type KeyboardAction string
func (KeyboardAction) String ¶
func (self KeyboardAction) String() string
type KeyboardActionConfig ¶
type MouseAction ¶
type MouseAction string
func (MouseAction) String ¶
func (self MouseAction) String() string
type MouseActionConfig ¶
type MouseActionConfig struct {
Action MouseAction `json:"action" default:"mouseMoved"`
Button Button `json:"button,omitempty"`
Alt bool `json:"alt,omitempty"`
Control bool `json:"control,omitempty"`
Meta bool `json:"meta,omitempty"`
Shift bool `json:"shift,omitempty"`
WheelX float64 `json:"wheelX,omitempty"`
WheelY float64 `json:"wheelY,omitempty"`
Count int `json:"count,omitempty"`
}
type NetworkInterceptFunc ¶
type NetworkInterceptFunc func(*Tab, *NetworkRequestPattern, *Event) *NetworkInterceptResponse
type NetworkInterceptResponse ¶
type NetworkInterceptResponse struct {
URL string
Method string
Body io.Reader
PostData map[string]interface{}
Header http.Header
Error error
AuthResponse string
Username string
Password string
Autoremove bool
}
func (*NetworkInterceptResponse) ToMap ¶
func (self *NetworkInterceptResponse) ToMap(id string) map[string]interface{}
type NetworkRequest ¶
type NetworkRequest struct {
ID string
Request *Event
Response *Event
Failure *Event
Completion *Event
}
func (*NetworkRequest) Error ¶
func (self *NetworkRequest) Error() error
func (*NetworkRequest) IsCompleted ¶
func (self *NetworkRequest) IsCompleted() bool
func (*NetworkRequest) R ¶
func (self *NetworkRequest) R() *maputil.Map
type NetworkRequestPattern ¶
type NetworkRequestPattern struct {
URL string
ResourceType string
InterceptionStage string
Pattern glob.Glob
}
func (*NetworkRequestPattern) ToMap ¶
func (self *NetworkRequestPattern) ToMap() map[string]interface{}
type PathReaderFunc ¶
type PathReaderFunc = func(string) (io.ReadCloser, bool)
type Preferences ¶
type Preferences struct {
Homepage string `json:"homepage"`
HomepageIsNewTabPage bool `json:"homepage_is_newtabpage"`
Browser *BrowserPreferences `json:"browser,omitempty"`
Session *SessionPreferences `json:"session,omitempty"`
BookmarkBar *BookmarkBarPreferences `json:"bookmark_bar,omitempty"`
SyncPromo *SyncPromoPreferences `json:"sync_promo,omitempty"`
Distribution *DistributionPreferences `json:"distribution,omitempty"`
FirstRunTabs []string `json:"first_run_tabs,omitempty"`
}
func GetDefaultPreferences ¶
func GetDefaultPreferences() *Preferences
type RPC ¶
type RPC struct {
URL string
// contains filtered or unexported fields
}
func (*RPC) Messages ¶
func (self *RPC) Messages() <-chan *RpcMessage
func (*RPC) Send ¶
func (self *RPC) Send(message *RpcMessage, timeout time.Duration) (*RpcMessage, error)
func (*RPC) SynthesizeEvent ¶
func (self *RPC) SynthesizeEvent(message RpcMessage)
type RpcMessage ¶
type RpcMessage struct {
ID int64 `json:"id"`
Method string `json:"method"`
Params map[string]interface{} `json:"params,omitempty"`
Result map[string]interface{} `json:"result,omitempty"`
Error map[string]interface{} `json:"error,omitempty"`
}
func (*RpcMessage) P ¶
func (self *RpcMessage) P() *maputil.Map
func (*RpcMessage) R ¶
func (self *RpcMessage) R() *maputil.Map
func (*RpcMessage) String ¶
func (self *RpcMessage) String() string
type SessionPreferences ¶
type SyncPromoPreferences ¶
type SyncPromoPreferences struct {
ShowOnFirstRunAllowed bool `json:"show_on_first_run_allowed"`
}
type Tab ¶
func (*Tab) AddNetworkIntercept ¶
func (self *Tab) AddNetworkIntercept(urlPattern string, waitForHeaders bool, fn NetworkInterceptFunc) error
func (*Tab) ClearNetworkIntercepts ¶
func (*Tab) CreateAccumulator ¶
func (*Tab) CreateEventWaiter ¶
func (self *Tab) CreateEventWaiter(eventGlob string) (*EventWaiter, error)
func (*Tab) Disconnect ¶
func (*Tab) ElementPosition ¶
func (*Tab) ElementQuery ¶
func (*Tab) EvaluateOn ¶
func (*Tab) GetLoaderRequest ¶
func (self *Tab) GetLoaderRequest(id string) (netreq *NetworkRequest)
func (*Tab) IsScreencasting ¶
func (*Tab) MoveMouse ¶
func (self *Tab) MoveMouse(x float64, y float64, config *MouseActionConfig) error
func (*Tab) RegisterEventHandler ¶
func (self *Tab) RegisterEventHandler(eventGlob string, callback EventCallbackFunc) (string, error)
func (*Tab) RemoveWaiter ¶
func (*Tab) ResetMostRecentFrame ¶
func (self *Tab) ResetMostRecentFrame()
func (*Tab) ResetNetworkRequests ¶
func (self *Tab) ResetNetworkRequests()
func (*Tab) SendKey ¶
func (self *Tab) SendKey(domKeyName string, config *KeyboardActionConfig) error
func (*Tab) StartScreencast ¶
func (*Tab) StopScreencast ¶
Click to show internal directories.
Click to hide internal directories.