clj-chrome-devtools.commands.dom-snapshot

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

capture-snapshot

(capture-snapshot)(capture-snapshot {:as params, :keys [computed-styles include-paint-order include-dom-rects include-blended-background-colors include-text-color-opacities]})(capture-snapshot connection {:as params, :keys [computed-styles include-paint-order include-dom-rects include-blended-background-colors include-text-color-opacities]})

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 map keys:

Key Description
:computed-styles Whitelist of computed styles to return.
:include-paint-order Whether to include layout object paint orders into the snapshot. (optional)
:include-dom-rects Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot (optional)
:include-blended-background-colors 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. (optional) :include-text-color-opacities | 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. (optional)

Return map keys:

Key Description
: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.

disable

(disable)(disable {:as params, :keys []})(disable connection {:as params, :keys []})

Disables DOM snapshot agent for the given page.

enable

(enable)(enable {:as params, :keys []})(enable connection {:as params, :keys []})

Enables DOM snapshot agent for the given page.

get-snapshot

(get-snapshot)(get-snapshot {:as params, :keys [computed-style-whitelist include-event-listeners include-paint-order include-user-agent-shadow-tree]})(get-snapshot connection {:as params, :keys [computed-style-whitelist include-event-listeners include-paint-order include-user-agent-shadow-tree]})

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 map keys:

Key Description
:computed-style-whitelist Whitelist of computed styles to return.
:include-event-listeners Whether or not to retrieve details of DOM listeners (default false). (optional)
:include-paint-order Whether to determine and include the paint order index of LayoutTreeNodes (default false). (optional)
:include-user-agent-shadow-tree Whether to include UA shadow tree in the snapshot (default false). (optional)

Return map keys:

Key Description
:dom-nodes The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
:layout-tree-nodes The nodes in the layout tree.
:computed-styles Whitelisted ComputedStyle properties for each node in the layout tree.