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.

{
  "name": "getSnapshot",
  "parameters": [
    {
      "name": "computedStyleWhitelist",
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Whitelist of computed styles to return."
    }
  ],
  "returns": [
    {
      "name": "domNodes",
      "type": "array",
      "items": {
        "$ref": "DOMNode"
      },
      "description": "The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document."
    },
    {
      "name": "layoutTreeNodes",
      "type": "array",
      "items": {
        "$ref": "LayoutTreeNode"
      },
      "description": "The nodes in the layout tree."
    },
    {
      "name": "computedStyles",
      "type": "array",
      "items": {
        "$ref": "ComputedStyle"
      },
      "description": "Whitelisted ComputedStyle properties for each node in the layout tree."
    }
  ],
  "description": "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. "
}