Overlay

class Overlay(cdp: CDP) : Domain

This domain provides various functionality related to drawing atop the inspected page.

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class BoxStyle(val fillColor: DOM.RGBA? = null, val hatchColor: DOM.RGBA? = null)

Style information for drawing a box.

Link copied to clipboard
@Serializable
enum ColorFormat : Enum<Overlay.ColorFormat>
Link copied to clipboard
@Serializable
data class ContainerQueryContainerHighlightConfig(val containerBorder: Overlay.LineStyle? = null, val descendantBorder: Overlay.LineStyle? = null)
Link copied to clipboard
@Serializable
data class ContainerQueryHighlightConfig(val containerQueryContainerHighlightConfig: Overlay.ContainerQueryContainerHighlightConfig, val nodeId: Int)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class FlexContainerHighlightConfig(val containerBorder: Overlay.LineStyle? = null, val lineSeparator: Overlay.LineStyle? = null, val itemSeparator: Overlay.LineStyle? = null, val mainDistributedSpace: Overlay.BoxStyle? = null, val crossDistributedSpace: Overlay.BoxStyle? = null, val rowGapSpace: Overlay.BoxStyle? = null, val columnGapSpace: Overlay.BoxStyle? = null, val crossAlignment: Overlay.LineStyle? = null)

Configuration data for the highlighting of Flex container elements.

Link copied to clipboard
@Serializable
data class FlexItemHighlightConfig(val baseSizeBox: Overlay.BoxStyle? = null, val baseSizeBorder: Overlay.LineStyle? = null, val flexibilityArrow: Overlay.LineStyle? = null)

Configuration data for the highlighting of Flex item elements.

