Documentation
¶
Overview ¶
Package cdp is a minimal Chrome DevTools Protocol client over --remote-debugging-pipe: JSON messages, each followed by a NUL byte, the browser reading fd 3 and writing fd 4.
The pipe rather than --remote-debugging-port, for two reasons: no other local process can connect and drive the browser, and Chrome offers some domains only to a pipe client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// Timeout bounds every Call. Default 30s.
Timeout time.Duration
// contains filtered or unexported fields
}
Conn is a connection to one browser.
func New ¶
New reads replies and events from r and writes commands to w. onEvent runs on the reading goroutine, in order: a handler that calls back into the browser must do it on a goroutine of its own.
type Msg ¶
type Msg struct {
ID int64 `json:"id,omitempty"`
Method string `json:"method,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
SessionID string `json:"sessionId,omitempty"`
}
Msg is one protocol message: a reply (ID set) or an event (Method set).