package domsnapshot

Import Path
	github.com/chromedp/cdproto/domsnapshot (on go.dev)

Dependency Relation
	imports 8 packages, and imported by one package

Involved Source Files Package domsnapshot provides the Chrome DevTools Protocol commands, types, and events for the DOMSnapshot domain. This domain facilitates obtaining document snapshots with DOM, layout, and style information. Generated by the cdproto-gen command. easyjson.go types.go
Package-Level Type Names (total 19)
/* sort by: | */
ArrayOfStrings index of the string in the strings table. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-ArrayOfStrings
CaptureSnapshotParams returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened. // Whitelist of computed styles to return. // Whether to include blended background colors in the snapshot (default: false). Blended background color is achieved by blending background colors of all elements that overlap with the current element. // Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot // Whether to include layout object paint orders into the snapshot. // Whether to include text color opacity in the snapshot (default: false). An element might have the opacity property set that affects the text color of the element. The final text color opacity is computed based on the opacity of all overlapping elements. Do executes DOMSnapshot.captureSnapshot against the provided context. returns: documents - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. strings - Shared string table that all string properties refer to with indexes. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface WithIncludeBlendedBackgroundColors whether to include blended background colors in the snapshot (default: false). Blended background color is achieved by blending background colors of all elements that overlap with the current element. WithIncludeDOMRects whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot. WithIncludePaintOrder whether to include layout object paint orders into the snapshot. WithIncludeTextColorOpacities whether to include text color opacity in the snapshot (default: false). An element might have the opacity property set that affects the text color of the element. The final text color opacity is computed based on the opacity of all overlapping elements. CaptureSnapshotParams : github.com/goccy/go-json.Marshaler *CaptureSnapshotParams : github.com/goccy/go-json.Unmarshaler CaptureSnapshotParams : github.com/mailru/easyjson.Marshaler *CaptureSnapshotParams : github.com/mailru/easyjson.MarshalerUnmarshaler *CaptureSnapshotParams : github.com/mailru/easyjson.Unmarshaler CaptureSnapshotParams : encoding/json.Marshaler *CaptureSnapshotParams : encoding/json.Unmarshaler func CaptureSnapshot(computedStyles []string) *CaptureSnapshotParams func CaptureSnapshotParams.WithIncludeBlendedBackgroundColors(includeBlendedBackgroundColors bool) *CaptureSnapshotParams func CaptureSnapshotParams.WithIncludeDOMRects(includeDOMRects bool) *CaptureSnapshotParams func CaptureSnapshotParams.WithIncludePaintOrder(includePaintOrder bool) *CaptureSnapshotParams func CaptureSnapshotParams.WithIncludeTextColorOpacities(includeTextColorOpacities bool) *CaptureSnapshotParams
CaptureSnapshotReturns return values. // The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. // Shared string table that all string properties refer to with indexes. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface CaptureSnapshotReturns : github.com/goccy/go-json.Marshaler *CaptureSnapshotReturns : github.com/goccy/go-json.Unmarshaler CaptureSnapshotReturns : github.com/mailru/easyjson.Marshaler *CaptureSnapshotReturns : github.com/mailru/easyjson.MarshalerUnmarshaler *CaptureSnapshotReturns : github.com/mailru/easyjson.Unmarshaler CaptureSnapshotReturns : encoding/json.Marshaler *CaptureSnapshotReturns : encoding/json.Unmarshaler
ComputedStyle a subset of the full ComputedStyle as defined by the request whitelist. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-ComputedStyle // Name/value pairs of computed style properties. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface ComputedStyle : github.com/goccy/go-json.Marshaler *ComputedStyle : github.com/goccy/go-json.Unmarshaler ComputedStyle : github.com/mailru/easyjson.Marshaler *ComputedStyle : github.com/mailru/easyjson.MarshalerUnmarshaler *ComputedStyle : github.com/mailru/easyjson.Unmarshaler ComputedStyle : encoding/json.Marshaler *ComputedStyle : encoding/json.Unmarshaler
DisableParams disables DOM snapshot agent for the given page. Do executes DOMSnapshot.disable against the provided context. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface *DisableParams : github.com/chromedp/chromedp.Action *DisableParams : github.com/chromedp/chromedp.CallAction *DisableParams : github.com/chromedp/chromedp.EmulateAction *DisableParams : github.com/chromedp/chromedp.EvaluateAction *DisableParams : github.com/chromedp/chromedp.KeyAction *DisableParams : github.com/chromedp/chromedp.MouseAction *DisableParams : github.com/chromedp/chromedp.NavigateAction *DisableParams : github.com/chromedp/chromedp.PollAction *DisableParams : github.com/chromedp/chromedp.QueryAction DisableParams : github.com/goccy/go-json.Marshaler *DisableParams : github.com/goccy/go-json.Unmarshaler DisableParams : github.com/mailru/easyjson.Marshaler *DisableParams : github.com/mailru/easyjson.MarshalerUnmarshaler *DisableParams : github.com/mailru/easyjson.Unmarshaler DisableParams : encoding/json.Marshaler *DisableParams : encoding/json.Unmarshaler func Disable() *DisableParams
DocumentSnapshot document snapshot. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-DocumentSnapshot // Base URL that Document or FrameOwner node uses for URL completion. // Document content height. // Contains the document's content language. // Document content width. // Document URL that Document or FrameOwner node points to. // Contains the document's character set encoding. // Frame ID for frame owner elements and also for the document node. // The nodes in the layout tree. // A table with dom nodes. // DocumentType node's publicId. // Horizontal scroll offset. // Vertical scroll offset. // DocumentType node's systemId. // The post-layout inline text nodes. // Document title. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface DocumentSnapshot : github.com/goccy/go-json.Marshaler *DocumentSnapshot : github.com/goccy/go-json.Unmarshaler DocumentSnapshot : github.com/mailru/easyjson.Marshaler *DocumentSnapshot : github.com/mailru/easyjson.MarshalerUnmarshaler *DocumentSnapshot : github.com/mailru/easyjson.Unmarshaler DocumentSnapshot : encoding/json.Marshaler *DocumentSnapshot : encoding/json.Unmarshaler func (*CaptureSnapshotParams).Do(ctx context.Context) (documents []*DocumentSnapshot, strings []string, err error)
DOMNode a Node in the DOM tree. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-DOMNode // Attributes of an Element node. // Node's id, corresponds to DOM.Node.backendNodeId. // Base URL that Document or FrameOwner node uses for URL completion. // The indexes of the node's child nodes in the domNodes array returned by getSnapshot, if any. // The index of a frame owner element's content document in the domNodes array returned by getSnapshot, if any. // Only set for documents, contains the document's content language. // The selected url for nodes with a srcset attribute. // Only set for documents, contains the document's character set encoding. // Document URL that Document or FrameOwner node points to. // Details of the node's event listeners, if any. // Frame ID for frame owner elements and also for the document node. // Only set for radio and checkbox input elements, indicates if the element has been checked // Only set for input elements, contains the input's associated text value. // Whether this DOM node responds to mouse clicks. This includes nodes that have had click event listeners attached via JavaScript as well as anchor tags that naturally navigate when clicked. // The index of the node's related layout tree node in the layoutTreeNodes array returned by getSnapshot, if any. // Node's nodeName. // Node's nodeType. // Node's nodeValue. // Only set for option elements, indicates if the element has been selected // The url of the script (if any) that generates this node. // Indexes of pseudo elements associated with this node in the domNodes array returned by getSnapshot, if any. // Type of a pseudo element node. // DocumentType node's publicId. // Scroll offsets, set when this node is a Document. ScrollOffsetY float64 // Shadow root type. // DocumentType node's systemId. // Only set for textarea elements, contains the text value. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface DOMNode : github.com/goccy/go-json.Marshaler *DOMNode : github.com/goccy/go-json.Unmarshaler DOMNode : github.com/mailru/easyjson.Marshaler *DOMNode : github.com/mailru/easyjson.MarshalerUnmarshaler *DOMNode : github.com/mailru/easyjson.Unmarshaler DOMNode : encoding/json.Marshaler *DOMNode : encoding/json.Unmarshaler
EnableParams enables DOM snapshot agent for the given page. Do executes DOMSnapshot.enable against the provided context. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface *EnableParams : github.com/chromedp/chromedp.Action *EnableParams : github.com/chromedp/chromedp.CallAction *EnableParams : github.com/chromedp/chromedp.EmulateAction *EnableParams : github.com/chromedp/chromedp.EvaluateAction *EnableParams : github.com/chromedp/chromedp.KeyAction *EnableParams : github.com/chromedp/chromedp.MouseAction *EnableParams : github.com/chromedp/chromedp.NavigateAction *EnableParams : github.com/chromedp/chromedp.PollAction *EnableParams : github.com/chromedp/chromedp.QueryAction EnableParams : github.com/goccy/go-json.Marshaler *EnableParams : github.com/goccy/go-json.Unmarshaler EnableParams : github.com/mailru/easyjson.Marshaler *EnableParams : github.com/mailru/easyjson.MarshalerUnmarshaler *EnableParams : github.com/mailru/easyjson.Unmarshaler EnableParams : encoding/json.Marshaler *EnableParams : encoding/json.Unmarshaler func Enable() *EnableParams
InlineTextBox details of post layout rendered text positions. The exact layout should not be regarded as stable and may change between versions. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-InlineTextBox // The bounding box in document coordinates. Note that scroll offset of the document is ignored. // The number of characters in this post layout textbox substring. Characters that would be represented as a surrogate pair in UTF-16 have length 2. // The starting index in characters, for this post layout textbox substring. Characters that would be represented as a surrogate pair in UTF-16 have length 2. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface InlineTextBox : github.com/goccy/go-json.Marshaler *InlineTextBox : github.com/goccy/go-json.Unmarshaler InlineTextBox : github.com/mailru/easyjson.Marshaler *InlineTextBox : github.com/mailru/easyjson.MarshalerUnmarshaler *InlineTextBox : github.com/mailru/easyjson.Unmarshaler InlineTextBox : encoding/json.Marshaler *InlineTextBox : encoding/json.Unmarshaler
LayoutTreeNode details of an element in the DOM tree with a LayoutObject. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-LayoutTreeNode // The bounding box in document coordinates. Note that scroll offset of the document is ignored. // The index of the related DOM node in the domNodes array returned by getSnapshot. // The post-layout inline text nodes, if any. // Set to true to indicate the element begins a new stacking context. // Contents of the LayoutText, if any. // Global paint order index, which is determined by the stacking order of the nodes. Nodes that are painted together will have the same index. Only provided if includePaintOrder in getSnapshot was true. // Index into the computedStyles array returned by getSnapshot. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface LayoutTreeNode : github.com/goccy/go-json.Marshaler *LayoutTreeNode : github.com/goccy/go-json.Unmarshaler LayoutTreeNode : github.com/mailru/easyjson.Marshaler *LayoutTreeNode : github.com/mailru/easyjson.MarshalerUnmarshaler *LayoutTreeNode : github.com/mailru/easyjson.Unmarshaler LayoutTreeNode : encoding/json.Marshaler *LayoutTreeNode : encoding/json.Unmarshaler
LayoutTreeSnapshot table of details of an element in the DOM tree with a LayoutObject. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-LayoutTreeSnapshot // The list of background colors that are blended with colors of overlapping elements. // The absolute position bounding box. // The client rect of nodes. Only available when includeDOMRects is set to true // Index of the corresponding node in the NodeTreeSnapshot array returned by captureSnapshot. // The offset rect of nodes. Only available when includeDOMRects is set to true // Global paint order index, which is determined by the stacking order of the nodes. Nodes that are painted together will have the same index. Only provided if includePaintOrder in captureSnapshot was true. // The scroll rect of nodes. Only available when includeDOMRects is set to true // Stacking context information. // Array of indexes specifying computed style strings, filtered according to the computedStyles parameter passed to captureSnapshot. // Contents of the LayoutText, if any. // The list of computed text opacities. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface LayoutTreeSnapshot : github.com/goccy/go-json.Marshaler *LayoutTreeSnapshot : github.com/goccy/go-json.Unmarshaler LayoutTreeSnapshot : github.com/mailru/easyjson.Marshaler *LayoutTreeSnapshot : github.com/mailru/easyjson.MarshalerUnmarshaler *LayoutTreeSnapshot : github.com/mailru/easyjson.Unmarshaler LayoutTreeSnapshot : encoding/json.Marshaler *LayoutTreeSnapshot : encoding/json.Unmarshaler
NameValue a name/value pair. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-NameValue // address field name, for example GIVEN_NAME. // address field value, for example Jon Doe. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface NameValue : github.com/goccy/go-json.Marshaler *NameValue : github.com/goccy/go-json.Unmarshaler NameValue : github.com/mailru/easyjson.Marshaler *NameValue : github.com/mailru/easyjson.MarshalerUnmarshaler *NameValue : github.com/mailru/easyjson.Unmarshaler NameValue : encoding/json.Marshaler *NameValue : encoding/json.Unmarshaler
NodeTreeSnapshot table containing nodes. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-NodeTreeSnapshot // Attributes of an Element node. Flatten name, value pairs. // Node's id, corresponds to DOM.Node.backendNodeId. // The index of the document in the list of the snapshot documents. // The selected url for nodes with a srcset attribute. // Only set for radio and checkbox input elements, indicates if the element has been checked // Only set for input elements, contains the input's associated text value. // Whether this DOM node responds to mouse clicks. This includes nodes that have had click event listeners attached via JavaScript as well as anchor tags that naturally navigate when clicked. // Node's nodeName. // Node's nodeType. // Node's nodeValue. // Only set for option elements, indicates if the element has been selected // The url of the script (if any) that generates this node. // Parent node index. // Pseudo element identifier for this node. Only present if there is a valid pseudoType. // Type of a pseudo element node. // Type of the shadow root the Node is in. String values are equal to the ShadowRootType enum. // Only set for textarea elements, contains the text value. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface NodeTreeSnapshot : github.com/goccy/go-json.Marshaler *NodeTreeSnapshot : github.com/goccy/go-json.Unmarshaler NodeTreeSnapshot : github.com/mailru/easyjson.Marshaler *NodeTreeSnapshot : github.com/mailru/easyjson.MarshalerUnmarshaler *NodeTreeSnapshot : github.com/mailru/easyjson.Unmarshaler NodeTreeSnapshot : encoding/json.Marshaler *NodeTreeSnapshot : encoding/json.Unmarshaler
RareBooleanData [no description]. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-RareBooleanData Index []int64 MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface RareBooleanData : github.com/goccy/go-json.Marshaler *RareBooleanData : github.com/goccy/go-json.Unmarshaler RareBooleanData : github.com/mailru/easyjson.Marshaler *RareBooleanData : github.com/mailru/easyjson.MarshalerUnmarshaler *RareBooleanData : github.com/mailru/easyjson.Unmarshaler RareBooleanData : encoding/json.Marshaler *RareBooleanData : encoding/json.Unmarshaler
RareIntegerData [no description]. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-RareIntegerData Index []int64 Value []int64 MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface RareIntegerData : github.com/goccy/go-json.Marshaler *RareIntegerData : github.com/goccy/go-json.Unmarshaler RareIntegerData : github.com/mailru/easyjson.Marshaler *RareIntegerData : github.com/mailru/easyjson.MarshalerUnmarshaler *RareIntegerData : github.com/mailru/easyjson.Unmarshaler RareIntegerData : encoding/json.Marshaler *RareIntegerData : encoding/json.Unmarshaler
RareStringData data that is only present on rare nodes. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-RareStringData Index []int64 Value []StringIndex MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface RareStringData : github.com/goccy/go-json.Marshaler *RareStringData : github.com/goccy/go-json.Unmarshaler RareStringData : github.com/mailru/easyjson.Marshaler *RareStringData : github.com/mailru/easyjson.MarshalerUnmarshaler *RareStringData : github.com/mailru/easyjson.Unmarshaler RareStringData : encoding/json.Marshaler *RareStringData : encoding/json.Unmarshaler
StringIndex index of the string in the strings table. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-StringIndex Int64 returns the StringIndex as int64 value.
TextBoxSnapshot table of details of the post layout rendered text positions. The exact layout should not be regarded as stable and may change between versions. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-TextBoxSnapshot // The absolute position bounding box. // Index of the layout tree node that owns this box collection. // The number of characters in this post layout textbox substring. Characters that would be represented as a surrogate pair in UTF-16 have length 2. // The starting index in characters, for this post layout textbox substring. Characters that would be represented as a surrogate pair in UTF-16 have length 2. MarshalEasyJSON supports easyjson.Marshaler interface MarshalJSON supports json.Marshaler interface UnmarshalEasyJSON supports easyjson.Unmarshaler interface UnmarshalJSON supports json.Unmarshaler interface TextBoxSnapshot : github.com/goccy/go-json.Marshaler *TextBoxSnapshot : github.com/goccy/go-json.Unmarshaler TextBoxSnapshot : github.com/mailru/easyjson.Marshaler *TextBoxSnapshot : github.com/mailru/easyjson.MarshalerUnmarshaler *TextBoxSnapshot : github.com/mailru/easyjson.Unmarshaler TextBoxSnapshot : encoding/json.Marshaler *TextBoxSnapshot : encoding/json.Unmarshaler
Package-Level Functions (total 3)
CaptureSnapshot returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#method-captureSnapshot parameters: computedStyles - Whitelist of computed styles to return.
Disable disables DOM snapshot agent for the given page. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#method-disable
Enable enables DOM snapshot agent for the given page. See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#method-enable
Package-Level Constants (total 3)
Command names.
Command names.
Command names.