Link copied to clipboard
@Serializable
data class FlexNodeHighlightConfig(val flexContainerHighlightConfig: Overlay.FlexContainerHighlightConfig, val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetGridHighlightObjectsForTestParameter(val nodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class GetGridHighlightObjectsForTestReturn(val highlights: Map<String, JsonElement>)
Link copied to clipboard
@Serializable
data class GetHighlightObjectForTestParameter(val nodeId: Int, val includeDistance: Boolean? = null, val includeStyle: Boolean? = null, val colorFormat: Overlay.ColorFormat? = null, val showAccessibilityInfo: Boolean? = null)
Link copied to clipboard
@Serializable
data class GetHighlightObjectForTestReturn(val highlight: Map<String, JsonElement>)
@Serializable
data class GetSourceOrderHighlightObjectForTestParameter(val nodeId: Int)
@Serializable
data class GetSourceOrderHighlightObjectForTestReturn(val highlight: Map<String, JsonElement>)
Link copied to clipboard
@Serializable
data class GridHighlightConfig(val showGridExtensionLines: Boolean? = null, val showPositiveLineNumbers: Boolean? = null, val showNegativeLineNumbers: Boolean? = null, val showAreaNames: Boolean? = null, val showLineNames: Boolean? = null, val showTrackSizes: Boolean? = null, val gridBorderColor: DOM.RGBA? = null, val cellBorderColor: DOM.RGBA? = null, val rowLineColor: DOM.RGBA? = null, val columnLineColor: DOM.RGBA? = null, val gridBorderDash: Boolean? = null, val cellBorderDash: Boolean? = null, val rowLineDash: Boolean? = null, val columnLineDash: Boolean? = null, val rowGapColor: DOM.RGBA? = null, val rowHatchColor: DOM.RGBA? = null, val columnGapColor: DOM.RGBA? = null, val columnHatchColor: DOM.RGBA? = null, val areaBorderColor: DOM.RGBA? = null, val gridBackgroundColor: DOM.RGBA? = null)

Configuration data for the highlighting of Grid elements.

Link copied to clipboard
@Serializable
data class GridNodeHighlightConfig(val gridHighlightConfig: Overlay.GridHighlightConfig, val nodeId: Int)

Configurations for Persistent Grid Highlight

Link copied to clipboard
@Serializable
data class HighlightConfig(val showInfo: Boolean? = null, val showStyles: Boolean? = null, val showRulers: Boolean? = null, val showAccessibilityInfo: Boolean? = null, val showExtensionLines: Boolean? = null, val contentColor: DOM.RGBA? = null, val paddingColor: DOM.RGBA? = null, val borderColor: DOM.RGBA? = null, val marginColor: DOM.RGBA? = null, val eventTargetColor: DOM.RGBA? = null, val shapeColor: DOM.RGBA? = null, val shapeMarginColor: DOM.RGBA? = null, val cssGridColor: DOM.RGBA? = null, val colorFormat: Overlay.ColorFormat? = null, val gridHighlightConfig: Overlay.GridHighlightConfig? = null, val flexContainerHighlightConfig: Overlay.FlexContainerHighlightConfig? = null, val flexItemHighlightConfig: Overlay.FlexItemHighlightConfig? = null, val contrastAlgorithm: Overlay.ContrastAlgorithm? = null, val containerQueryContainerHighlightConfig: Overlay.ContainerQueryContainerHighlightConfig? = null)

Configuration data for the highlighting of page elements.

Link copied to clipboard
@Serializable
data class HighlightFrameParameter(val frameId: String, val contentColor: DOM.RGBA? = null, val contentOutlineColor: DOM.RGBA? = null)
Link copied to clipboard
@Serializable
data class HighlightNodeParameter(val highlightConfig: Overlay.HighlightConfig, val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null, val selector: String? = null)
Link copied to clipboard
@Serializable
data class HighlightQuadParameter(val quad: List<Double>, val color: DOM.RGBA? = null, val outlineColor: DOM.RGBA? = null)
Link copied to clipboard
@Serializable
data class HighlightRectParameter(val x: Int, val y: Int, val width: Int, val height: Int, val color: DOM.RGBA? = null, val outlineColor: DOM.RGBA? = null)
Link copied to clipboard
@Serializable
data class HighlightSourceOrderParameter(val sourceOrderConfig: Overlay.SourceOrderConfig, val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null)
Link copied to clipboard
@Serializable
data class HingeConfig(val rect: DOM.Rect, val contentColor: DOM.RGBA? = null, val outlineColor: DOM.RGBA? = null)

Configuration for dual screen hinge

Link copied to clipboard
@Serializable
enum InspectMode : Enum<Overlay.InspectMode>
Link copied to clipboard
@Serializable
data class InspectNodeRequestedParameter(val backendNodeId: Int)

Fired when the node should be inspected. This happens after call to setInspectMode or when user manually inspects an element.

Link copied to clipboard
@Serializable
data class IsolatedElementHighlightConfig(val isolationModeHighlightConfig: Overlay.IsolationModeHighlightConfig, val nodeId: Int)
Link copied to clipboard
@Serializable
data class IsolationModeHighlightConfig(val resizerColor: DOM.RGBA? = null, val resizerHandleColor: DOM.RGBA? = null, val maskColor: DOM.RGBA? = null)
Link copied to clipboard
@Serializable
data class LineStyle(val color: DOM.RGBA? = null, val pattern: String? = null)

Style information for drawing a line.

Link copied to clipboard
@Serializable
data class NodeHighlightRequestedParameter(val nodeId: Int)

Fired when the node should be highlighted. This happens after call to setInspectMode.

Link copied to clipboard
@Serializable
data class ScreenshotRequestedParameter(val viewport: Page.Viewport)

Fired when user asks to capture screenshot of some area on the page.

Link copied to clipboard
@Serializable
data class ScrollSnapContainerHighlightConfig(val snapportBorder: Overlay.LineStyle? = null, val snapAreaBorder: Overlay.LineStyle? = null, val scrollMarginColor: DOM.RGBA? = null, val scrollPaddingColor: DOM.RGBA? = null)
Link copied to clipboard
@Serializable
data class ScrollSnapHighlightConfig(val scrollSnapContainerHighlightConfig: Overlay.ScrollSnapContainerHighlightConfig, val nodeId: Int)
Link copied to clipboard
@Serializable
data class SetInspectModeParameter(val mode: Overlay.InspectMode, val highlightConfig: Overlay.HighlightConfig? = null)
Link copied to clipboard
@Serializable
data class SetPausedInDebuggerMessageParameter(val message: String? = null)
Link copied to clipboard
@Serializable
data class SetShowAdHighlightsParameter(val show: Boolean)
Link copied to clipboard
@Serializable
data class SetShowContainerQueryOverlaysParameter(val containerQueryHighlightConfigs: List<Overlay.ContainerQueryHighlightConfig>)
Link copied to clipboard
@Serializable
data class SetShowDebugBordersParameter(val show: Boolean)
Link copied to clipboard
@Serializable
data class SetShowFlexOverlaysParameter(val flexNodeHighlightConfigs: List<Overlay.FlexNodeHighlightConfig>)
Link copied to clipboard
@Serializable
data class SetShowFPSCounterParameter(val show: Boolean)
Link copied to clipboard
@Serializable
data class SetShowGridOverlaysParameter(val gridNodeHighlightConfigs: List<Overlay.GridNodeHighlightConfig>)
Link copied to clipboard
@Serializable
data class SetShowHingeParameter(val hingeConfig: Overlay.HingeConfig? = null)
Link copied to clipboard
@Serializable
data class SetShowHitTestBordersParameter(val show: Boolean)
Link copied to clipboard
@Serializable
data class SetShowIsolatedElementsParameter(val isolatedElementHighlightConfigs: List<Overlay.IsolatedElementHighlightConfig>)
Link copied to clipboard
@Serializable
data class SetShowLayoutShiftRegionsParameter(val result: Boolean)
Link copied to clipboard
@Serializable
data class SetShowPaintRectsParameter(val result: Boolean)
Link copied to clipboard
@Serializable
data class SetShowScrollBottleneckRectsParameter(val show: Boolean)
Link copied to clipboard
@Serializable
data class SetShowScrollSnapOverlaysParameter(val scrollSnapHighlightConfigs: List<Overlay.ScrollSnapHighlightConfig>)
Link copied to clipboard
@Serializable
data class SetShowViewportSizeOnResizeParameter(val show: Boolean)
Link copied to clipboard
@Serializable
data class SetShowWebVitalsParameter(val show: Boolean)
Link copied to clipboard
@Serializable
data class SetShowWindowControlsOverlayParameter(val windowControlsOverlayConfig: Overlay.WindowControlsOverlayConfig? = null)
Link copied to clipboard
@Serializable
data class SourceOrderConfig(val parentOutlineColor: DOM.RGBA, val childOutlineColor: DOM.RGBA)

Configuration data for drawing the source order of an elements children.

Link copied to clipboard
@Serializable
data class WindowControlsOverlayConfig(val showCSS: Boolean, val selectedPlatform: String, val themeColor: String)

Configuration for Window Controls Overlay

Properties

Link copied to clipboard

Fired when user cancels the inspect mode.

Link copied to clipboard

Fired when the node should be inspected. This happens after call to setInspectMode or when user manually inspects an element.

Link copied to clipboard

Fired when the node should be highlighted. This happens after call to setInspectMode.

Link copied to clipboard

Fired when user asks to capture screenshot of some area on the page.

Functions

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables domain notifications.

Link copied to clipboard
suspend fun enable(mode: CommandMode = CommandMode.DEFAULT)

Enables domain notifications.

Link copied to clipboard
suspend fun getHighlightObjectForTest(nodeId: Int, includeDistance: Boolean? = null, includeStyle: Boolean? = null, colorFormat: Overlay.ColorFormat? = null, showAccessibilityInfo: Boolean? = null): Overlay.GetHighlightObjectForTestReturn

For testing.

Link copied to clipboard
suspend fun hideHighlight(mode: CommandMode = CommandMode.DEFAULT)

Hides any highlight.

Link copied to clipboard
suspend fun highlightFrame(args: Overlay.HighlightFrameParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun highlightFrame(frameId: String, contentColor: DOM.RGBA? = null, contentOutlineColor: DOM.RGBA? = null)

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.

Link copied to clipboard
suspend fun highlightNode(args: Overlay.HighlightNodeParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun highlightNode(highlightConfig: Overlay.HighlightConfig, nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null, selector: String? = null)

Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.

Link copied to clipboard
suspend fun highlightQuad(args: Overlay.HighlightQuadParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun highlightQuad(quad: List<Double>, color: DOM.RGBA? = null, outlineColor: DOM.RGBA? = null)

Highlights given quad. Coordinates are absolute with respect to the main frame viewport.

Link copied to clipboard
suspend fun highlightRect(args: Overlay.HighlightRectParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun highlightRect(x: Int, y: Int, width: Int, height: Int, color: DOM.RGBA? = null, outlineColor: DOM.RGBA? = null)

Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.

Link copied to clipboard
suspend fun highlightSourceOrder(args: Overlay.HighlightSourceOrderParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun highlightSourceOrder(sourceOrderConfig: Overlay.SourceOrderConfig, nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null)

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.

Link copied to clipboard
suspend fun setInspectMode(mode: Overlay.InspectMode, highlightConfig: Overlay.HighlightConfig? = null)
suspend fun setInspectMode(args: Overlay.SetInspectModeParameter, mode: CommandMode = CommandMode.DEFAULT)

Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.

Link copied to clipboard
suspend fun setPausedInDebuggerMessage(message: String? = null)
Link copied to clipboard
suspend fun setShowAdHighlights(show: Boolean)
suspend fun setShowAdHighlights(args: Overlay.SetShowAdHighlightsParameter, mode: CommandMode = CommandMode.DEFAULT)

Highlights owner element of all frames detected to be ads.

Link copied to clipboard
Link copied to clipboard
suspend fun setShowDebugBorders(show: Boolean)
suspend fun setShowDebugBorders(args: Overlay.SetShowDebugBordersParameter, mode: CommandMode = CommandMode.DEFAULT)

Requests that backend shows debug borders on layers

Link copied to clipboard
suspend fun setShowFlexOverlays(flexNodeHighlightConfigs: List<Overlay.FlexNodeHighlightConfig>)
suspend fun setShowFlexOverlays(args: Overlay.SetShowFlexOverlaysParameter, mode: CommandMode = CommandMode.DEFAULT)
Link copied to clipboard
suspend fun setShowFPSCounter(show: Boolean)
suspend fun setShowFPSCounter(args: Overlay.SetShowFPSCounterParameter, mode: CommandMode = CommandMode.DEFAULT)

Requests that backend shows the FPS counter

Link copied to clipboard
suspend fun setShowGridOverlays(gridNodeHighlightConfigs: List<Overlay.GridNodeHighlightConfig>)
suspend fun setShowGridOverlays(args: Overlay.SetShowGridOverlaysParameter, mode: CommandMode = CommandMode.DEFAULT)

Highlight multiple elements with the CSS Grid overlay.

Link copied to clipboard
suspend fun setShowHinge(hingeConfig: Overlay.HingeConfig? = null)
suspend fun setShowHinge(args: Overlay.SetShowHingeParameter, mode: CommandMode = CommandMode.DEFAULT)

Add a dual screen device hinge

Link copied to clipboard
suspend fun setShowHitTestBorders(show: Boolean)
suspend fun setShowHitTestBorders(args: Overlay.SetShowHitTestBordersParameter, mode: CommandMode = CommandMode.DEFAULT)

Deprecated, no longer has any effect.

Link copied to clipboard
suspend fun setShowIsolatedElements(isolatedElementHighlightConfigs: List<Overlay.IsolatedElementHighlightConfig>)
suspend fun setShowIsolatedElements(args: Overlay.SetShowIsolatedElementsParameter, mode: CommandMode = CommandMode.DEFAULT)

Show elements in isolation mode with overlays.

Link copied to clipboard
suspend fun setShowLayoutShiftRegions(result: Boolean)

Requests that backend shows layout shift regions

Link copied to clipboard
suspend fun setShowPaintRects(result: Boolean)
suspend fun setShowPaintRects(args: Overlay.SetShowPaintRectsParameter, mode: CommandMode = CommandMode.DEFAULT)

Requests that backend shows paint rectangles

Link copied to clipboard

Requests that backend shows scroll bottleneck rects

Link copied to clipboard
suspend fun setShowScrollSnapOverlays(scrollSnapHighlightConfigs: List<Overlay.ScrollSnapHighlightConfig>)
Link copied to clipboard

Paints viewport size upon main frame resize.

Link copied to clipboard
suspend fun setShowWebVitals(show: Boolean)
suspend fun setShowWebVitals(args: Overlay.SetShowWebVitalsParameter, mode: CommandMode = CommandMode.DEFAULT)

Deprecated, no longer has any effect.

Link copied to clipboard
suspend fun setShowWindowControlsOverlay(windowControlsOverlayConfig: Overlay.WindowControlsOverlayConfig? = null)

Show Window Controls Overlay for PWA