stable (1.2) stable RC (1.3) latest (tip-of-tree) v8-inspector (node) Home
Domains
Accessibility Animation ApplicationCache Audits Browser CSS CacheStorage Console DOM DOMDebugger DOMSnapshot DOMStorage Database Debugger DeviceOrientation Emulation HeadlessExperimental HeapProfiler IO IndexedDB Input Inspector LayerTree Log Memory Network Overlay Page Performance Profiler Runtime Schema Security ServiceWorker Storage SystemInfo Target Tethering Tracing
Chrome DevTools Protocol Viewer - latest (tip-of-tree)

DOMSnapshot Domain

This domain facilitates obtaining document snapshots with DOM, layout, and style information.

Experimental

Methods

DOMSnapshot.getSnapshot

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.

Parameters
computedStyleWhitelist
array [string] Whitelist of computed styles to return.
Return object
domNodes
array [ DOMNode ] The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
layoutTreeNodes
array [ LayoutTreeNode ] The nodes in the layout tree.
computedStyles
array [ ComputedStyle ] Whitelisted ComputedStyle properties for each node in the layout tree.

Types

DOMNode

A Node in the DOM tree.

Type: object

Properties
nodeType
integer Node's nodeType.
nodeName
string Node's nodeName.
nodeValue
string Node's nodeValue.
textValue
string Only set for textarea elements, contains the text value.
inputValue
string Only set for input elements, contains the input's associated text value.
inputChecked
boolean Only set for radio and checkbox input elements, indicates if the element has been checked
optionSelected
boolean Only set for option elements, indicates if the element has been selected
backendNodeId
DOM.BackendNodeId Node's id, corresponds to DOM.Node.backendNodeId.
childNodeIndexes
array [integer] The indexes of the node's child nodes in the domNodes array returned by getSnapshot, if any.
attributes
array [ NameValue ] Attributes of an Element node.
pseudoElementIndexes
array [integer] Indexes of pseudo elements associated with this node in the domNodes array returned by getSnapshot, if any.
layoutNodeIndex
integer The index of the node's related layout tree node in the layoutTreeNodes array returned by getSnapshot, if any.
documentURL
string Document URL that Document or FrameOwner node points to.
baseURL
string Base URL that Document or FrameOwner node uses for URL completion.
contentLanguage
string Only set for documents, contains the document's content language.
documentEncoding
string Only set for documents, contains the document's character set encoding.
publicId
string DocumentType node's publicId.
systemId
string DocumentType node's systemId.
frameId
Page.FrameId Frame ID for frame owner elements and also for the document node.
contentDocumentIndex
integer The index of a frame owner element's content document in the domNodes array returned by getSnapshot, if any.
importedDocumentIndex
integer Index of the imported document's node of a link element in the domNodes array returned by getSnapshot, if any.
templateContentIndex
integer Index of the content node of a template element in the domNodes array returned by getSnapshot.
pseudoType
DOM.PseudoType Type of a pseudo element node.
isClickable
boolean 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.

InlineTextBox

Details of post layout rendered text positions. The exact layout should not be regarded as stable and may change between versions.

Type: object

Properties
boundingBox
DOM.Rect The absolute position bounding box.
startCharacterIndex
integer The starting index in characters, for this post layout textbox substring.
numCharacters
integer The number of characters in this post layout textbox substring.

LayoutTreeNode

Details of an element in the DOM tree with a LayoutObject.

Type: object

Properties
domNodeIndex
integer The index of the related DOM node in the domNodes array returned by getSnapshot.
boundingBox
DOM.Rect The absolute position bounding box.
layoutText
string Contents of the LayoutText, if any.
inlineTextNodes
array [ InlineTextBox ] The post-layout inline text nodes, if any.
styleIndex
integer Index into the computedStyles array returned by getSnapshot.

ComputedStyle

A subset of the full ComputedStyle as defined by the request whitelist.

Type: object

Properties
properties
array [ NameValue ] Name/value pairs of computed style properties.

NameValue

A name/value pair.

Type: object

Properties
name
string Attribute/property name.
value
string Attribute/property value.