Interface Overlay


public interface Overlay
This domain provides various functionality related to drawing atop the inspected page.
  • Method Details

    • disable

      void disable()
      Disables domain notifications.
    • enable

      void enable()
      Enables domain notifications.
    • hideHighlight

      void hideHighlight()
      Hides any highlight.
    • highlightFrame

      @Deprecated void highlightFrame(String frameId)
      Deprecated.
      Highlights owner element of the frame with given id. Deprecated: Doesn't work reliablity and cannot be fixed due to process separatation (the owner node might be in a different process). Determine the owner node in the client and use highlightNode.
      Parameters:
      frameId - Identifier of the frame to highlight.
    • highlightFrame

      @Deprecated void highlightFrame(String frameId, RGBA contentColor, RGBA contentOutlineColor)
      Deprecated.
      Highlights owner element of the frame with given id. Deprecated: Doesn't work reliablity and cannot be fixed due to process separatation (the owner node might be in a different process). Determine the owner node in the client and use highlightNode.
      Parameters:
      frameId - Identifier of the frame to highlight.
      contentColor - The content box highlight fill color (default: transparent).
      contentOutlineColor - The content box highlight outline color (default: transparent).
    • highlightNode

      void highlightNode(HighlightConfig highlightConfig)
      Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
      Parameters:
      highlightConfig - A descriptor for the highlight appearance.
    • highlightNode

      void highlightNode(HighlightConfig highlightConfig, Integer nodeId, Integer backendNodeId, String objectId, String selector)
      Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
      Parameters:
      highlightConfig - A descriptor for the highlight appearance.
      nodeId - Identifier of the node to highlight.
      backendNodeId - Identifier of the backend node to highlight.
      objectId - JavaScript object id of the node to be highlighted.
      selector - Selectors to highlight relevant nodes.
    • highlightQuad

      void highlightQuad(List<Double> quad)
      Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
      Parameters:
      quad - Quad to highlight
    • highlightQuad

      void highlightQuad(List<Double> quad, RGBA color, RGBA outlineColor)
      Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
      Parameters:
      quad - Quad to highlight
      color - The highlight fill color (default: transparent).
      outlineColor - The highlight outline color (default: transparent).
    • highlightRect

      void highlightRect(Integer x, Integer y, Integer width, Integer height)
      Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
      Parameters:
      x - X coordinate
      y - Y coordinate
      width - Rectangle width
      height - Rectangle height
    • highlightRect

      void highlightRect(Integer x, Integer y, Integer width, Integer height, RGBA color, RGBA outlineColor)
      Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
      Parameters:
      x - X coordinate
      y - Y coordinate
      width - Rectangle width
      height - Rectangle height
      color - The highlight fill color (default: transparent).
      outlineColor - The highlight outline color (default: transparent).
    • highlightSourceOrder

      void highlightSourceOrder(SourceOrderConfig sourceOrderConfig)
      Highlights the source order of the children of the DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
      Parameters:
      sourceOrderConfig - A descriptor for the appearance of the overlay drawing.
    • highlightSourceOrder

      void highlightSourceOrder(SourceOrderConfig sourceOrderConfig, Integer nodeId, Integer backendNodeId, String objectId)
      Highlights the source order of the children of the DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
      Parameters:
      sourceOrderConfig - A descriptor for the appearance of the overlay drawing.
      nodeId - Identifier of the node to highlight.
      backendNodeId - Identifier of the backend node to highlight.
      objectId - JavaScript object id of the node to be highlighted.
    • setInspectMode

      void setInspectMode(InspectMode mode)
      Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.
      Parameters:
      mode - Set an inspection mode.
    • setInspectMode

      void setInspectMode(InspectMode mode, HighlightConfig highlightConfig)
      Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.
      Parameters:
      mode - Set an inspection mode.
      highlightConfig - A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false.
    • setPausedInDebuggerMessage

      void setPausedInDebuggerMessage()
    • setPausedInDebuggerMessage

      void setPausedInDebuggerMessage(String message)
    • setShowAdHighlights

      void setShowAdHighlights(Boolean show)
      Highlights owner element of all frames detected to be ads.
      Parameters:
      show - True for showing ad highlights
    • setShowContainerQueryOverlays

      void setShowContainerQueryOverlays(List<ContainerQueryHighlightConfig> containerQueryHighlightConfigs)
    • setShowDebugBorders

      void setShowDebugBorders(Boolean show)
      Requests that backend shows debug borders on layers
      Parameters:
      show - True for showing debug borders
    • setShowFPSCounter

      void setShowFPSCounter(Boolean show)
      Requests that backend shows the FPS counter
      Parameters:
      show - True for showing the FPS counter
    • setShowFlexOverlays

      void setShowFlexOverlays(List<FlexNodeHighlightConfig> flexNodeHighlightConfigs)
    • setShowGridOverlays

      void setShowGridOverlays(List<GridNodeHighlightConfig> gridNodeHighlightConfigs)
      Highlight multiple elements with the CSS Grid overlay.
      Parameters:
      gridNodeHighlightConfigs - An array of node identifiers and descriptors for the highlight appearance.
    • setShowHinge

      void setShowHinge()
      Add a dual screen device hinge
    • setShowHinge

      void setShowHinge(HingeConfig hingeConfig)
      Add a dual screen device hinge
      Parameters:
      hingeConfig - hinge data, null means hideHinge
    • setShowHitTestBorders

      @Deprecated void setShowHitTestBorders(Boolean show)
      Deprecated.
      Deprecated, no longer has any effect.
      Parameters:
      show - True for showing hit-test borders
    • setShowIsolatedElements

      void setShowIsolatedElements(List<IsolatedElementHighlightConfig> isolatedElementHighlightConfigs)
      Show elements in isolation mode with overlays.
      Parameters:
      isolatedElementHighlightConfigs - An array of node identifiers and descriptors for the highlight appearance.
    • setShowLayoutShiftRegions

      void setShowLayoutShiftRegions(Boolean result)
      Requests that backend shows layout shift regions
      Parameters:
      result - True for showing layout shift regions
    • setShowPaintRects

      void setShowPaintRects(Boolean result)
      Requests that backend shows paint rectangles
      Parameters:
      result - True for showing paint rectangles
    • setShowScrollBottleneckRects

      void setShowScrollBottleneckRects(Boolean show)
      Requests that backend shows scroll bottleneck rects
      Parameters:
      show - True for showing scroll bottleneck rects
    • setShowScrollSnapOverlays

      void setShowScrollSnapOverlays(List<ScrollSnapHighlightConfig> scrollSnapHighlightConfigs)
    • setShowViewportSizeOnResize

      void setShowViewportSizeOnResize(Boolean show)
      Paints viewport size upon main frame resize.
      Parameters:
      show - Whether to paint size or not.
    • setShowWebVitals

      void setShowWebVitals(Boolean show)
      Request that backend shows an overlay with web vital metrics.