Documentation
¶
Overview ¶
Package dom provides the Chrome DevTools Protocol commands, types, and events for the DOM domain.
This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an id. This id can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client. Note that iframe owner elements will return corresponding document elements as their child nodes.
Generated by the cdproto-gen command.
Index ¶
- Constants
- type BoxModel
- type CSSComputedStyleProperty
- type CollectClassNamesFromSubtreeParams
- type CollectClassNamesFromSubtreeReturns
- type CopyToParams
- type CopyToReturns
- type DescribeNodeParams
- func (p *DescribeNodeParams) Do(ctx context.Context) (node *cdp.Node, err error)
- func (p DescribeNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *DescribeNodeParams
- func (p DescribeNodeParams) WithDepth(depth int64) *DescribeNodeParams
- func (p DescribeNodeParams) WithNodeID(nodeID cdp.NodeID) *DescribeNodeParams
- func (p DescribeNodeParams) WithObjectID(objectID runtime.RemoteObjectID) *DescribeNodeParams
- func (p DescribeNodeParams) WithPierce(pierce bool) *DescribeNodeParams
- type DescribeNodeReturns
- type DetachedElementInfo
- type DisableParams
- type DiscardSearchResultsParams
- type EnableIncludeWhitespace
- type EnableParams
- type EventAttributeModified
- type EventAttributeRemoved
- type EventCharacterDataModified
- type EventChildNodeCountUpdated
- type EventChildNodeInserted
- type EventChildNodeRemoved
- type EventDistributedNodesUpdated
- type EventDocumentUpdated
- type EventInlineStyleInvalidated
- type EventPseudoElementAdded
- type EventPseudoElementRemoved
- type EventScrollableFlagUpdated
- type EventSetChildNodes
- type EventShadowRootPopped
- type EventShadowRootPushed
- type EventTopLayerElementsUpdated
- type FocusParams
- type ForceShowPopoverParams
- type ForceShowPopoverReturns
- type GetAnchorElementParams
- type GetAnchorElementReturns
- type GetAttributesParams
- type GetAttributesReturns
- type GetBoxModelParams
- func (p *GetBoxModelParams) Do(ctx context.Context) (model *BoxModel, err error)
- func (p GetBoxModelParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetBoxModelParams
- func (p GetBoxModelParams) WithNodeID(nodeID cdp.NodeID) *GetBoxModelParams
- func (p GetBoxModelParams) WithObjectID(objectID runtime.RemoteObjectID) *GetBoxModelParams
- type GetBoxModelReturns
- type GetContainerForNodeParams
- func (p *GetContainerForNodeParams) Do(ctx context.Context) (nodeID cdp.NodeID, err error)
- func (p GetContainerForNodeParams) WithContainerName(containerName string) *GetContainerForNodeParams
- func (p GetContainerForNodeParams) WithLogicalAxes(logicalAxes LogicalAxes) *GetContainerForNodeParams
- func (p GetContainerForNodeParams) WithPhysicalAxes(physicalAxes PhysicalAxes) *GetContainerForNodeParams
- func (p GetContainerForNodeParams) WithQueriesAnchored(queriesAnchored bool) *GetContainerForNodeParams
- func (p GetContainerForNodeParams) WithQueriesScrollState(queriesScrollState bool) *GetContainerForNodeParams
- type GetContainerForNodeReturns
- type GetContentQuadsParams
- func (p *GetContentQuadsParams) Do(ctx context.Context) (quads []Quad, err error)
- func (p GetContentQuadsParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetContentQuadsParams
- func (p GetContentQuadsParams) WithNodeID(nodeID cdp.NodeID) *GetContentQuadsParams
- func (p GetContentQuadsParams) WithObjectID(objectID runtime.RemoteObjectID) *GetContentQuadsParams
- type GetContentQuadsReturns
- type GetDetachedDomNodesParams
- type GetDetachedDomNodesReturns
- type GetDocumentParams
- type GetDocumentReturns
- type GetElementByRelationParams
- type GetElementByRelationRelation
- type GetElementByRelationReturns
- type GetFileInfoParams
- type GetFileInfoReturns
- type GetFrameOwnerParams
- type GetFrameOwnerReturns
- type GetNodeForLocationParams
- func (p *GetNodeForLocationParams) Do(ctx context.Context) (backendNodeID cdp.BackendNodeID, frameID cdp.FrameID, nodeID cdp.NodeID, ...)
- func (p GetNodeForLocationParams) WithIgnorePointerEventsNone(ignorePointerEventsNone bool) *GetNodeForLocationParams
- func (p GetNodeForLocationParams) WithIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *GetNodeForLocationParams
- type GetNodeForLocationReturns
- type GetNodeStackTracesParams
- type GetNodeStackTracesReturns
- type GetNodesForSubtreeByStyleParams
- type GetNodesForSubtreeByStyleReturns
- type GetOuterHTMLParams
- func (p *GetOuterHTMLParams) Do(ctx context.Context) (outerHTML string, err error)
- func (p GetOuterHTMLParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetOuterHTMLParams
- func (p GetOuterHTMLParams) WithIncludeShadowDOM(includeShadowDOM bool) *GetOuterHTMLParams
- func (p GetOuterHTMLParams) WithNodeID(nodeID cdp.NodeID) *GetOuterHTMLParams
- func (p GetOuterHTMLParams) WithObjectID(objectID runtime.RemoteObjectID) *GetOuterHTMLParams
- type GetOuterHTMLReturns
- type GetQueryingDescendantsForContainerParams
- type GetQueryingDescendantsForContainerReturns
- type GetRelayoutBoundaryParams
- type GetRelayoutBoundaryReturns
- type GetSearchResultsParams
- type GetSearchResultsReturns
- type GetTopLayerElementsParams
- type GetTopLayerElementsReturns
- type LogicalAxes
- type MarkUndoableStateParams
- type MoveToParams
- type MoveToReturns
- type PerformSearchParams
- type PerformSearchReturns
- type PhysicalAxes
- type PushNodeByPathToFrontendParams
- type PushNodeByPathToFrontendReturns
- type PushNodesByBackendIDsToFrontendParams
- type PushNodesByBackendIDsToFrontendReturns
- type Quad
- type QuerySelectorAllParams
- type QuerySelectorAllReturns
- type QuerySelectorParams
- type QuerySelectorReturns
- type Rect
- type RedoParams
- type RemoveAttributeParams
- type RemoveNodeParams
- type RequestChildNodesParams
- type RequestNodeParams
- type RequestNodeReturns
- type ResolveNodeParams
- func (p *ResolveNodeParams) Do(ctx context.Context) (object *runtime.RemoteObject, err error)
- func (p ResolveNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *ResolveNodeParams
- func (p ResolveNodeParams) WithExecutionContextID(executionContextID runtime.ExecutionContextID) *ResolveNodeParams
- func (p ResolveNodeParams) WithNodeID(nodeID cdp.NodeID) *ResolveNodeParams
- func (p ResolveNodeParams) WithObjectGroup(objectGroup string) *ResolveNodeParams
- type ResolveNodeReturns
- type ScrollIntoViewIfNeededParams
- func (p *ScrollIntoViewIfNeededParams) Do(ctx context.Context) (err error)
- func (p ScrollIntoViewIfNeededParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *ScrollIntoViewIfNeededParams
- func (p ScrollIntoViewIfNeededParams) WithNodeID(nodeID cdp.NodeID) *ScrollIntoViewIfNeededParams
- func (p ScrollIntoViewIfNeededParams) WithObjectID(objectID runtime.RemoteObjectID) *ScrollIntoViewIfNeededParams
- func (p ScrollIntoViewIfNeededParams) WithRect(rect *Rect) *ScrollIntoViewIfNeededParams
- type ScrollOrientation
- type SetAttributeValueParams
- type SetAttributesAsTextParams
- type SetFileInputFilesParams
- func (p *SetFileInputFilesParams) Do(ctx context.Context) (err error)
- func (p SetFileInputFilesParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *SetFileInputFilesParams
- func (p SetFileInputFilesParams) WithNodeID(nodeID cdp.NodeID) *SetFileInputFilesParams
- func (p SetFileInputFilesParams) WithObjectID(objectID runtime.RemoteObjectID) *SetFileInputFilesParams
- type SetInspectedNodeParams
- type SetNodeNameParams
- type SetNodeNameReturns
- type SetNodeStackTracesEnabledParams
- type SetNodeValueParams
- type SetOuterHTMLParams
- type ShapeOutsideInfo
- type UndoParams
Constants ¶
const ( CommandCollectClassNamesFromSubtree = "DOM.collectClassNamesFromSubtree" CommandCopyTo = "DOM.copyTo" CommandDescribeNode = "DOM.describeNode" CommandScrollIntoViewIfNeeded = "DOM.scrollIntoViewIfNeeded" CommandDisable = "DOM.disable" CommandDiscardSearchResults = "DOM.discardSearchResults" CommandEnable = "DOM.enable" CommandFocus = "DOM.focus" CommandGetAttributes = "DOM.getAttributes" CommandGetBoxModel = "DOM.getBoxModel" CommandGetContentQuads = "DOM.getContentQuads" CommandGetDocument = "DOM.getDocument" CommandGetNodesForSubtreeByStyle = "DOM.getNodesForSubtreeByStyle" CommandGetNodeForLocation = "DOM.getNodeForLocation" CommandGetOuterHTML = "DOM.getOuterHTML" CommandGetRelayoutBoundary = "DOM.getRelayoutBoundary" CommandGetSearchResults = "DOM.getSearchResults" CommandMarkUndoableState = "DOM.markUndoableState" CommandMoveTo = "DOM.moveTo" CommandPerformSearch = "DOM.performSearch" CommandPushNodeByPathToFrontend = "DOM.pushNodeByPathToFrontend" CommandPushNodesByBackendIDsToFrontend = "DOM.pushNodesByBackendIdsToFrontend" CommandQuerySelector = "DOM.querySelector" CommandQuerySelectorAll = "DOM.querySelectorAll" CommandGetTopLayerElements = "DOM.getTopLayerElements" CommandGetElementByRelation = "DOM.getElementByRelation" CommandRedo = "DOM.redo" CommandRemoveAttribute = "DOM.removeAttribute" CommandRemoveNode = "DOM.removeNode" CommandRequestChildNodes = "DOM.requestChildNodes" CommandRequestNode = "DOM.requestNode" CommandResolveNode = "DOM.resolveNode" CommandSetAttributeValue = "DOM.setAttributeValue" CommandSetAttributesAsText = "DOM.setAttributesAsText" CommandSetFileInputFiles = "DOM.setFileInputFiles" CommandSetNodeStackTracesEnabled = "DOM.setNodeStackTracesEnabled" CommandGetNodeStackTraces = "DOM.getNodeStackTraces" CommandGetFileInfo = "DOM.getFileInfo" CommandGetDetachedDomNodes = "DOM.getDetachedDomNodes" CommandSetInspectedNode = "DOM.setInspectedNode" CommandSetNodeName = "DOM.setNodeName" CommandSetNodeValue = "DOM.setNodeValue" CommandSetOuterHTML = "DOM.setOuterHTML" CommandUndo = "DOM.undo" CommandGetFrameOwner = "DOM.getFrameOwner" CommandGetContainerForNode = "DOM.getContainerForNode" CommandGetQueryingDescendantsForContainer = "DOM.getQueryingDescendantsForContainer" CommandGetAnchorElement = "DOM.getAnchorElement" CommandForceShowPopover = "DOM.forceShowPopover" )
Command names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoxModel ¶
type BoxModel struct {
Content Quad `json:"content"` // Content box
Padding Quad `json:"padding"` // Padding box
Border Quad `json:"border"` // Border box
Margin Quad `json:"margin"` // Margin box
Width int64 `json:"width"` // Node width
Height int64 `json:"height"` // Node height
ShapeOutside *ShapeOutsideInfo `json:"shapeOutside,omitempty,omitzero"` // Shape outside coordinates
}
BoxModel box model.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-BoxModel
type CSSComputedStyleProperty ¶
type CSSComputedStyleProperty struct {
Name string `json:"name"` // Computed style property name.
Value string `json:"value"` // Computed style property value.
}
CSSComputedStyleProperty [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-CSSComputedStyleProperty
type CollectClassNamesFromSubtreeParams ¶
type CollectClassNamesFromSubtreeParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to collect class names.
}
CollectClassNamesFromSubtreeParams collects class names for the node with given id and all of it's child nodes.
func CollectClassNamesFromSubtree ¶
func CollectClassNamesFromSubtree(nodeID cdp.NodeID) *CollectClassNamesFromSubtreeParams
CollectClassNamesFromSubtree collects class names for the node with given id and all of it's child nodes.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-collectClassNamesFromSubtree
parameters:
nodeID - Id of the node to collect class names.
type CollectClassNamesFromSubtreeReturns ¶
type CollectClassNamesFromSubtreeReturns struct {
ClassNames []string `json:"classNames,omitempty,omitzero"` // Class name list.
}
CollectClassNamesFromSubtreeReturns return values.
type CopyToParams ¶
type CopyToParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to copy.
TargetNodeID cdp.NodeID `json:"targetNodeId"` // Id of the element to drop the copy into.
InsertBeforeNodeID cdp.NodeID `json:"insertBeforeNodeId,omitempty,omitzero"` // Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId).
}
CopyToParams creates a deep copy of the specified node and places it into the target container before the given anchor.
func CopyTo ¶
func CopyTo(nodeID cdp.NodeID, targetNodeID cdp.NodeID) *CopyToParams
CopyTo creates a deep copy of the specified node and places it into the target container before the given anchor.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-copyTo
parameters:
nodeID - Id of the node to copy. targetNodeID - Id of the element to drop the copy into.
func (*CopyToParams) Do ¶
Do executes DOM.copyTo against the provided context.
returns:
nodeID - Id of the node clone.
func (CopyToParams) WithInsertBeforeNodeID ¶
func (p CopyToParams) WithInsertBeforeNodeID(insertBeforeNodeID cdp.NodeID) *CopyToParams
WithInsertBeforeNodeID drop the copy before this node (if absent, the copy becomes the last child of targetNodeId).
type CopyToReturns ¶
type CopyToReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Id of the node clone.
}
CopyToReturns return values.
type DescribeNodeParams ¶
type DescribeNodeParams struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper.
Depth int64 `json:"depth,omitempty,omitzero"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
Pierce bool `json:"pierce"` // Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
}
DescribeNodeParams describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
func DescribeNode ¶
func DescribeNode() *DescribeNodeParams
DescribeNode describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-describeNode
parameters:
func (*DescribeNodeParams) Do ¶
Do executes DOM.describeNode against the provided context.
returns:
node - Node description.
func (DescribeNodeParams) WithBackendNodeID ¶
func (p DescribeNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *DescribeNodeParams
WithBackendNodeID identifier of the backend node.
func (DescribeNodeParams) WithDepth ¶
func (p DescribeNodeParams) WithDepth(depth int64) *DescribeNodeParams
WithDepth the maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
func (DescribeNodeParams) WithNodeID ¶
func (p DescribeNodeParams) WithNodeID(nodeID cdp.NodeID) *DescribeNodeParams
WithNodeID identifier of the node.
func (DescribeNodeParams) WithObjectID ¶
func (p DescribeNodeParams) WithObjectID(objectID runtime.RemoteObjectID) *DescribeNodeParams
WithObjectID JavaScript object id of the node wrapper.
func (DescribeNodeParams) WithPierce ¶
func (p DescribeNodeParams) WithPierce(pierce bool) *DescribeNodeParams
WithPierce whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
type DescribeNodeReturns ¶
type DescribeNodeReturns struct {
Node *cdp.Node `json:"node,omitempty,omitzero"` // Node description.
}
DescribeNodeReturns return values.
type DetachedElementInfo ¶
type DetachedElementInfo struct {
TreeNode *cdp.Node `json:"treeNode"`
RetainedNodeIDs []cdp.NodeID `json:"retainedNodeIds"`
}
DetachedElementInfo a structure to hold the top-level node of a detached tree and an array of its retained descendants.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-DetachedElementInfo
type DisableParams ¶
type DisableParams struct{}
DisableParams disables DOM agent for the given page.
func Disable ¶
func Disable() *DisableParams
Disable disables DOM agent for the given page.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-disable
type DiscardSearchResultsParams ¶
type DiscardSearchResultsParams struct {
SearchID string `json:"searchId"` // Unique search session identifier.
}
DiscardSearchResultsParams discards search results from the session with the given id. getSearchResults should no longer be called for that search.
func DiscardSearchResults ¶
func DiscardSearchResults(searchID string) *DiscardSearchResultsParams
DiscardSearchResults discards search results from the session with the given id. getSearchResults should no longer be called for that search.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-discardSearchResults
parameters:
searchID - Unique search session identifier.
type EnableIncludeWhitespace ¶
type EnableIncludeWhitespace string
EnableIncludeWhitespace whether to include whitespaces in the children array of returned Nodes.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-enable
const ( EnableIncludeWhitespaceNone EnableIncludeWhitespace = "none" EnableIncludeWhitespaceAll EnableIncludeWhitespace = "all" )
EnableIncludeWhitespace values.
func (EnableIncludeWhitespace) String ¶
func (t EnableIncludeWhitespace) String() string
String returns the EnableIncludeWhitespace as string value.
func (*EnableIncludeWhitespace) UnmarshalJSON ¶
func (t *EnableIncludeWhitespace) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type EnableParams ¶
type EnableParams struct {
IncludeWhitespace EnableIncludeWhitespace `json:"includeWhitespace,omitempty,omitzero"` // Whether to include whitespaces in the children array of returned Nodes.
}
EnableParams enables DOM agent for the given page.
func Enable ¶
func Enable() *EnableParams
Enable enables DOM agent for the given page.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-enable
parameters:
func (*EnableParams) Do ¶
func (p *EnableParams) Do(ctx context.Context) (err error)
Do executes DOM.enable against the provided context.
func (EnableParams) WithIncludeWhitespace ¶
func (p EnableParams) WithIncludeWhitespace(includeWhitespace EnableIncludeWhitespace) *EnableParams
WithIncludeWhitespace whether to include whitespaces in the children array of returned Nodes.
type EventAttributeModified ¶
type EventAttributeModified struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node that has changed.
Name string `json:"name"` // Attribute name.
Value string `json:"value"` // Attribute value.
}
EventAttributeModified fired when Element's attribute is modified.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-attributeModified
type EventAttributeRemoved ¶
type EventAttributeRemoved struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node that has changed.
Name string `json:"name"` // A ttribute name.
}
EventAttributeRemoved fired when Element's attribute is removed.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-attributeRemoved
type EventCharacterDataModified ¶
type EventCharacterDataModified struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node that has changed.
CharacterData string `json:"characterData"` // New text value.
}
EventCharacterDataModified mirrors DOMCharacterDataModified event.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-characterDataModified
type EventChildNodeCountUpdated ¶
type EventChildNodeCountUpdated struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node that has changed.
ChildNodeCount int64 `json:"childNodeCount"` // New node count.
}
EventChildNodeCountUpdated fired when Container's child node count has changed.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-childNodeCountUpdated
type EventChildNodeInserted ¶
type EventChildNodeInserted struct {
ParentNodeID cdp.NodeID `json:"parentNodeId"` // Id of the node that has changed.
PreviousNodeID cdp.NodeID `json:"previousNodeId"` // Id of the previous sibling.
Node *cdp.Node `json:"node"` // Inserted node data.
}
EventChildNodeInserted mirrors DOMNodeInserted event.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-childNodeInserted
type EventChildNodeRemoved ¶
type EventChildNodeRemoved struct {
ParentNodeID cdp.NodeID `json:"parentNodeId"` // Parent id.
NodeID cdp.NodeID `json:"nodeId"` // Id of the node that has been removed.
}
EventChildNodeRemoved mirrors DOMNodeRemoved event.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-childNodeRemoved
type EventDistributedNodesUpdated ¶
type EventDistributedNodesUpdated struct {
InsertionPointID cdp.NodeID `json:"insertionPointId"` // Insertion point where distributed nodes were updated.
DistributedNodes []*cdp.BackendNode `json:"distributedNodes"` // Distributed nodes for given insertion point.
}
EventDistributedNodesUpdated called when distribution is changed.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-distributedNodesUpdated
type EventDocumentUpdated ¶
type EventDocumentUpdated struct{}
EventDocumentUpdated fired when Document has been totally updated. Node ids are no longer valid.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-documentUpdated
type EventInlineStyleInvalidated ¶
type EventInlineStyleInvalidated struct {
NodeIDs []cdp.NodeID `json:"nodeIds"` // Ids of the nodes for which the inline styles have been invalidated.
}
EventInlineStyleInvalidated fired when Element's inline style is modified via a CSS property modification.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-inlineStyleInvalidated
type EventPseudoElementAdded ¶
type EventPseudoElementAdded struct {
ParentID cdp.NodeID `json:"parentId"` // Pseudo element's parent element id.
PseudoElement *cdp.Node `json:"pseudoElement"` // The added pseudo element.
}
EventPseudoElementAdded called when a pseudo element is added to an element.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-pseudoElementAdded
type EventPseudoElementRemoved ¶
type EventPseudoElementRemoved struct {
ParentID cdp.NodeID `json:"parentId"` // Pseudo element's parent element id.
PseudoElementID cdp.NodeID `json:"pseudoElementId"` // The removed pseudo element id.
}
EventPseudoElementRemoved called when a pseudo element is removed from an element.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-pseudoElementRemoved
type EventScrollableFlagUpdated ¶
type EventScrollableFlagUpdated struct {
NodeID cdp.NodeID `json:"nodeId"` // The id of the node.
IsScrollable bool `json:"isScrollable"` // If the node is scrollable.
}
EventScrollableFlagUpdated fired when a node's scrollability state changes.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-scrollableFlagUpdated
type EventSetChildNodes ¶
type EventSetChildNodes struct {
ParentID cdp.NodeID `json:"parentId"` // Parent node id to populate with children.
Nodes []*cdp.Node `json:"nodes"` // Child nodes array.
}
EventSetChildNodes fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-setChildNodes
type EventShadowRootPopped ¶
type EventShadowRootPopped struct {
HostID cdp.NodeID `json:"hostId"` // Host element id.
RootID cdp.NodeID `json:"rootId"` // Shadow root id.
}
EventShadowRootPopped called when shadow root is popped from the element.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-shadowRootPopped
type EventShadowRootPushed ¶
type EventShadowRootPushed struct {
HostID cdp.NodeID `json:"hostId"` // Host element id.
Root *cdp.Node `json:"root"` // Shadow root.
}
EventShadowRootPushed called when shadow root is pushed into the element.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-shadowRootPushed
type EventTopLayerElementsUpdated ¶
type EventTopLayerElementsUpdated struct{}
EventTopLayerElementsUpdated called when top layer elements are changed.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-topLayerElementsUpdated
type FocusParams ¶
type FocusParams struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper.
}
FocusParams focuses the given element.
func Focus ¶
func Focus() *FocusParams
Focus focuses the given element.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-focus
parameters:
func (*FocusParams) Do ¶
func (p *FocusParams) Do(ctx context.Context) (err error)
Do executes DOM.focus against the provided context.
func (FocusParams) WithBackendNodeID ¶
func (p FocusParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *FocusParams
WithBackendNodeID identifier of the backend node.
func (FocusParams) WithNodeID ¶
func (p FocusParams) WithNodeID(nodeID cdp.NodeID) *FocusParams
WithNodeID identifier of the node.
func (FocusParams) WithObjectID ¶
func (p FocusParams) WithObjectID(objectID runtime.RemoteObjectID) *FocusParams
WithObjectID JavaScript object id of the node wrapper.
type ForceShowPopoverParams ¶
type ForceShowPopoverParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the popover HTMLElement
Enable bool `json:"enable"` // If true, opens the popover and keeps it open. If false, closes the popover if it was previously force-opened.
}
ForceShowPopoverParams when enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.
func ForceShowPopover ¶
func ForceShowPopover(nodeID cdp.NodeID, enable bool) *ForceShowPopoverParams
ForceShowPopover when enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-forceShowPopover
parameters:
nodeID - Id of the popover HTMLElement enable - If true, opens the popover and keeps it open. If false, closes the popover if it was previously force-opened.
type ForceShowPopoverReturns ¶
type ForceShowPopoverReturns struct {
NodeIDs []cdp.NodeID `json:"nodeIds,omitempty,omitzero"` // List of popovers that were closed in order to respect popover stacking order.
}
ForceShowPopoverReturns return values.
type GetAnchorElementParams ¶
type GetAnchorElementParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the positioned element from which to find the anchor.
AnchorSpecifier string `json:"anchorSpecifier,omitempty,omitzero"` // An optional anchor specifier, as defined in https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier. If not provided, it will return the implicit anchor element for the given positioned element.
}
GetAnchorElementParams returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
func GetAnchorElement ¶
func GetAnchorElement(nodeID cdp.NodeID) *GetAnchorElementParams
GetAnchorElement returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getAnchorElement
parameters:
nodeID - Id of the positioned element from which to find the anchor.
func (*GetAnchorElementParams) Do ¶
Do executes DOM.getAnchorElement against the provided context.
returns:
nodeID - The anchor element of the given anchor query.
func (GetAnchorElementParams) WithAnchorSpecifier ¶
func (p GetAnchorElementParams) WithAnchorSpecifier(anchorSpecifier string) *GetAnchorElementParams
WithAnchorSpecifier an optional anchor specifier, as defined in https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier. If not provided, it will return the implicit anchor element for the given positioned element.
type GetAnchorElementReturns ¶
type GetAnchorElementReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // The anchor element of the given anchor query.
}
GetAnchorElementReturns return values.
type GetAttributesParams ¶
type GetAttributesParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to retrieve attributes for.
}
GetAttributesParams returns attributes for the specified node.
func GetAttributes ¶
func GetAttributes(nodeID cdp.NodeID) *GetAttributesParams
GetAttributes returns attributes for the specified node.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getAttributes
parameters:
nodeID - Id of the node to retrieve attributes for.
type GetAttributesReturns ¶
type GetAttributesReturns struct {
Attributes []string `json:"attributes,omitempty,omitzero"` // An interleaved array of node attribute names and values.
}
GetAttributesReturns return values.
type GetBoxModelParams ¶
type GetBoxModelParams struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper.
}
GetBoxModelParams returns boxes for the given node.
func GetBoxModel ¶
func GetBoxModel() *GetBoxModelParams
GetBoxModel returns boxes for the given node.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getBoxModel
parameters:
func (*GetBoxModelParams) Do ¶
func (p *GetBoxModelParams) Do(ctx context.Context) (model *BoxModel, err error)
Do executes DOM.getBoxModel against the provided context.
returns:
model - Box model for the node.
func (GetBoxModelParams) WithBackendNodeID ¶
func (p GetBoxModelParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetBoxModelParams
WithBackendNodeID identifier of the backend node.
func (GetBoxModelParams) WithNodeID ¶
func (p GetBoxModelParams) WithNodeID(nodeID cdp.NodeID) *GetBoxModelParams
WithNodeID identifier of the node.
func (GetBoxModelParams) WithObjectID ¶
func (p GetBoxModelParams) WithObjectID(objectID runtime.RemoteObjectID) *GetBoxModelParams
WithObjectID JavaScript object id of the node wrapper.
type GetBoxModelReturns ¶
type GetBoxModelReturns struct {
Model *BoxModel `json:"model,omitempty,omitzero"` // Box model for the node.
}
GetBoxModelReturns return values.
type GetContainerForNodeParams ¶
type GetContainerForNodeParams struct {
NodeID cdp.NodeID `json:"nodeId"`
ContainerName string `json:"containerName,omitempty,omitzero"`
PhysicalAxes PhysicalAxes `json:"physicalAxes,omitempty,omitzero"`
LogicalAxes LogicalAxes `json:"logicalAxes,omitempty,omitzero"`
QueriesScrollState bool `json:"queriesScrollState"`
QueriesAnchored bool `json:"queriesAnchored"`
}
GetContainerForNodeParams returns the query container of the given node based on container query conditions: containerName, physical and logical axes, and whether it queries scroll-state or anchored elements. If no axes are provided and queriesScrollState is false, the style container is returned, which is the direct parent or the closest element with a matching container-name.
func GetContainerForNode ¶
func GetContainerForNode(nodeID cdp.NodeID) *GetContainerForNodeParams
GetContainerForNode returns the query container of the given node based on container query conditions: containerName, physical and logical axes, and whether it queries scroll-state or anchored elements. If no axes are provided and queriesScrollState is false, the style container is returned, which is the direct parent or the closest element with a matching container-name.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getContainerForNode
parameters:
nodeID
func (*GetContainerForNodeParams) Do ¶
Do executes DOM.getContainerForNode against the provided context.
returns:
nodeID - The container node for the given node, or null if not found.
func (GetContainerForNodeParams) WithContainerName ¶
func (p GetContainerForNodeParams) WithContainerName(containerName string) *GetContainerForNodeParams
WithContainerName [no description].
func (GetContainerForNodeParams) WithLogicalAxes ¶
func (p GetContainerForNodeParams) WithLogicalAxes(logicalAxes LogicalAxes) *GetContainerForNodeParams
WithLogicalAxes [no description].
func (GetContainerForNodeParams) WithPhysicalAxes ¶
func (p GetContainerForNodeParams) WithPhysicalAxes(physicalAxes PhysicalAxes) *GetContainerForNodeParams
WithPhysicalAxes [no description].
func (GetContainerForNodeParams) WithQueriesAnchored ¶
func (p GetContainerForNodeParams) WithQueriesAnchored(queriesAnchored bool) *GetContainerForNodeParams
WithQueriesAnchored [no description].
func (GetContainerForNodeParams) WithQueriesScrollState ¶
func (p GetContainerForNodeParams) WithQueriesScrollState(queriesScrollState bool) *GetContainerForNodeParams
WithQueriesScrollState [no description].
type GetContainerForNodeReturns ¶
type GetContainerForNodeReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // The container node for the given node, or null if not found.
}
GetContainerForNodeReturns return values.
type GetContentQuadsParams ¶
type GetContentQuadsParams struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper.
}
GetContentQuadsParams returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
func GetContentQuads ¶
func GetContentQuads() *GetContentQuadsParams
GetContentQuads returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getContentQuads
parameters:
func (*GetContentQuadsParams) Do ¶
func (p *GetContentQuadsParams) Do(ctx context.Context) (quads []Quad, err error)
Do executes DOM.getContentQuads against the provided context.
returns:
quads - Quads that describe node layout relative to viewport.
func (GetContentQuadsParams) WithBackendNodeID ¶
func (p GetContentQuadsParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetContentQuadsParams
WithBackendNodeID identifier of the backend node.
func (GetContentQuadsParams) WithNodeID ¶
func (p GetContentQuadsParams) WithNodeID(nodeID cdp.NodeID) *GetContentQuadsParams
WithNodeID identifier of the node.
func (GetContentQuadsParams) WithObjectID ¶
func (p GetContentQuadsParams) WithObjectID(objectID runtime.RemoteObjectID) *GetContentQuadsParams
WithObjectID JavaScript object id of the node wrapper.
type GetContentQuadsReturns ¶
type GetContentQuadsReturns struct {
Quads []Quad `json:"quads,omitempty,omitzero"` // Quads that describe node layout relative to viewport.
}
GetContentQuadsReturns return values.
type GetDetachedDomNodesParams ¶
type GetDetachedDomNodesParams struct{}
GetDetachedDomNodesParams returns list of detached nodes.
func GetDetachedDomNodes ¶
func GetDetachedDomNodes() *GetDetachedDomNodesParams
GetDetachedDomNodes returns list of detached nodes.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getDetachedDomNodes
func (*GetDetachedDomNodesParams) Do ¶
func (p *GetDetachedDomNodesParams) Do(ctx context.Context) (detachedNodes []*DetachedElementInfo, err error)
Do executes DOM.getDetachedDomNodes against the provided context.
returns:
detachedNodes - The list of detached nodes
type GetDetachedDomNodesReturns ¶
type GetDetachedDomNodesReturns struct {
DetachedNodes []*DetachedElementInfo `json:"detachedNodes,omitempty,omitzero"` // The list of detached nodes
}
GetDetachedDomNodesReturns return values.
type GetDocumentParams ¶
type GetDocumentParams struct {
Depth int64 `json:"depth,omitempty,omitzero"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
Pierce bool `json:"pierce"` // Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
}
GetDocumentParams returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.
func GetDocument ¶
func GetDocument() *GetDocumentParams
GetDocument returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getDocument
parameters:
func (*GetDocumentParams) Do ¶
Do executes DOM.getDocument against the provided context.
returns:
root - Resulting node.
func (GetDocumentParams) WithDepth ¶
func (p GetDocumentParams) WithDepth(depth int64) *GetDocumentParams
WithDepth the maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
func (GetDocumentParams) WithPierce ¶
func (p GetDocumentParams) WithPierce(pierce bool) *GetDocumentParams
WithPierce whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
type GetDocumentReturns ¶
type GetDocumentReturns struct {
Root *cdp.Node `json:"root,omitempty,omitzero"` // Resulting node.
}
GetDocumentReturns return values.
type GetElementByRelationParams ¶
type GetElementByRelationParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node from which to query the relation.
Relation GetElementByRelationRelation `json:"relation"` // Type of relation to get.
}
GetElementByRelationParams returns the NodeId of the matched element according to certain relations.
func GetElementByRelation ¶
func GetElementByRelation(nodeID cdp.NodeID, relation GetElementByRelationRelation) *GetElementByRelationParams
GetElementByRelation returns the NodeId of the matched element according to certain relations.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getElementByRelation
parameters:
nodeID - Id of the node from which to query the relation. relation - Type of relation to get.
type GetElementByRelationRelation ¶
type GetElementByRelationRelation string
GetElementByRelationRelation type of relation to get.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getElementByRelation
const ( GetElementByRelationRelationPopoverTarget GetElementByRelationRelation = "PopoverTarget" GetElementByRelationRelationInterestTarget GetElementByRelationRelation = "InterestTarget" GetElementByRelationRelationCommandFor GetElementByRelationRelation = "CommandFor" )
GetElementByRelationRelation values.
func (GetElementByRelationRelation) String ¶
func (t GetElementByRelationRelation) String() string
String returns the GetElementByRelationRelation as string value.
func (*GetElementByRelationRelation) UnmarshalJSON ¶
func (t *GetElementByRelationRelation) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type GetElementByRelationReturns ¶
type GetElementByRelationReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // NodeId of the element matching the queried relation.
}
GetElementByRelationReturns return values.
type GetFileInfoParams ¶
type GetFileInfoParams struct {
ObjectID runtime.RemoteObjectID `json:"objectId"` // JavaScript object id of the node wrapper.
}
GetFileInfoParams returns file information for the given File wrapper.
func GetFileInfo ¶
func GetFileInfo(objectID runtime.RemoteObjectID) *GetFileInfoParams
GetFileInfo returns file information for the given File wrapper.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getFileInfo
parameters:
objectID - JavaScript object id of the node wrapper.
type GetFileInfoReturns ¶
type GetFileInfoReturns struct {
Path string `json:"path,omitempty,omitzero"`
}
GetFileInfoReturns return values.
type GetFrameOwnerParams ¶
GetFrameOwnerParams returns iframe node that owns iframe with the given domain.
func GetFrameOwner ¶
func GetFrameOwner(frameID cdp.FrameID) *GetFrameOwnerParams
GetFrameOwner returns iframe node that owns iframe with the given domain.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getFrameOwner
parameters:
frameID
func (*GetFrameOwnerParams) Do ¶
func (p *GetFrameOwnerParams) Do(ctx context.Context) (backendNodeID cdp.BackendNodeID, nodeID cdp.NodeID, err error)
Do executes DOM.getFrameOwner against the provided context.
returns:
backendNodeID - Resulting node. nodeID - Id of the node at given coordinates, only when enabled and requested document.
type GetFrameOwnerReturns ¶
type GetFrameOwnerReturns struct {
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Resulting node.
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Id of the node at given coordinates, only when enabled and requested document.
}
GetFrameOwnerReturns return values.
type GetNodeForLocationParams ¶
type GetNodeForLocationParams struct {
X int64 `json:"x"` // X coordinate.
Y int64 `json:"y"` // Y coordinate.
IncludeUserAgentShadowDOM bool `json:"includeUserAgentShadowDOM"` // False to skip to the nearest non-UA shadow root ancestor (default: false).
IgnorePointerEventsNone bool `json:"ignorePointerEventsNone"` // Whether to ignore pointer-events: none on elements and hit test them.
}
GetNodeForLocationParams returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
func GetNodeForLocation ¶
func GetNodeForLocation(x int64, y int64) *GetNodeForLocationParams
GetNodeForLocation returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getNodeForLocation
parameters:
x - X coordinate. y - Y coordinate.
func (*GetNodeForLocationParams) Do ¶
func (p *GetNodeForLocationParams) Do(ctx context.Context) (backendNodeID cdp.BackendNodeID, frameID cdp.FrameID, nodeID cdp.NodeID, err error)
Do executes DOM.getNodeForLocation against the provided context.
returns:
backendNodeID - Resulting node. frameID - Frame this node belongs to. nodeID - Id of the node at given coordinates, only when enabled and requested document.
func (GetNodeForLocationParams) WithIgnorePointerEventsNone ¶
func (p GetNodeForLocationParams) WithIgnorePointerEventsNone(ignorePointerEventsNone bool) *GetNodeForLocationParams
WithIgnorePointerEventsNone whether to ignore pointer-events: none on elements and hit test them.
func (GetNodeForLocationParams) WithIncludeUserAgentShadowDOM ¶
func (p GetNodeForLocationParams) WithIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *GetNodeForLocationParams
WithIncludeUserAgentShadowDOM false to skip to the nearest non-UA shadow root ancestor (default: false).
type GetNodeForLocationReturns ¶
type GetNodeForLocationReturns struct {
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Resulting node.
FrameID cdp.FrameID `json:"frameId,omitempty,omitzero"` // Frame this node belongs to.
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Id of the node at given coordinates, only when enabled and requested document.
}
GetNodeForLocationReturns return values.
type GetNodeStackTracesParams ¶
type GetNodeStackTracesParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get stack traces for.
}
GetNodeStackTracesParams gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
func GetNodeStackTraces ¶
func GetNodeStackTraces(nodeID cdp.NodeID) *GetNodeStackTracesParams
GetNodeStackTraces gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getNodeStackTraces
parameters:
nodeID - Id of the node to get stack traces for.
func (*GetNodeStackTracesParams) Do ¶
func (p *GetNodeStackTracesParams) Do(ctx context.Context) (creation *runtime.StackTrace, err error)
Do executes DOM.getNodeStackTraces against the provided context.
returns:
creation - Creation stack trace, if available.
type GetNodeStackTracesReturns ¶
type GetNodeStackTracesReturns struct {
Creation *runtime.StackTrace `json:"creation,omitempty,omitzero"` // Creation stack trace, if available.
}
GetNodeStackTracesReturns return values.
type GetNodesForSubtreeByStyleParams ¶
type GetNodesForSubtreeByStyleParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Node ID pointing to the root of a subtree.
ComputedStyles []*CSSComputedStyleProperty `json:"computedStyles"` // The style to filter nodes by (includes nodes if any of properties matches).
Pierce bool `json:"pierce"` // Whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false).
}
GetNodesForSubtreeByStyleParams finds nodes with a given computed style in a subtree.
func GetNodesForSubtreeByStyle ¶
func GetNodesForSubtreeByStyle(nodeID cdp.NodeID, computedStyles []*CSSComputedStyleProperty) *GetNodesForSubtreeByStyleParams
GetNodesForSubtreeByStyle finds nodes with a given computed style in a subtree.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getNodesForSubtreeByStyle
parameters:
nodeID - Node ID pointing to the root of a subtree. computedStyles - The style to filter nodes by (includes nodes if any of properties matches).
func (*GetNodesForSubtreeByStyleParams) Do ¶
Do executes DOM.getNodesForSubtreeByStyle against the provided context.
returns:
nodeIDs - Resulting nodes.
func (GetNodesForSubtreeByStyleParams) WithPierce ¶
func (p GetNodesForSubtreeByStyleParams) WithPierce(pierce bool) *GetNodesForSubtreeByStyleParams
WithPierce whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false).
type GetNodesForSubtreeByStyleReturns ¶
type GetNodesForSubtreeByStyleReturns struct {
NodeIDs []cdp.NodeID `json:"nodeIds,omitempty,omitzero"` // Resulting nodes.
}
GetNodesForSubtreeByStyleReturns return values.
type GetOuterHTMLParams ¶
type GetOuterHTMLParams struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper.
IncludeShadowDOM bool `json:"includeShadowDOM"` // Include all shadow roots. Equals to false if not specified.
}
GetOuterHTMLParams returns node's HTML markup.
func GetOuterHTML ¶
func GetOuterHTML() *GetOuterHTMLParams
GetOuterHTML returns node's HTML markup.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getOuterHTML
parameters:
func (*GetOuterHTMLParams) Do ¶
func (p *GetOuterHTMLParams) Do(ctx context.Context) (outerHTML string, err error)
Do executes DOM.getOuterHTML against the provided context.
returns:
outerHTML - Outer HTML markup.
func (GetOuterHTMLParams) WithBackendNodeID ¶
func (p GetOuterHTMLParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *GetOuterHTMLParams
WithBackendNodeID identifier of the backend node.
func (GetOuterHTMLParams) WithIncludeShadowDOM ¶
func (p GetOuterHTMLParams) WithIncludeShadowDOM(includeShadowDOM bool) *GetOuterHTMLParams
WithIncludeShadowDOM include all shadow roots. Equals to false if not specified.
func (GetOuterHTMLParams) WithNodeID ¶
func (p GetOuterHTMLParams) WithNodeID(nodeID cdp.NodeID) *GetOuterHTMLParams
WithNodeID identifier of the node.
func (GetOuterHTMLParams) WithObjectID ¶
func (p GetOuterHTMLParams) WithObjectID(objectID runtime.RemoteObjectID) *GetOuterHTMLParams
WithObjectID JavaScript object id of the node wrapper.
type GetOuterHTMLReturns ¶
type GetOuterHTMLReturns struct {
OuterHTML string `json:"outerHTML,omitempty,omitzero"` // Outer HTML markup.
}
GetOuterHTMLReturns return values.
type GetQueryingDescendantsForContainerParams ¶
type GetQueryingDescendantsForContainerParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the container node to find querying descendants from.
}
GetQueryingDescendantsForContainerParams returns the descendants of a container query container that have container queries against this container.
func GetQueryingDescendantsForContainer ¶
func GetQueryingDescendantsForContainer(nodeID cdp.NodeID) *GetQueryingDescendantsForContainerParams
GetQueryingDescendantsForContainer returns the descendants of a container query container that have container queries against this container.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getQueryingDescendantsForContainer
parameters:
nodeID - Id of the container node to find querying descendants from.
func (*GetQueryingDescendantsForContainerParams) Do ¶
func (p *GetQueryingDescendantsForContainerParams) Do(ctx context.Context) (nodeIDs []cdp.NodeID, err error)
Do executes DOM.getQueryingDescendantsForContainer against the provided context.
returns:
nodeIDs - Descendant nodes with container queries against the given container.
type GetQueryingDescendantsForContainerReturns ¶
type GetQueryingDescendantsForContainerReturns struct {
NodeIDs []cdp.NodeID `json:"nodeIds,omitempty,omitzero"` // Descendant nodes with container queries against the given container.
}
GetQueryingDescendantsForContainerReturns return values.
type GetRelayoutBoundaryParams ¶
GetRelayoutBoundaryParams returns the id of the nearest ancestor that is a relayout boundary.
func GetRelayoutBoundary ¶
func GetRelayoutBoundary(nodeID cdp.NodeID) *GetRelayoutBoundaryParams
GetRelayoutBoundary returns the id of the nearest ancestor that is a relayout boundary.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getRelayoutBoundary
parameters:
nodeID - Id of the node.
type GetRelayoutBoundaryReturns ¶
type GetRelayoutBoundaryReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Relayout boundary node id for the given node.
}
GetRelayoutBoundaryReturns return values.
type GetSearchResultsParams ¶
type GetSearchResultsParams struct {
SearchID string `json:"searchId"` // Unique search session identifier.
FromIndex int64 `json:"fromIndex"` // Start index of the search result to be returned.
ToIndex int64 `json:"toIndex"` // End index of the search result to be returned.
}
GetSearchResultsParams returns search results from given fromIndex to given toIndex from the search with the given identifier.
func GetSearchResults ¶
func GetSearchResults(searchID string, fromIndex int64, toIndex int64) *GetSearchResultsParams
GetSearchResults returns search results from given fromIndex to given toIndex from the search with the given identifier.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getSearchResults
parameters:
searchID - Unique search session identifier. fromIndex - Start index of the search result to be returned. toIndex - End index of the search result to be returned.
type GetSearchResultsReturns ¶
type GetSearchResultsReturns struct {
NodeIDs []cdp.NodeID `json:"nodeIds,omitempty,omitzero"` // Ids of the search result nodes.
}
GetSearchResultsReturns return values.
type GetTopLayerElementsParams ¶
type GetTopLayerElementsParams struct{}
GetTopLayerElementsParams returns NodeIds of current top layer elements. Top layer is rendered closest to the user within a viewport, therefore its elements always appear on top of all other content.
func GetTopLayerElements ¶
func GetTopLayerElements() *GetTopLayerElementsParams
GetTopLayerElements returns NodeIds of current top layer elements. Top layer is rendered closest to the user within a viewport, therefore its elements always appear on top of all other content.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getTopLayerElements
type GetTopLayerElementsReturns ¶
type GetTopLayerElementsReturns struct {
NodeIDs []cdp.NodeID `json:"nodeIds,omitempty,omitzero"` // NodeIds of top layer elements
}
GetTopLayerElementsReturns return values.
type LogicalAxes ¶
type LogicalAxes string
LogicalAxes containerSelector logical axes.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-LogicalAxes
const ( LogicalAxesInline LogicalAxes = "Inline" LogicalAxesBlock LogicalAxes = "Block" LogicalAxesBoth LogicalAxes = "Both" )
LogicalAxes values.
func (LogicalAxes) String ¶
func (t LogicalAxes) String() string
String returns the LogicalAxes as string value.
func (*LogicalAxes) UnmarshalJSON ¶
func (t *LogicalAxes) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type MarkUndoableStateParams ¶
type MarkUndoableStateParams struct{}
MarkUndoableStateParams marks last undoable state.
func MarkUndoableState ¶
func MarkUndoableState() *MarkUndoableStateParams
MarkUndoableState marks last undoable state.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-markUndoableState
type MoveToParams ¶
type MoveToParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to move.
TargetNodeID cdp.NodeID `json:"targetNodeId"` // Id of the element to drop the moved node into.
InsertBeforeNodeID cdp.NodeID `json:"insertBeforeNodeId,omitempty,omitzero"` // Drop node before this one (if absent, the moved node becomes the last child of targetNodeId).
}
MoveToParams moves node into the new container, places it before the given anchor.
func MoveTo ¶
func MoveTo(nodeID cdp.NodeID, targetNodeID cdp.NodeID) *MoveToParams
MoveTo moves node into the new container, places it before the given anchor.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-moveTo
parameters:
nodeID - Id of the node to move. targetNodeID - Id of the element to drop the moved node into.
func (*MoveToParams) Do ¶
Do executes DOM.moveTo against the provided context.
returns:
nodeID - New id of the moved node.
func (MoveToParams) WithInsertBeforeNodeID ¶
func (p MoveToParams) WithInsertBeforeNodeID(insertBeforeNodeID cdp.NodeID) *MoveToParams
WithInsertBeforeNodeID drop node before this one (if absent, the moved node becomes the last child of targetNodeId).
type MoveToReturns ¶
type MoveToReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // New id of the moved node.
}
MoveToReturns return values.
type PerformSearchParams ¶
type PerformSearchParams struct {
Query string `json:"query"` // Plain text or query selector or XPath search query.
IncludeUserAgentShadowDOM bool `json:"includeUserAgentShadowDOM"` // True to search in user agent shadow DOM.
}
PerformSearchParams searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.
func PerformSearch ¶
func PerformSearch(query string) *PerformSearchParams
PerformSearch searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-performSearch
parameters:
query - Plain text or query selector or XPath search query.
func (*PerformSearchParams) Do ¶
func (p *PerformSearchParams) Do(ctx context.Context) (searchID string, resultCount int64, err error)
Do executes DOM.performSearch against the provided context.
returns:
searchID - Unique search session identifier. resultCount - Number of search results.
func (PerformSearchParams) WithIncludeUserAgentShadowDOM ¶
func (p PerformSearchParams) WithIncludeUserAgentShadowDOM(includeUserAgentShadowDOM bool) *PerformSearchParams
WithIncludeUserAgentShadowDOM true to search in user agent shadow DOM.
type PerformSearchReturns ¶
type PerformSearchReturns struct {
SearchID string `json:"searchId,omitempty,omitzero"` // Unique search session identifier.
ResultCount int64 `json:"resultCount,omitempty,omitzero"` // Number of search results.
}
PerformSearchReturns return values.
type PhysicalAxes ¶
type PhysicalAxes string
PhysicalAxes containerSelector physical axes.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-PhysicalAxes
const ( PhysicalAxesHorizontal PhysicalAxes = "Horizontal" PhysicalAxesVertical PhysicalAxes = "Vertical" PhysicalAxesBoth PhysicalAxes = "Both" )
PhysicalAxes values.
func (PhysicalAxes) String ¶
func (t PhysicalAxes) String() string
String returns the PhysicalAxes as string value.
func (*PhysicalAxes) UnmarshalJSON ¶
func (t *PhysicalAxes) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type PushNodeByPathToFrontendParams ¶
type PushNodeByPathToFrontendParams struct {
Path string `json:"path"` // Path to node in the proprietary format.
}
PushNodeByPathToFrontendParams requests that the node is sent to the caller given its path. // FIXME, use XPath.
func PushNodeByPathToFrontend ¶
func PushNodeByPathToFrontend(path string) *PushNodeByPathToFrontendParams
PushNodeByPathToFrontend requests that the node is sent to the caller given its path. // FIXME, use XPath.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-pushNodeByPathToFrontend
parameters:
path - Path to node in the proprietary format.
type PushNodeByPathToFrontendReturns ¶
type PushNodeByPathToFrontendReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Id of the node for given path.
}
PushNodeByPathToFrontendReturns return values.
type PushNodesByBackendIDsToFrontendParams ¶
type PushNodesByBackendIDsToFrontendParams struct {
BackendNodeIDs []cdp.BackendNodeID `json:"backendNodeIds"` // The array of backend node ids.
}
PushNodesByBackendIDsToFrontendParams requests that a batch of nodes is sent to the caller given their backend node ids.
func PushNodesByBackendIDsToFrontend ¶
func PushNodesByBackendIDsToFrontend(backendNodeIDs []cdp.BackendNodeID) *PushNodesByBackendIDsToFrontendParams
PushNodesByBackendIDsToFrontend requests that a batch of nodes is sent to the caller given their backend node ids.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-pushNodesByBackendIdsToFrontend
parameters:
backendNodeIDs - The array of backend node ids.
func (*PushNodesByBackendIDsToFrontendParams) Do ¶
func (p *PushNodesByBackendIDsToFrontendParams) Do(ctx context.Context) (nodeIDs []cdp.NodeID, err error)
Do executes DOM.pushNodesByBackendIdsToFrontend against the provided context.
returns:
nodeIDs - The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.
type PushNodesByBackendIDsToFrontendReturns ¶
type PushNodesByBackendIDsToFrontendReturns struct {
NodeIDs []cdp.NodeID `json:"nodeIds,omitempty,omitzero"` // The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.
}
PushNodesByBackendIDsToFrontendReturns return values.
type Quad ¶
type Quad []float64
Quad an array of quad vertices, x immediately followed by y for each point, points clock-wise.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-Quad
type QuerySelectorAllParams ¶
type QuerySelectorAllParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to query upon.
Selector string `json:"selector"` // Selector string.
}
QuerySelectorAllParams executes querySelectorAll on a given node.
func QuerySelectorAll ¶
func QuerySelectorAll(nodeID cdp.NodeID, selector string) *QuerySelectorAllParams
QuerySelectorAll executes querySelectorAll on a given node.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-querySelectorAll
parameters:
nodeID - Id of the node to query upon. selector - Selector string.
type QuerySelectorAllReturns ¶
type QuerySelectorAllReturns struct {
NodeIDs []cdp.NodeID `json:"nodeIds,omitempty,omitzero"` // Query selector result.
}
QuerySelectorAllReturns return values.
type QuerySelectorParams ¶
type QuerySelectorParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to query upon.
Selector string `json:"selector"` // Selector string.
}
QuerySelectorParams executes querySelector on a given node.
func QuerySelector ¶
func QuerySelector(nodeID cdp.NodeID, selector string) *QuerySelectorParams
QuerySelector executes querySelector on a given node.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-querySelector
parameters:
nodeID - Id of the node to query upon. selector - Selector string.
type QuerySelectorReturns ¶
type QuerySelectorReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Query selector result.
}
QuerySelectorReturns return values.
type Rect ¶
type Rect struct {
X float64 `json:"x"` // X coordinate
Y float64 `json:"y"` // Y coordinate
Width float64 `json:"width"` // Rectangle width
Height float64 `json:"height"` // Rectangle height
}
Rect Rectangle.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-Rect
type RedoParams ¶
type RedoParams struct{}
RedoParams re-does the last undone action.
func Redo ¶
func Redo() *RedoParams
Redo re-does the last undone action.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-redo
type RemoveAttributeParams ¶
type RemoveAttributeParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the element to remove attribute from.
Name string `json:"name"` // Name of the attribute to remove.
}
RemoveAttributeParams removes attribute with given name from an element with given id.
func RemoveAttribute ¶
func RemoveAttribute(nodeID cdp.NodeID, name string) *RemoveAttributeParams
RemoveAttribute removes attribute with given name from an element with given id.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-removeAttribute
parameters:
nodeID - Id of the element to remove attribute from. name - Name of the attribute to remove.
type RemoveNodeParams ¶
RemoveNodeParams removes node with given id.
func RemoveNode ¶
func RemoveNode(nodeID cdp.NodeID) *RemoveNodeParams
RemoveNode removes node with given id.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-removeNode
parameters:
nodeID - Id of the node to remove.
type RequestChildNodesParams ¶
type RequestChildNodesParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get children for.
Depth int64 `json:"depth,omitempty,omitzero"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
Pierce bool `json:"pierce"` // Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).
}
RequestChildNodesParams requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth.
func RequestChildNodes ¶
func RequestChildNodes(nodeID cdp.NodeID) *RequestChildNodesParams
RequestChildNodes requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-requestChildNodes
parameters:
nodeID - Id of the node to get children for.
func (*RequestChildNodesParams) Do ¶
func (p *RequestChildNodesParams) Do(ctx context.Context) (err error)
Do executes DOM.requestChildNodes against the provided context.
func (RequestChildNodesParams) WithDepth ¶
func (p RequestChildNodesParams) WithDepth(depth int64) *RequestChildNodesParams
WithDepth the maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
func (RequestChildNodesParams) WithPierce ¶
func (p RequestChildNodesParams) WithPierce(pierce bool) *RequestChildNodesParams
WithPierce whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).
type RequestNodeParams ¶
type RequestNodeParams struct {
ObjectID runtime.RemoteObjectID `json:"objectId"` // JavaScript object id to convert into node.
}
RequestNodeParams requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications.
func RequestNode ¶
func RequestNode(objectID runtime.RemoteObjectID) *RequestNodeParams
RequestNode requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-requestNode
parameters:
objectID - JavaScript object id to convert into node.
type RequestNodeReturns ¶
type RequestNodeReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Node id for given object.
}
RequestNodeReturns return values.
type ResolveNodeParams ¶
type ResolveNodeParams struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Id of the node to resolve.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Backend identifier of the node to resolve.
ObjectGroup string `json:"objectGroup,omitempty,omitzero"` // Symbolic group name that can be used to release multiple objects.
ExecutionContextID runtime.ExecutionContextID `json:"executionContextId,omitempty,omitzero"` // Execution context in which to resolve the node.
}
ResolveNodeParams resolves the JavaScript node object for a given NodeId or BackendNodeId.
func ResolveNode ¶
func ResolveNode() *ResolveNodeParams
ResolveNode resolves the JavaScript node object for a given NodeId or BackendNodeId.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-resolveNode
parameters:
func (*ResolveNodeParams) Do ¶
func (p *ResolveNodeParams) Do(ctx context.Context) (object *runtime.RemoteObject, err error)
Do executes DOM.resolveNode against the provided context.
returns:
object - JavaScript object wrapper for given node.
func (ResolveNodeParams) WithBackendNodeID ¶
func (p ResolveNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *ResolveNodeParams
WithBackendNodeID backend identifier of the node to resolve.
func (ResolveNodeParams) WithExecutionContextID ¶
func (p ResolveNodeParams) WithExecutionContextID(executionContextID runtime.ExecutionContextID) *ResolveNodeParams
WithExecutionContextID execution context in which to resolve the node.
func (ResolveNodeParams) WithNodeID ¶
func (p ResolveNodeParams) WithNodeID(nodeID cdp.NodeID) *ResolveNodeParams
WithNodeID ID of the node to resolve.
func (ResolveNodeParams) WithObjectGroup ¶
func (p ResolveNodeParams) WithObjectGroup(objectGroup string) *ResolveNodeParams
WithObjectGroup symbolic group name that can be used to release multiple objects.
type ResolveNodeReturns ¶
type ResolveNodeReturns struct {
Object *runtime.RemoteObject `json:"object,omitempty,omitzero"` // JavaScript object wrapper for given node.
}
ResolveNodeReturns return values.
type ScrollIntoViewIfNeededParams ¶
type ScrollIntoViewIfNeededParams struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper.
Rect *Rect `json:"rect,omitempty,omitzero"` // The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
}
ScrollIntoViewIfNeededParams scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
func ScrollIntoViewIfNeeded ¶
func ScrollIntoViewIfNeeded() *ScrollIntoViewIfNeededParams
ScrollIntoViewIfNeeded scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-scrollIntoViewIfNeeded
parameters:
func (*ScrollIntoViewIfNeededParams) Do ¶
func (p *ScrollIntoViewIfNeededParams) Do(ctx context.Context) (err error)
Do executes DOM.scrollIntoViewIfNeeded against the provided context.
func (ScrollIntoViewIfNeededParams) WithBackendNodeID ¶
func (p ScrollIntoViewIfNeededParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *ScrollIntoViewIfNeededParams
WithBackendNodeID identifier of the backend node.
func (ScrollIntoViewIfNeededParams) WithNodeID ¶
func (p ScrollIntoViewIfNeededParams) WithNodeID(nodeID cdp.NodeID) *ScrollIntoViewIfNeededParams
WithNodeID identifier of the node.
func (ScrollIntoViewIfNeededParams) WithObjectID ¶
func (p ScrollIntoViewIfNeededParams) WithObjectID(objectID runtime.RemoteObjectID) *ScrollIntoViewIfNeededParams
WithObjectID JavaScript object id of the node wrapper.
func (ScrollIntoViewIfNeededParams) WithRect ¶
func (p ScrollIntoViewIfNeededParams) WithRect(rect *Rect) *ScrollIntoViewIfNeededParams
WithRect the rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
type ScrollOrientation ¶
type ScrollOrientation string
ScrollOrientation physical scroll orientation.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-ScrollOrientation
const ( ScrollOrientationHorizontal ScrollOrientation = "horizontal" ScrollOrientationVertical ScrollOrientation = "vertical" )
ScrollOrientation values.
func (ScrollOrientation) String ¶
func (t ScrollOrientation) String() string
String returns the ScrollOrientation as string value.
func (*ScrollOrientation) UnmarshalJSON ¶
func (t *ScrollOrientation) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type SetAttributeValueParams ¶
type SetAttributeValueParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the element to set attribute for.
Name string `json:"name"` // Attribute name.
Value string `json:"value"` // Attribute value.
}
SetAttributeValueParams sets attribute for an element with given id.
func SetAttributeValue ¶
func SetAttributeValue(nodeID cdp.NodeID, name string, value string) *SetAttributeValueParams
SetAttributeValue sets attribute for an element with given id.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-setAttributeValue
parameters:
nodeID - Id of the element to set attribute for. name - Attribute name. value - Attribute value.
type SetAttributesAsTextParams ¶
type SetAttributesAsTextParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the element to set attributes for.
Text string `json:"text"` // Text with a number of attributes. Will parse this text using HTML parser.
Name string `json:"name,omitempty,omitzero"` // Attribute name to replace with new attributes derived from text in case text parsed successfully.
}
SetAttributesAsTextParams sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
func SetAttributesAsText ¶
func SetAttributesAsText(nodeID cdp.NodeID, text string) *SetAttributesAsTextParams
SetAttributesAsText sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-setAttributesAsText
parameters:
nodeID - Id of the element to set attributes for. text - Text with a number of attributes. Will parse this text using HTML parser.
func (*SetAttributesAsTextParams) Do ¶
func (p *SetAttributesAsTextParams) Do(ctx context.Context) (err error)
Do executes DOM.setAttributesAsText against the provided context.
func (SetAttributesAsTextParams) WithName ¶
func (p SetAttributesAsTextParams) WithName(name string) *SetAttributesAsTextParams
WithName attribute name to replace with new attributes derived from text in case text parsed successfully.
type SetFileInputFilesParams ¶
type SetFileInputFilesParams struct {
Files []string `json:"files"` // Array of file paths to set.
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // Identifier of the node.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty,omitzero"` // Identifier of the backend node.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty,omitzero"` // JavaScript object id of the node wrapper.
}
SetFileInputFilesParams sets files for the given file input element.
func SetFileInputFiles ¶
func SetFileInputFiles(files []string) *SetFileInputFilesParams
SetFileInputFiles sets files for the given file input element.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-setFileInputFiles
parameters:
files - Array of file paths to set.
func (*SetFileInputFilesParams) Do ¶
func (p *SetFileInputFilesParams) Do(ctx context.Context) (err error)
Do executes DOM.setFileInputFiles against the provided context.
func (SetFileInputFilesParams) WithBackendNodeID ¶
func (p SetFileInputFilesParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *SetFileInputFilesParams
WithBackendNodeID identifier of the backend node.
func (SetFileInputFilesParams) WithNodeID ¶
func (p SetFileInputFilesParams) WithNodeID(nodeID cdp.NodeID) *SetFileInputFilesParams
WithNodeID identifier of the node.
func (SetFileInputFilesParams) WithObjectID ¶
func (p SetFileInputFilesParams) WithObjectID(objectID runtime.RemoteObjectID) *SetFileInputFilesParams
WithObjectID JavaScript object id of the node wrapper.
type SetInspectedNodeParams ¶
type SetInspectedNodeParams struct {
NodeID cdp.NodeID `json:"nodeId"` // DOM node id to be accessible by means of $x command line API.
}
SetInspectedNodeParams enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
func SetInspectedNode ¶
func SetInspectedNode(nodeID cdp.NodeID) *SetInspectedNodeParams
SetInspectedNode enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-setInspectedNode
parameters:
nodeID - DOM node id to be accessible by means of $x command line API.
type SetNodeNameParams ¶
type SetNodeNameParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set name for.
Name string `json:"name"` // New node's name.
}
SetNodeNameParams sets node name for a node with given id.
func SetNodeName ¶
func SetNodeName(nodeID cdp.NodeID, name string) *SetNodeNameParams
SetNodeName sets node name for a node with given id.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-setNodeName
parameters:
nodeID - Id of the node to set name for. name - New node's name.
type SetNodeNameReturns ¶
type SetNodeNameReturns struct {
NodeID cdp.NodeID `json:"nodeId,omitempty,omitzero"` // New node's id.
}
SetNodeNameReturns return values.
type SetNodeStackTracesEnabledParams ¶
type SetNodeStackTracesEnabledParams struct {
Enable bool `json:"enable"` // Enable or disable.
}
SetNodeStackTracesEnabledParams sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.
func SetNodeStackTracesEnabled ¶
func SetNodeStackTracesEnabled(enable bool) *SetNodeStackTracesEnabledParams
SetNodeStackTracesEnabled sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-setNodeStackTracesEnabled
parameters:
enable - Enable or disable.
type SetNodeValueParams ¶
type SetNodeValueParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set value for.
Value string `json:"value"` // New node's value.
}
SetNodeValueParams sets node value for a node with given id.
func SetNodeValue ¶
func SetNodeValue(nodeID cdp.NodeID, value string) *SetNodeValueParams
SetNodeValue sets node value for a node with given id.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-setNodeValue
parameters:
nodeID - Id of the node to set value for. value - New node's value.
type SetOuterHTMLParams ¶
type SetOuterHTMLParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to set markup for.
OuterHTML string `json:"outerHTML"` // Outer HTML markup to set.
}
SetOuterHTMLParams sets node HTML markup, returns new node id.
func SetOuterHTML ¶
func SetOuterHTML(nodeID cdp.NodeID, outerHTML string) *SetOuterHTMLParams
SetOuterHTML sets node HTML markup, returns new node id.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-setOuterHTML
parameters:
nodeID - Id of the node to set markup for. outerHTML - Outer HTML markup to set.
type ShapeOutsideInfo ¶
type ShapeOutsideInfo struct {
Bounds Quad `json:"bounds"` // Shape bounds
Shape []jsontext.Value `json:"shape"` // Shape coordinate details
MarginShape []jsontext.Value `json:"marginShape"` // Margin shape bounds
}
ShapeOutsideInfo CSS Shape Outside details.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-ShapeOutsideInfo
type UndoParams ¶
type UndoParams struct{}
UndoParams undoes the last performed action.
func Undo ¶
func Undo() *UndoParams
Undo undoes the last performed action.
See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-undo