Interface DOMSnapshot


public interface DOMSnapshot
This domain facilitates obtaining document snapshots with DOM, layout, and style information.
  • Method Summary

    Modifier and Type
    Method
    Description
    captureSnapshot(List<String> computedStyles)
    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.
    captureSnapshot(List<String> computedStyles, Boolean includePaintOrder, Boolean includeDOMRects, Boolean includeBlendedBackgroundColors, Boolean includeTextColorOpacities)
    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.
    void
    Disables DOM snapshot agent for the given page.
    void
    Enables DOM snapshot agent for the given page.
    getSnapshot(List<String> computedStyleWhitelist)
    Deprecated.
    getSnapshot(List<String> computedStyleWhitelist, Boolean includeEventListeners, Boolean includePaintOrder, Boolean includeUserAgentShadowTree)
    Deprecated.
  • Method Details

    • captureSnapshot

      CaptureSnapshotResult captureSnapshot(List<String> computedStyles)
      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:
      computedStyles - Whitelist of computed styles to return.
      Returns:
      CaptureSnapshotResult
    • captureSnapshot

      CaptureSnapshotResult captureSnapshot(List<String> computedStyles, Boolean includePaintOrder, Boolean includeDOMRects, Boolean includeBlendedBackgroundColors, Boolean includeTextColorOpacities)
      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:
      computedStyles - Whitelist of computed styles to return.
      includePaintOrder - Whether to include layout object paint orders into the snapshot.
      includeDOMRects - Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
      includeBlendedBackgroundColors - 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.
      includeTextColorOpacities - 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.
      Returns:
      CaptureSnapshotResult
    • disable

      void disable()
      Disables DOM snapshot agent for the given page.
    • enable

      void enable()
      Enables DOM snapshot agent for the given page.
    • getSnapshot

      @Deprecated GetSnapshotResult getSnapshot(List<String> computedStyleWhitelist)
      Deprecated.
      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 - Whitelist of computed styles to return.
      Returns:
      GetSnapshotResult
    • getSnapshot

      @Deprecated GetSnapshotResult getSnapshot(List<String> computedStyleWhitelist, Boolean includeEventListeners, Boolean includePaintOrder, Boolean includeUserAgentShadowTree)
      Deprecated.
      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 - Whitelist of computed styles to return.
      includeEventListeners - Whether or not to retrieve details of DOM listeners (default false).
      includePaintOrder - Whether to determine and include the paint order index of LayoutTreeNodes (default false).
      includeUserAgentShadowTree - Whether to include UA shadow tree in the snapshot (default false).
      Returns:
      GetSnapshotResult