getDocument

suspend fun getDocument(args: DOM.GetDocumentParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.GetDocumentReturn

Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.


suspend fun getDocument(depth: Int? = null, pierce: Boolean? = null): DOM.GetDocumentReturn

Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.

Parameters

depth

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

Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).