DOMSnapshotDomain

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

Official doc

Functions

Link copied to clipboard
inline suspend fun captureSnapshot(computedStyles: List<String>, optionalArgs: CaptureSnapshotRequest.Builder.() -> Unit = {}): CaptureSnapshotResponse

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.

Link copied to clipboard
suspend fun disable(): DisableResponse

Disables DOM snapshot agent for the given page.

Link copied to clipboard
suspend fun enable(): EnableResponse

Enables DOM snapshot agent for the given page.

Link copied to clipboard
inline suspend fun getSnapshot(computedStyleWhitelist: List<String>, optionalArgs: GetSnapshotRequest.Builder.() -> Unit = {}): GetSnapshotResponse

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.