import "github.com/chromedp/cdproto/cdp"
EmptyFrameID is the "non-existent" frame id.
EmptyNodeID is the "non-existent" node id.
MonotonicTimeEpoch is the MonotonicTime time epoch.
func Execute(ctx context.Context, method string, params easyjson.Marshaler, res easyjson.Unmarshaler) error
Execute uses the context's message executor to send a command or event method marshaling the provided parameters, and unmarshaling to res.
WithExecutor sets the message executor for the context.
AdFrameType indicates whether a frame has been identified as an ad.
See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-AdFrameType
const ( AdFrameTypeNone AdFrameType = "none" AdFrameTypeChild AdFrameType = "child" AdFrameTypeRoot AdFrameType = "root" )
AdFrameType values.
func (t AdFrameType) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t AdFrameType) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t AdFrameType) String() string
String returns the AdFrameType as string value.
func (t *AdFrameType) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *AdFrameType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-BackendNode
func (v BackendNode) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v BackendNode) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *BackendNode) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *BackendNode) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
BackendNodeID unique DOM node identifier used to reference a node that may not have been pushed to the front-end.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-BackendNodeId
func (t BackendNodeID) Int64() int64
Int64 returns the BackendNodeID as int64 value.
func (t *BackendNodeID) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *BackendNodeID) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
BrowserContextID [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-BrowserContextID
func (t BrowserContextID) String() string
String returns the BrowserContextID as string value.
CrossOriginIsolatedContextType indicates whether the frame is cross-origin isolated and why it is the case.
See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-CrossOriginIsolatedContextType
const ( CrossOriginIsolatedContextTypeIsolated CrossOriginIsolatedContextType = "Isolated" CrossOriginIsolatedContextTypeNotIsolated CrossOriginIsolatedContextType = "NotIsolated" CrossOriginIsolatedContextTypeNotIsolatedFeatureDisabled CrossOriginIsolatedContextType = "NotIsolatedFeatureDisabled" )
CrossOriginIsolatedContextType values.
func (t CrossOriginIsolatedContextType) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CrossOriginIsolatedContextType) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t CrossOriginIsolatedContextType) String() string
String returns the CrossOriginIsolatedContextType as string value.
func (t *CrossOriginIsolatedContextType) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CrossOriginIsolatedContextType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
ErrUnknownCommandOrEvent is an unknown command or event error.
func (err ErrUnknownCommandOrEvent) Error() string
Error satisfies the error interface.
Error is a error.
const ( // ErrInvalidContext is the invalid context error. ErrInvalidContext Error = "invalid context" // ErrMsgMissingParamsOrResult is the msg missing params or result error. ErrMsgMissingParamsOrResult Error = "msg missing params or result" )
Error values.
Error satisfies the error interface.
type Executor interface { // Execute executes the command. Execute(context.Context, string, easyjson.Marshaler, easyjson.Unmarshaler) error }
Executor is the common interface for executing a command.
ExecutorFromContext returns the message executor for the context.
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 without fragment. URLFragment string `json:"urlFragment,omitempty"` // Frame document's URL fragment including the '#'. DomainAndRegistry string `json:"domainAndRegistry"` // Frame document's registered domain, taking the public suffixes list into account. Extracted from the Frame's url. Example URLs: http://www.google.com/file.html -> "google.com" http://a.b.co.uk/file.html -> "b.co.uk" 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. Note that unlike url above, this URL may contain a fragment. AdFrameType AdFrameType `json:"adFrameType,omitempty"` // Indicates whether this frame was tagged as an ad. SecureContextType SecureContextType `json:"secureContextType"` // Indicates whether the main document is a secure context and explains why that is the case. CrossOriginIsolatedContextType CrossOriginIsolatedContextType `json:"crossOriginIsolatedContextType"` // Indicates whether this is a cross origin isolated context. GatedAPIFeatures []GatedAPIFeatures `json:"gatedAPIFeatures"` // Indicated which gated APIs / features are available. 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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-Frame
MarshalEasyJSON supports easyjson.Marshaler interface
MarshalJSON supports json.Marshaler interface
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
UnmarshalJSON supports json.Unmarshaler interface
FrameID unique frame identifier.
See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FrameId
String returns the FrameID as string value.
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
UnmarshalJSON satisfies json.Unmarshaler.
FrameState is the state of a Frame.
const ( FrameDOMContentEventFired FrameState = 1 << (15 - iota) FrameLoadEventFired FrameAttached FrameLoading )
FrameState enum values.
func (fs FrameState) String() string
String satisfies stringer interface.
GatedAPIFeatures [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-GatedAPIFeatures
const ( GatedAPIFeatures = "SharedArrayBuffers" GatedAPIFeatures = "SharedArrayBuffersTransferAllowed" GatedAPIFeaturesPerformanceMeasureMemory GatedAPIFeatures = "PerformanceMeasureMemory" GatedAPIFeaturesPerformanceProfile GatedAPIFeatures = "PerformanceProfile" )
GatedAPIFeatures values.
func (t GatedAPIFeatures) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t GatedAPIFeatures) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t GatedAPIFeatures) String() string
String returns the GatedAPIFeatures as string value.
func (t *GatedAPIFeatures) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *GatedAPIFeatures) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
LoaderID unique loader identifier.
See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-LoaderId
String returns the LoaderID as string value.
MonotonicTime monotonically increasing time in seconds since an arbitrary point in the past.
See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-MonotonicTime
func (t MonotonicTime) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t MonotonicTime) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t MonotonicTime) Time() time.Time
Time returns the MonotonicTime as time.Time value.
func (t *MonotonicTime) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *MonotonicTime) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-Node
Attribute returns the named attribute for the node and if it exists.
AttributeValue returns the named attribute for the node.
Dump builds a printable string representation of the node and its children.
FullXPath returns the full XPath for the node, stopping only at the top most document root.
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.
MarshalEasyJSON supports easyjson.Marshaler interface
MarshalJSON supports json.Marshaler interface
PartialXPath returns the partial XPath for the node, stopping at the nearest parent document node.
PartialXPathByID returns the partial XPath for the node, stopping at the first parent with an id attribute or at nearest parent document node.
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
UnmarshalJSON supports json.Unmarshaler interface
NodeID unique DOM node identifier.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-NodeId
Int64 returns the NodeID as int64 value.
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
UnmarshalJSON satisfies json.Unmarshaler.
NodeState is the state of a DOM node.
NodeState enum values.
String satisfies stringer interface.
NodeType node type.
See: https://developer.mozilla.org/en/docs/Web/API/Node/nodeType
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.
Int64 returns the NodeType as int64 value.
MarshalEasyJSON satisfies easyjson.Marshaler.
MarshalJSON satisfies json.Marshaler.
String returns the NodeType as string value.
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
UnmarshalJSON satisfies json.Unmarshaler.
PseudoType pseudo element type.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-PseudoType
const ( PseudoTypeFirstLine PseudoType = "first-line" PseudoTypeFirstLetter PseudoType = "first-letter" PseudoTypeBefore PseudoType = "before" PseudoTypeAfter PseudoType = "after" PseudoTypeMarker PseudoType = "marker" PseudoTypeBackdrop PseudoType = "backdrop" PseudoTypeSelection PseudoType = "selection" PseudoTypeTargetText PseudoType = "target-text" PseudoTypeSpellingError PseudoType = "spelling-error" PseudoTypeGrammarError PseudoType = "grammar-error" 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 (t PseudoType) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PseudoType) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t PseudoType) String() string
String returns the PseudoType as string value.
func (t *PseudoType) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PseudoType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
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"` // The alpha component, in the [0-1] range (default: 1). }
RGBA a structure holding an RGBA color.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-RGBA
MarshalEasyJSON supports easyjson.Marshaler interface
MarshalJSON supports json.Marshaler interface
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
UnmarshalJSON supports json.Unmarshaler interface
SecureContextType indicates whether the frame is a secure context and why it is the case.
See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-SecureContextType
const ( SecureContextTypeSecure SecureContextType = "Secure" SecureContextTypeSecureLocalhost SecureContextType = "SecureLocalhost" SecureContextTypeInsecureScheme SecureContextType = "InsecureScheme" SecureContextTypeInsecureAncestor SecureContextType = "InsecureAncestor" )
SecureContextType values.
func (t SecureContextType) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SecureContextType) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t SecureContextType) String() string
String returns the SecureContextType as string value.
func (t *SecureContextType) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SecureContextType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
ShadowRootType shadow root type.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-ShadowRootType
const ( ShadowRootTypeUserAgent ShadowRootType = "user-agent" ShadowRootTypeOpen ShadowRootType = "open" ShadowRootTypeClosed ShadowRootType = "closed" )
ShadowRootType values.
func (t ShadowRootType) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t ShadowRootType) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t ShadowRootType) String() string
String returns the ShadowRootType as string value.
func (t *ShadowRootType) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *ShadowRootType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
TimeSinceEpoch UTC time in seconds, counted from January 1, 1970.
See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-TimeSinceEpoch
func (t TimeSinceEpoch) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TimeSinceEpoch) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t TimeSinceEpoch) Time() time.Time
Time returns the TimeSinceEpoch as time.Time value.
func (t *TimeSinceEpoch) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TimeSinceEpoch) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
Package cdp imports 12 packages (graph) and is imported by 128 packages. Updated 2021-01-18. Refresh now. Tools for package owners.