Overlay Domain
This domain provides various functionality related to drawing atop the inspected page.
Methods
- Overlay.disable
- Overlay.enable
- Overlay.getGridHighlightObjectsForTest
- Overlay.getHighlightObjectForTest
- Overlay.getSourceOrderHighlightObjectForTest
- Overlay.hideHighlight
- Overlay.highlightNode
- Overlay.highlightQuad
- Overlay.highlightRect
- Overlay.highlightSourceOrder
- Overlay.setInspectMode
- Overlay.setPausedInDebuggerMessage
- Overlay.setShowAdHighlights
- Overlay.setShowContainerQueryOverlays
- Overlay.setShowDebugBorders
- Overlay.setShowFlexOverlays
- Overlay.setShowFPSCounter
- Overlay.setShowGridOverlays
- Overlay.setShowHinge
- Overlay.setShowIsolatedElements
- Overlay.setShowLayoutShiftRegions
- Overlay.setShowPaintRects
- Overlay.setShowScrollBottleneckRects
- Overlay.setShowScrollSnapOverlays
- Overlay.setShowViewportSizeOnResize
- Overlay.setShowWindowControlsOverlay
- Overlay.highlightFrame Deprecated
- Overlay.setShowHitTestBorders Deprecated
- Overlay.setShowWebVitals Deprecated
Events
- Overlay.inspectModeCanceled
- Overlay.inspectNodeRequested
- Overlay.nodeHighlightRequested
- Overlay.screenshotRequested
Types
- Overlay.BoxStyle
- Overlay.ColorFormat
- Overlay.ContainerQueryContainerHighlightConfig
- Overlay.ContainerQueryHighlightConfig
- Overlay.ContrastAlgorithm
- Overlay.FlexContainerHighlightConfig
- Overlay.FlexItemHighlightConfig
- Overlay.FlexNodeHighlightConfig
- Overlay.GridHighlightConfig
- Overlay.GridNodeHighlightConfig
- Overlay.HighlightConfig
- Overlay.HingeConfig
- Overlay.InspectMode
- Overlay.IsolatedElementHighlightConfig
- Overlay.IsolationModeHighlightConfig
- Overlay.LineStyle
- Overlay.ScrollSnapContainerHighlightConfig
- Overlay.ScrollSnapHighlightConfig
- Overlay.SourceOrderConfig
- Overlay.WindowControlsOverlayConfig
Methods
Overlay.getGridHighlightObjectsForTest #
For Persistent Grid testing.
Parameters
nodeIds array[ DOM.NodeId ]Ids of the node to get highlight object for.
Return object
highlights objectGrid Highlight data for the node ids provided.
Overlay.getHighlightObjectForTest #
For testing.
Parameters
nodeId Id of the node to get highlight object for.
includeDistanceOptional
booleanWhether to include distance info.
includeStyleOptional
booleanWhether to include style info.
colorFormatOptional
The color format to get config with (default: hex).
showAccessibilityInfoOptional
booleanWhether to show accessibility info (default: true).
Return object
highlight objectHighlight data for the node.
Overlay.getSourceOrderHighlightObjectForTest #
For Source Order Viewer testing.
Parameters
nodeId Id of the node to highlight.
Return object
highlight objectSource order highlight data for the node id provided.
Overlay.highlightNode #
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.
nodeIdOptional
Identifier of the node to highlight.
backendNodeIdOptional
Identifier of the backend node to highlight.
objectIdOptional
JavaScript object id of the node to be highlighted.
selectorOptional
stringSelectors to highlight relevant nodes.
Overlay.highlightQuad #
Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
Parameters
quad Quad to highlight
colorOptional
The highlight fill color (default: transparent).
outlineColorOptional
The highlight outline color (default: transparent).
Overlay.highlightRect #
Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport. Issue: the method does not handle device pixel ratio (DPR) correctly. The coordinates currently have to be adjusted by the client if DPR is not 1 (see crbug.com/437807128).
Parameters
x integerX coordinate
y integerY coordinate
width integerRectangle width
height integerRectangle height
colorOptional
The highlight fill color (default: transparent).
outlineColorOptional
The highlight outline color (default: transparent).
Overlay.highlightSourceOrder #
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.
nodeIdOptional
Identifier of the node to highlight.
backendNodeIdOptional
Identifier of the backend node to highlight.
objectIdOptional
JavaScript object id of the node to be highlighted.
Overlay.setInspectMode #
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.
highlightConfigOptional
A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false.
Overlay.setPausedInDebuggerMessage #
Parameters
messageOptional
stringThe message to display, also triggers resume and step over controls.
Overlay.setShowAdHighlights #
Highlights owner element of all frames detected to be ads.
Parameters
show booleanTrue for showing ad highlights
Overlay.setShowContainerQueryOverlays #
Parameters
containerQueryHighlightConfigs array[ ContainerQueryHighlightConfig ]An array of node identifiers and descriptors for the highlight appearance.
Overlay.setShowDebugBorders #
Requests that backend shows debug borders on layers
Parameters
show booleanTrue for showing debug borders
Overlay.setShowFlexOverlays #
Parameters
flexNodeHighlightConfigs array[ FlexNodeHighlightConfig ]An array of node identifiers and descriptors for the highlight appearance.
Overlay.setShowFPSCounter #
Requests that backend shows the FPS counter
Parameters
show booleanTrue for showing the FPS counter
Overlay.setShowGridOverlays #
Highlight multiple elements with the CSS Grid overlay.
Parameters
gridNodeHighlightConfigs array[ GridNodeHighlightConfig ]An array of node identifiers and descriptors for the highlight appearance.
Overlay.setShowHinge #
Add a dual screen device hinge
Parameters
hingeConfigOptional
hinge data, null means hideHinge
Overlay.setShowIsolatedElements #
Show elements in isolation mode with overlays.
Parameters
isolatedElementHighlightConfigs array[ IsolatedElementHighlightConfig ]An array of node identifiers and descriptors for the highlight appearance.
Overlay.setShowLayoutShiftRegions #
Requests that backend shows layout shift regions
Parameters
result booleanTrue for showing layout shift regions
Overlay.setShowPaintRects #
Requests that backend shows paint rectangles
Parameters
result booleanTrue for showing paint rectangles
Overlay.setShowScrollBottleneckRects #
Requests that backend shows scroll bottleneck rects
Parameters
show booleanTrue for showing scroll bottleneck rects
Overlay.setShowScrollSnapOverlays #
Parameters
scrollSnapHighlightConfigs array[ ScrollSnapHighlightConfig ]An array of node identifiers and descriptors for the highlight appearance.
Overlay.setShowViewportSizeOnResize #
Paints viewport size upon main frame resize.
Parameters
show booleanWhether to paint size or not.
Overlay.setShowWindowControlsOverlay #
Show Window Controls Overlay for PWA
Parameters
windowControlsOverlayConfigOptional
Window Controls Overlay data, null means hide Window Controls Overlay
Overlay.highlightFrame Deprecated#
Highlights owner element of the frame with given id. Deprecated: Doesn't work reliably and cannot be fixed due to process separation (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.
contentColorOptional
The content box highlight fill color (default: transparent).
contentOutlineColorOptional
The content box highlight outline color (default: transparent).
Overlay.setShowHitTestBorders Deprecated#
Deprecated, no longer has any effect.
Parameters
show booleanTrue for showing hit-test borders
Events
Overlay.inspectNodeRequested #
Fired when the node should be inspected. This happens after call to setInspectMode or when
user manually inspects an element.
Parameters
backendNodeId Id of the node to inspect.
Overlay.nodeHighlightRequested #
Fired when the node should be highlighted. This happens after call to setInspectMode.
Parameters
nodeId Overlay.screenshotRequested #
Fired when user asks to capture screenshot of some area on the page.
Parameters
viewport Viewport to capture, in device independent pixels (dip).
Types
Overlay.BoxStyle #
Style information for drawing a box.
Type: object
Properties
fillColorOptional
The background color for the box (default: transparent)
hatchColorOptional
The hatching color for the box (default: transparent)
Overlay.ContainerQueryContainerHighlightConfig #
Type: object
Properties
containerBorderOptional
The style of the container border.
descendantBorderOptional
The style of the descendants' borders.
Overlay.ContainerQueryHighlightConfig #
Type: object
Properties
containerQueryContainerHighlightConfig A descriptor for the highlight appearance of container query containers.
nodeId Identifier of the container node to highlight.
Overlay.FlexContainerHighlightConfig #
Configuration data for the highlighting of Flex container elements.
Type: object
Properties
containerBorderOptional
The style of the container border
lineSeparatorOptional
The style of the separator between lines
itemSeparatorOptional
The style of the separator between items
mainDistributedSpaceOptional
Style of content-distribution space on the main axis (justify-content).
crossDistributedSpaceOptional
Style of content-distribution space on the cross axis (align-content).
rowGapSpaceOptional
Style of empty space caused by row gaps (gap/row-gap).
columnGapSpaceOptional
Style of empty space caused by columns gaps (gap/column-gap).
crossAlignmentOptional
Style of the self-alignment line (align-items).
Overlay.FlexItemHighlightConfig #
Configuration data for the highlighting of Flex item elements.
Type: object
Properties
baseSizeBoxOptional
Style of the box representing the item's base size
baseSizeBorderOptional
Style of the border around the box representing the item's base size
flexibilityArrowOptional
Style of the arrow representing if the item grew or shrank
Overlay.FlexNodeHighlightConfig #
Type: object
Properties
flexContainerHighlightConfig A descriptor for the highlight appearance of flex containers.
nodeId Identifier of the node to highlight.
Overlay.GridHighlightConfig #
Configuration data for the highlighting of Grid elements.
Type: object
Properties
showGridExtensionLinesOptional
booleanWhether the extension lines from grid cells to the rulers should be shown (default: false).
showPositiveLineNumbersOptional
booleanShow Positive line number labels (default: false).
showNegativeLineNumbersOptional
booleanShow Negative line number labels (default: false).
showAreaNamesOptional
booleanShow area name labels (default: false).
showLineNamesOptional
booleanShow line name labels (default: false).
showTrackSizesOptional
booleanShow track size labels (default: false).
gridBorderColorOptional
The grid container border highlight color (default: transparent).
cellBorderColorOptional
The cell border color (default: transparent). Deprecated, please use rowLineColor and columnLineColor instead.
rowLineColorOptional
The row line color (default: transparent).
columnLineColorOptional
The column line color (default: transparent).
gridBorderDashOptional
booleanWhether the grid border is dashed (default: false).
cellBorderDashOptional
booleanWhether the cell border is dashed (default: false). Deprecated, please us rowLineDash and columnLineDash instead.
rowLineDashOptional
booleanWhether row lines are dashed (default: false).
columnLineDashOptional
booleanWhether column lines are dashed (default: false).
rowGapColorOptional
The row gap highlight fill color (default: transparent).
rowHatchColorOptional
The row gap hatching fill color (default: transparent).
columnGapColorOptional
The column gap highlight fill color (default: transparent).
columnHatchColorOptional
The column gap hatching fill color (default: transparent).
areaBorderColorOptional
The named grid areas border color (Default: transparent).
gridBackgroundColorOptional
The grid container background color (Default: transparent).
Overlay.GridNodeHighlightConfig #
Configurations for Persistent Grid Highlight
Type: object
Properties
gridHighlightConfig A descriptor for the highlight appearance.
nodeId Identifier of the node to highlight.
Overlay.HighlightConfig #
Configuration data for the highlighting of page elements.
Type: object
Properties
showInfoOptional
booleanWhether the node info tooltip should be shown (default: false).
showStylesOptional
booleanWhether the node styles in the tooltip (default: false).
showRulersOptional
booleanWhether the rulers should be shown (default: false).
showAccessibilityInfoOptional
booleanWhether the a11y info should be shown (default: true).
showExtensionLinesOptional
booleanWhether the extension lines from node to the rulers should be shown (default: false).
contentColorOptional
The content box highlight fill color (default: transparent).
paddingColorOptional
The padding highlight fill color (default: transparent).
borderColorOptional
The border highlight fill color (default: transparent).
marginColorOptional
The margin highlight fill color (default: transparent).
eventTargetColorOptional
The event target element highlight fill color (default: transparent).
shapeColorOptional
The shape outside fill color (default: transparent).
shapeMarginColorOptional
The shape margin fill color (default: transparent).
cssGridColorOptional
The grid layout color (default: transparent).
colorFormatOptional
The color format used to format color styles (default: hex).
gridHighlightConfigOptional
The grid layout highlight configuration (default: all transparent).
flexContainerHighlightConfigOptional
The flex container highlight configuration (default: all transparent).
flexItemHighlightConfigOptional
The flex item highlight configuration (default: all transparent).
contrastAlgorithmOptional
The contrast algorithm to use for the contrast ratio (default: aa).
containerQueryContainerHighlightConfigOptional
The container query container highlight configuration (default: all transparent).
Overlay.HingeConfig #
Configuration for dual screen hinge
Type: object
Properties
rect A rectangle represent hinge
contentColorOptional
The content box highlight fill color (default: a dark color).
outlineColorOptional
The content box highlight outline color (default: transparent).
Overlay.InspectMode #
Type: string
Allowed values: searchForNode, searchForUAShadowDOM, captureAreaScreenshot, none
Overlay.IsolatedElementHighlightConfig #
Type: object
Properties
isolationModeHighlightConfig A descriptor for the highlight appearance of an element in isolation mode.
nodeId Identifier of the isolated element to highlight.
Overlay.IsolationModeHighlightConfig #
Type: object
Properties
resizerColorOptional
The fill color of the resizers (default: transparent).
resizerHandleColorOptional
The fill color for resizer handles (default: transparent).
maskColorOptional
The fill color for the mask covering non-isolated elements (default: transparent).
Overlay.LineStyle #
Style information for drawing a line.
Type: object
Properties
colorOptional
The color of the line (default: transparent)
patternOptional
stringThe line pattern (default: solid)
Allowed values: dashed, dotted
Overlay.ScrollSnapContainerHighlightConfig #
Type: object
Properties
snapportBorderOptional
The style of the snapport border (default: transparent)
snapAreaBorderOptional
The style of the snap area border (default: transparent)
scrollMarginColorOptional
The margin highlight fill color (default: transparent).
scrollPaddingColorOptional
The padding highlight fill color (default: transparent).
Overlay.ScrollSnapHighlightConfig #
Type: object
Properties
scrollSnapContainerHighlightConfig A descriptor for the highlight appearance of scroll snap containers.
nodeId Identifier of the node to highlight.
Overlay.SourceOrderConfig #
Configuration data for drawing the source order of an elements children.
Type: object
Properties
parentOutlineColor the color to outline the given element in.
childOutlineColor the color to outline the child elements in.
Overlay.WindowControlsOverlayConfig #
Configuration for Window Controls Overlay
Type: object
Properties
showCSS booleanWhether the title bar CSS should be shown when emulating the Window Controls Overlay.
selectedPlatform stringSelected platforms to show the overlay.
themeColor stringThe theme color defined in app manifest.