headless_chromium

package
v0.0.0-...-d8d72af Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Browser

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

func NewBrowser

func NewBrowser(port int, addr, proxy, binary string) (*Browser, error)

Starts a headless Chromium instance and binds to it.

func NewRemoteBrowser

func NewRemoteBrowser(addrPort string) (*Browser, error)

Binds to an existing Chromium instance.

func (*Browser) Close

func (b *Browser) Close() error

func (*Browser) ListTabs

func (b *Browser) ListTabs() (tabs []Tab, err error)

func (*Browser) NewBrowserConn

func (b *Browser) NewBrowserConn() (*Conn, error)

Creates a connection to the browser, which accepts browser related commands.

func (*Browser) NewPageConn

func (b *Browser) NewPageConn(targetId string) (*Conn, error)

Creates a connection to the browser, which accepts tab related commands.

type Command

type Command interface {
	Name() string
	Params() interface{}
	Done(result []byte, err error)
}

type CommandJson

type CommandJson struct {
	Id     int         `json:"id"`
	Method string      `json:"method"`
	Params interface{} `json:"params"`
}

type Conn

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

func (*Conn) AddEventSink

func (c *Conn) AddEventSink(name string, sink EventSink)

Don't call this. Use functions from protocol package.

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) RemoveEventSink

func (c *Conn) RemoveEventSink(name string, sink EventSink)

Don't call this. Use functions from protocol package.

func (*Conn) SendCommand

func (c *Conn) SendCommand(cmd Command)

type ErrorJson

type ErrorJson struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type EventSink

type EventSink interface {
	OnEvent(name string, params []byte)
}

func FuncToEventSink

func FuncToEventSink(cb func(name string, params []byte)) EventSink

type MessageJson

type MessageJson struct {
	Id     int             `json:"id"`
	Error  ErrorJson       `json:"error"`
	Result json.RawMessage `json:"result"`
	Method string          `json:"method"`
	Params json.RawMessage `json:"params"`
}

type Tab

type Tab struct {
	Description          string `json:"description"`
	DevtoolsFrontendUrl  string `json:"devtoolsFrontendUrl"`
	ID                   string `json:"id"`
	Title                string `json:"title"`
	Type                 string `json:"type"`
	Url                  string `json:"url"`
	WebSocketDebuggerUrl string `json:"webSocketDebuggerUrl"`
}

type Version

type Version struct {
	Browser         string `json:"Browser"`
	ProtocolVersion string `json:"Protocol-Version"`
	UserAgent       string `json:"User-Agent"`
	WebKitVersion   string `json:"WebKit-Version"`
}

Directories

Path Synopsis
demos
protocol

Jump to

Keyboard shortcuts

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