Documentation ¶
Index ¶
- Constants
- Variables
- type BackendNode
- type BackendNodeID
- type Executor
- type Frame
- type FrameID
- type FrameState
- type LoaderID
- type MonotonicTime
- type Node
- func (n *Node) AttributeValue(name string) string
- func (n *Node) FullXPath() string
- func (n *Node) FullXPathByID() string
- func (v Node) MarshalEasyJSON(w *jwriter.Writer)
- func (v Node) MarshalJSON() ([]byte, error)
- func (n *Node) PartialXPath() string
- func (n *Node) PartialXPathByID() string
- func (v *Node) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Node) UnmarshalJSON(data []byte) error
- type NodeID
- type NodeState
- type NodeType
- type PseudoType
- type RGBA
- type ShadowRootType
- type TimeSinceEpoch
Constants ¶
const EmptyFrameID = FrameID("")
EmptyFrameID is the "non-existent" frame id.
const EmptyNodeID = NodeID(0)
EmptyNodeID is the "non-existent" node id.
Variables ¶
var MonotonicTimeEpoch *time.Time
MonotonicTimeEpoch is the MonotonicTime time epoch.
Functions ¶
This section is empty.
Types ¶
type BackendNode ¶
type BackendNode struct { NodeType NodeType `json:"nodeType"` // Node's nodeType. NodeName string `json:"nodeName"` // Node's nodeName. BackendNodeID BackendNodeID `json:"backendNodeId"` }
BackendNode backend node with a friendly name.
func (BackendNode) MarshalEasyJSON ¶
func (v BackendNode) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BackendNode) MarshalJSON ¶
func (v BackendNode) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BackendNode) UnmarshalEasyJSON ¶
func (v *BackendNode) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BackendNode) UnmarshalJSON ¶
func (v *BackendNode) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BackendNodeID ¶
type BackendNodeID int64
BackendNodeID unique DOM node identifier used to reference a node that may not have been pushed to the front-end.
func (BackendNodeID) Int64 ¶
func (t BackendNodeID) Int64() int64
Int64 returns the BackendNodeID as int64 value.
func (*BackendNodeID) UnmarshalEasyJSON ¶
func (t *BackendNodeID) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (*BackendNodeID) UnmarshalJSON ¶
func (t *BackendNodeID) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type Executor ¶
type Executor interface { // Execute executes the command. Execute(context.Context, string, json.Marshaler, json.Unmarshaler) error }
Executor is the common interface for executing a command.
type Frame ¶
type Frame struct { ID FrameID `json:"id"` // Frame unique identifier. ParentID FrameID `json:"parentId,omitempty"` // Parent frame identifier. LoaderID LoaderID `json:"loaderId"` // Identifier of the loader associated with this frame. Name string `json:"name,omitempty"` // Frame's name as specified in the tag. URL string `json:"url"` // Frame document's URL. SecurityOrigin string `json:"securityOrigin"` // Frame document's security origin. MimeType string `json:"mimeType"` // Frame document's mimeType as determined by the browser. UnreachableURL string `json:"unreachableUrl,omitempty"` // If the frame failed to load, this contains the URL that could not be loaded. State FrameState `json:"-"` // Frame state. Root *Node `json:"-"` // Frame document root. Nodes map[NodeID]*Node `json:"-"` // Frame nodes. sync.RWMutex `json:"-"` // Read write mutex. }
Frame information about the Frame on the page.
func (Frame) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Frame) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Frame) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Frame) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type FrameID ¶
type FrameID string
FrameID unique frame identifier.
func (*FrameID) UnmarshalEasyJSON ¶
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (*FrameID) UnmarshalJSON ¶
UnmarshalJSON satisfies json.Unmarshaler.
type FrameState ¶
type FrameState uint16
FrameState is the state of a Frame.
const ( FrameDOMContentEventFired FrameState = 1 << (15 - iota) FrameLoadEventFired FrameAttached FrameLoading )
FrameState enum values.
func (FrameState) String ¶
func (fs FrameState) String() string
String satisfies stringer interface.
type MonotonicTime ¶
MonotonicTime monotonically increasing time in seconds since an arbitrary point in the past.
func (MonotonicTime) MarshalEasyJSON ¶
func (t MonotonicTime) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (MonotonicTime) MarshalJSON ¶
func (t MonotonicTime) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (MonotonicTime) Time ¶
func (t MonotonicTime) Time() time.Time
Time returns the MonotonicTime as time.Time value.
func (*MonotonicTime) UnmarshalEasyJSON ¶
func (t *MonotonicTime) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (*MonotonicTime) UnmarshalJSON ¶
func (t *MonotonicTime) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type Node ¶
type Node struct { NodeID NodeID `json:"nodeId"` // Node identifier that is passed into the rest of the DOM messages as the nodeId. Backend will only push node with given id once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client. ParentID NodeID `json:"parentId,omitempty"` // The id of the parent node if any. BackendNodeID BackendNodeID `json:"backendNodeId"` // The BackendNodeId for this node. NodeType NodeType `json:"nodeType"` // Node's nodeType. NodeName string `json:"nodeName"` // Node's nodeName. LocalName string `json:"localName"` // Node's localName. NodeValue string `json:"nodeValue"` // Node's nodeValue. ChildNodeCount int64 `json:"childNodeCount,omitempty"` // Child count for Container nodes. Children []*Node `json:"children,omitempty"` // Child nodes of this node when requested with children. Attributes []string `json:"attributes,omitempty"` // Attributes of the Element node in the form of flat array [name1, value1, name2, value2]. DocumentURL string `json:"documentURL,omitempty"` // Document URL that Document or FrameOwner node points to. BaseURL string `json:"baseURL,omitempty"` // Base URL that Document or FrameOwner node uses for URL completion. PublicID string `json:"publicId,omitempty"` // DocumentType's publicId. SystemID string `json:"systemId,omitempty"` // DocumentType's systemId. InternalSubset string `json:"internalSubset,omitempty"` // DocumentType's internalSubset. XMLVersion string `json:"xmlVersion,omitempty"` // Document's XML version in case of XML documents. Name string `json:"name,omitempty"` // Attr's name. Value string `json:"value,omitempty"` // Attr's value. PseudoType PseudoType `json:"pseudoType,omitempty"` // Pseudo element type for this node. ShadowRootType ShadowRootType `json:"shadowRootType,omitempty"` // Shadow root type. FrameID FrameID `json:"frameId,omitempty"` // Frame ID for frame owner elements. ContentDocument *Node `json:"contentDocument,omitempty"` // Content document for frame owner elements. ShadowRoots []*Node `json:"shadowRoots,omitempty"` // Shadow root list for given element host. TemplateContent *Node `json:"templateContent,omitempty"` // Content document fragment for template elements. PseudoElements []*Node `json:"pseudoElements,omitempty"` // Pseudo elements associated with this node. ImportedDocument *Node `json:"importedDocument,omitempty"` // Import document for the HTMLImport links. DistributedNodes []*BackendNode `json:"distributedNodes,omitempty"` // Distributed nodes for given insertion point. IsSVG bool `json:"isSVG,omitempty"` // Whether the node is SVG. Parent *Node `json:"-"` // Parent node. Invalidated chan struct{} `json:"-"` // Invalidated channel. State NodeState `json:"-"` // Node state. sync.RWMutex `json:"-"` // Read write mutex. }
Node DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
func (*Node) AttributeValue ¶
AttributeValue returns the named attribute for the node.
func (*Node) FullXPath ¶
FullXPath returns the full XPath for the node, stopping only at the top most document root.
func (*Node) FullXPathByID ¶
FullXPathByID returns the full XPath for the node, stopping at the top most document root or at the closest parent node with an id attribute.
func (Node) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Node) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Node) PartialXPath ¶
PartialXPath returns the partial XPath for the node, stopping at the nearest parent document node.
func (*Node) PartialXPathByID ¶
PartialXPathByID returns the partial XPath for the node, stopping at the first parent with an id attribute or at nearest parent document node.
func (*Node) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Node) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type NodeID ¶
type NodeID int64
NodeID unique DOM node identifier.
func (*NodeID) UnmarshalEasyJSON ¶
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (*NodeID) UnmarshalJSON ¶
UnmarshalJSON satisfies json.Unmarshaler.
type NodeType ¶
type NodeType int64
NodeType node type.
const ( NodeTypeElement NodeType = 1 NodeTypeAttribute NodeType = 2 NodeTypeText NodeType = 3 NodeTypeCDATA NodeType = 4 NodeTypeEntityReference NodeType = 5 NodeTypeEntity NodeType = 6 NodeTypeProcessingInstruction NodeType = 7 NodeTypeComment NodeType = 8 NodeTypeDocument NodeType = 9 NodeTypeDocumentType NodeType = 10 NodeTypeDocumentFragment NodeType = 11 NodeTypeNotation NodeType = 12 )
NodeType values.
func (NodeType) MarshalEasyJSON ¶
MarshalEasyJSON satisfies easyjson.Marshaler.
func (NodeType) MarshalJSON ¶
MarshalJSON satisfies json.Marshaler.
func (*NodeType) UnmarshalEasyJSON ¶
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (*NodeType) UnmarshalJSON ¶
UnmarshalJSON satisfies json.Unmarshaler.
type PseudoType ¶
type PseudoType string
PseudoType pseudo element type.
const ( PseudoTypeFirstLine PseudoType = "first-line" PseudoTypeFirstLetter PseudoType = "first-letter" PseudoTypeBefore PseudoType = "before" PseudoTypeAfter PseudoType = "after" PseudoTypeBackdrop PseudoType = "backdrop" PseudoTypeSelection PseudoType = "selection" PseudoTypeFirstLineInherited PseudoType = "first-line-inherited" PseudoTypeScrollbar PseudoType = "scrollbar" PseudoTypeScrollbarThumb PseudoType = "scrollbar-thumb" PseudoTypeScrollbarButton PseudoType = "scrollbar-button" PseudoTypeScrollbarTrack PseudoType = "scrollbar-track" PseudoTypeScrollbarTrackPiece PseudoType = "scrollbar-track-piece" PseudoTypeScrollbarCorner PseudoType = "scrollbar-corner" PseudoTypeResizer PseudoType = "resizer" PseudoTypeInputListButton PseudoType = "input-list-button" )
PseudoType values.
func (PseudoType) MarshalEasyJSON ¶
func (t PseudoType) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (PseudoType) MarshalJSON ¶
func (t PseudoType) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (PseudoType) String ¶
func (t PseudoType) String() string
String returns the PseudoType as string value.
func (*PseudoType) UnmarshalEasyJSON ¶
func (t *PseudoType) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (*PseudoType) UnmarshalJSON ¶
func (t *PseudoType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type RGBA ¶
type RGBA struct { R int64 `json:"r"` // The red component, in the [0-255] range. G int64 `json:"g"` // The green component, in the [0-255] range. B int64 `json:"b"` // The blue component, in the [0-255] range. A float64 `json:"a,omitempty"` // The alpha component, in the [0-1] range (default: 1). }
RGBA a structure holding an RGBA color.
func (RGBA) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (RGBA) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*RGBA) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*RGBA) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ShadowRootType ¶
type ShadowRootType string
ShadowRootType shadow root type.
const ( ShadowRootTypeUserAgent ShadowRootType = "user-agent" ShadowRootTypeOpen ShadowRootType = "open" ShadowRootTypeClosed ShadowRootType = "closed" )
ShadowRootType values.
func (ShadowRootType) MarshalEasyJSON ¶
func (t ShadowRootType) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (ShadowRootType) MarshalJSON ¶
func (t ShadowRootType) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (ShadowRootType) String ¶
func (t ShadowRootType) String() string
String returns the ShadowRootType as string value.
func (*ShadowRootType) UnmarshalEasyJSON ¶
func (t *ShadowRootType) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (*ShadowRootType) UnmarshalJSON ¶
func (t *ShadowRootType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type TimeSinceEpoch ¶
TimeSinceEpoch uTC time in seconds, counted from January 1, 1970.
func (TimeSinceEpoch) MarshalEasyJSON ¶
func (t TimeSinceEpoch) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (TimeSinceEpoch) MarshalJSON ¶
func (t TimeSinceEpoch) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (TimeSinceEpoch) Time ¶
func (t TimeSinceEpoch) Time() time.Time
Time returns the TimeSinceEpoch as time.Time value.
func (*TimeSinceEpoch) UnmarshalEasyJSON ¶
func (t *TimeSinceEpoch) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (*TimeSinceEpoch) UnmarshalJSON ¶
func (t *TimeSinceEpoch) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.