Table of Contents

Interface IOverlay

Namespace
Selenium.WebDriver.BiDi.Cdp.Overlay
Assembly
Selenium.WebDriver.BiDi.Cdp.dll

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

[Experimental("BIDICDP001")]
public interface IOverlay

Properties

InspectModeCanceled

Fired when user cancels the inspect mode.

IEventSource<InspectModeCanceledEventArgs> InspectModeCanceled { get; }

Property Value

IEventSource<InspectModeCanceledEventArgs>

InspectNodeRequested

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

IEventSource<InspectNodeRequestedEventArgs> InspectNodeRequested { get; }

Property Value

IEventSource<InspectNodeRequestedEventArgs>

Remarks

Event args (InspectNodeRequestedEventArgs):

  • BackendNodeId - Id of the node to inspect.

InspectPanelShowRequested

Fired when user asks to show the Inspect panel.

IEventSource<InspectPanelShowRequestedEventArgs> InspectPanelShowRequested { get; }

Property Value

IEventSource<InspectPanelShowRequestedEventArgs>

Remarks

Event args (InspectPanelShowRequestedEventArgs):

  • BackendNodeId - Id of the node to show in the panel.

InspectedElementWindowRestored

Fired when user asks to restore the Inspected Element floating window.

IEventSource<InspectedElementWindowRestoredEventArgs> InspectedElementWindowRestored { get; }

Property Value

IEventSource<InspectedElementWindowRestoredEventArgs>

Remarks

Event args (InspectedElementWindowRestoredEventArgs):

  • BackendNodeId - Id of the node to restore the floating window for.

NodeHighlightRequested

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

IEventSource<NodeHighlightRequestedEventArgs> NodeHighlightRequested { get; }

Property Value

IEventSource<NodeHighlightRequestedEventArgs>

Remarks

Event args (NodeHighlightRequestedEventArgs):

  • NodeId

ScreenshotRequested

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

IEventSource<ScreenshotRequestedEventArgs> ScreenshotRequested { get; }

Property Value

IEventSource<ScreenshotRequestedEventArgs>

Remarks

Event args (ScreenshotRequestedEventArgs):

  • Viewport - Viewport to capture, in device independent pixels (dip).

Methods

DisableAsync(string?, CancellationToken)

Disables domain notifications.

Task<DisableResult> DisableAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<DisableResult>

A task representing the asynchronous operation, containing a DisableResult.

EnableAsync(string?, CancellationToken)

Enables domain notifications.

Task<EnableResult> EnableAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<EnableResult>

A task representing the asynchronous operation, containing a EnableResult.

GetGridHighlightObjectsForTestAsync(ImmutableArray<NodeId>, string?, CancellationToken)

For Persistent Grid testing.

Task<GetGridHighlightObjectsForTestResult> GetGridHighlightObjectsForTestAsync(ImmutableArray<NodeId> nodeIds, string? session = null, CancellationToken cancellationToken = default)

Parameters

nodeIds ImmutableArray<NodeId>

Ids of the node to get highlight object for.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetGridHighlightObjectsForTestResult>

A task representing the asynchronous operation, containing a GetGridHighlightObjectsForTestResult.

GetHighlightObjectForTestAsync(NodeId, bool?, bool?, ColorFormat?, bool?, string?, CancellationToken)

For testing.

Task<GetHighlightObjectForTestResult> GetHighlightObjectForTestAsync(NodeId nodeId, bool? includeDistance = null, bool? includeStyle = null, ColorFormat? colorFormat = null, bool? showAccessibilityInfo = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

nodeId NodeId

Id of the node to get highlight object for.

includeDistance bool?

Whether to include distance info.

includeStyle bool?

Whether to include style info.

colorFormat ColorFormat?

The color format to get config with (default: hex).

showAccessibilityInfo bool?

Whether to show accessibility info (default: true).

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetHighlightObjectForTestResult>

A task representing the asynchronous operation, containing a GetHighlightObjectForTestResult.

GetSourceOrderHighlightObjectForTestAsync(NodeId, string?, CancellationToken)

For Source Order Viewer testing.

Task<GetSourceOrderHighlightObjectForTestResult> GetSourceOrderHighlightObjectForTestAsync(NodeId nodeId, string? session = null, CancellationToken cancellationToken = default)

Parameters

nodeId NodeId

Id of the node to highlight.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetSourceOrderHighlightObjectForTestResult>

A task representing the asynchronous operation, containing a GetSourceOrderHighlightObjectForTestResult.

HideHighlightAsync(string?, CancellationToken)

Hides any highlight.

Task<HideHighlightResult> HideHighlightAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<HideHighlightResult>

A task representing the asynchronous operation, containing a HideHighlightResult.

HighlightFrameAsync(FrameId, RGBA?, RGBA?, string?, CancellationToken)

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.

[Obsolete]
Task<HighlightFrameResult> HighlightFrameAsync(FrameId frameId, RGBA? contentColor = null, RGBA? contentOutlineColor = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId

Identifier of the frame to highlight.

contentColor RGBA

The content box highlight fill color (default: transparent).

contentOutlineColor RGBA

The content box highlight outline color (default: transparent).

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<HighlightFrameResult>

A task representing the asynchronous operation, containing a HighlightFrameResult.

HighlightNodeAsync(HighlightConfig, NodeId?, BackendNodeId?, RemoteObjectId?, string?, string?, CancellationToken)

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

Task<HighlightNodeResult> HighlightNodeAsync(HighlightConfig highlightConfig, NodeId? nodeId = null, BackendNodeId? backendNodeId = null, RemoteObjectId? objectId = null, string? selector = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

highlightConfig HighlightConfig

A descriptor for the highlight appearance.

nodeId NodeId

Identifier of the node to highlight.

backendNodeId BackendNodeId

Identifier of the backend node to highlight.

objectId RemoteObjectId

JavaScript object id of the node to be highlighted.

selector string

Selectors to highlight relevant nodes.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<HighlightNodeResult>

A task representing the asynchronous operation, containing a HighlightNodeResult.

HighlightQuadAsync(ImmutableArray<double>, RGBA?, RGBA?, string?, CancellationToken)

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

Task<HighlightQuadResult> HighlightQuadAsync(ImmutableArray<double> quad, RGBA? color = null, RGBA? outlineColor = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

quad ImmutableArray<double>

Quad to highlight

color RGBA

The highlight fill color (default: transparent).

outlineColor RGBA

The highlight outline color (default: transparent).

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<HighlightQuadResult>

A task representing the asynchronous operation, containing a HighlightQuadResult.

HighlightRectAsync(long, long, long, long, RGBA?, RGBA?, string?, CancellationToken)

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).

Task<HighlightRectResult> HighlightRectAsync(long x, long y, long width, long height, RGBA? color = null, RGBA? outlineColor = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

x long

X coordinate

y long

Y coordinate

width long

Rectangle width

height long

Rectangle height

color RGBA

The highlight fill color (default: transparent).

outlineColor RGBA

The highlight outline color (default: transparent).

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<HighlightRectResult>

A task representing the asynchronous operation, containing a HighlightRectResult.

HighlightSourceOrderAsync(SourceOrderConfig, NodeId?, BackendNodeId?, RemoteObjectId?, string?, CancellationToken)

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.

Task<HighlightSourceOrderResult> HighlightSourceOrderAsync(SourceOrderConfig sourceOrderConfig, NodeId? nodeId = null, BackendNodeId? backendNodeId = null, RemoteObjectId? objectId = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

sourceOrderConfig SourceOrderConfig

A descriptor for the appearance of the overlay drawing.

nodeId NodeId

Identifier of the node to highlight.

backendNodeId BackendNodeId

Identifier of the backend node to highlight.

objectId RemoteObjectId

JavaScript object id of the node to be highlighted.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<HighlightSourceOrderResult>

A task representing the asynchronous operation, containing a HighlightSourceOrderResult.

SetInspectModeAsync(InspectMode, HighlightConfig?, string?, CancellationToken)

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

Task<SetInspectModeResult> SetInspectModeAsync(InspectMode mode, HighlightConfig? highlightConfig = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

mode InspectMode

Set an inspection mode.

highlightConfig HighlightConfig

A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetInspectModeResult>

A task representing the asynchronous operation, containing a SetInspectModeResult.

SetPausedInDebuggerMessageAsync(string?, string?, CancellationToken)

Task<SetPausedInDebuggerMessageResult> SetPausedInDebuggerMessageAsync(string? message = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

message string

The message to display, also triggers resume and step over controls.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetPausedInDebuggerMessageResult>

A task representing the asynchronous operation, containing a SetPausedInDebuggerMessageResult.

SetShowAdHighlightsAsync(bool, string?, CancellationToken)

Highlights owner element of all frames detected to be ads.

Task<SetShowAdHighlightsResult> SetShowAdHighlightsAsync(bool show, string? session = null, CancellationToken cancellationToken = default)

Parameters

show bool

True for showing ad highlights

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowAdHighlightsResult>

A task representing the asynchronous operation, containing a SetShowAdHighlightsResult.

SetShowContainerQueryOverlaysAsync(ImmutableArray<ContainerQueryHighlightConfig>, string?, CancellationToken)

Task<SetShowContainerQueryOverlaysResult> SetShowContainerQueryOverlaysAsync(ImmutableArray<ContainerQueryHighlightConfig> containerQueryHighlightConfigs, string? session = null, CancellationToken cancellationToken = default)

Parameters

containerQueryHighlightConfigs ImmutableArray<ContainerQueryHighlightConfig>

An array of node identifiers and descriptors for the highlight appearance.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowContainerQueryOverlaysResult>

A task representing the asynchronous operation, containing a SetShowContainerQueryOverlaysResult.

SetShowDebugBordersAsync(bool, string?, CancellationToken)

Requests that backend shows debug borders on layers

Task<SetShowDebugBordersResult> SetShowDebugBordersAsync(bool show, string? session = null, CancellationToken cancellationToken = default)

Parameters

show bool

True for showing debug borders

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowDebugBordersResult>

A task representing the asynchronous operation, containing a SetShowDebugBordersResult.

SetShowDisplayCutoutAsync(DisplayCutoutConfig?, string?, CancellationToken)

Add a display cutout overlay.

Task<SetShowDisplayCutoutResult> SetShowDisplayCutoutAsync(DisplayCutoutConfig? displayCutoutConfig = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

displayCutoutConfig DisplayCutoutConfig

display cutout data, null means hide display cutout

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowDisplayCutoutResult>

A task representing the asynchronous operation, containing a SetShowDisplayCutoutResult.

SetShowFPSCounterAsync(bool, string?, CancellationToken)

Requests that backend shows the FPS counter

Task<SetShowFPSCounterResult> SetShowFPSCounterAsync(bool show, string? session = null, CancellationToken cancellationToken = default)

Parameters

show bool

True for showing the FPS counter

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowFPSCounterResult>

A task representing the asynchronous operation, containing a SetShowFPSCounterResult.

SetShowFlexOverlaysAsync(ImmutableArray<FlexNodeHighlightConfig>, string?, CancellationToken)

Task<SetShowFlexOverlaysResult> SetShowFlexOverlaysAsync(ImmutableArray<FlexNodeHighlightConfig> flexNodeHighlightConfigs, string? session = null, CancellationToken cancellationToken = default)

Parameters

flexNodeHighlightConfigs ImmutableArray<FlexNodeHighlightConfig>

An array of node identifiers and descriptors for the highlight appearance.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowFlexOverlaysResult>

A task representing the asynchronous operation, containing a SetShowFlexOverlaysResult.

SetShowGridOverlaysAsync(ImmutableArray<GridNodeHighlightConfig>, string?, CancellationToken)

Highlight multiple elements with the CSS Grid overlay.

Task<SetShowGridOverlaysResult> SetShowGridOverlaysAsync(ImmutableArray<GridNodeHighlightConfig> gridNodeHighlightConfigs, string? session = null, CancellationToken cancellationToken = default)

Parameters

gridNodeHighlightConfigs ImmutableArray<GridNodeHighlightConfig>

An array of node identifiers and descriptors for the highlight appearance.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowGridOverlaysResult>

A task representing the asynchronous operation, containing a SetShowGridOverlaysResult.

SetShowHingeAsync(HingeConfig?, string?, CancellationToken)

Add a dual screen device hinge

Task<SetShowHingeResult> SetShowHingeAsync(HingeConfig? hingeConfig = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

hingeConfig HingeConfig

hinge data, null means hideHinge

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowHingeResult>

A task representing the asynchronous operation, containing a SetShowHingeResult.

SetShowHitTestBordersAsync(bool, string?, CancellationToken)

Deprecated, no longer has any effect.

[Obsolete]
Task<SetShowHitTestBordersResult> SetShowHitTestBordersAsync(bool show, string? session = null, CancellationToken cancellationToken = default)

Parameters

show bool

True for showing hit-test borders

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowHitTestBordersResult>

A task representing the asynchronous operation, containing a SetShowHitTestBordersResult.

SetShowInspectedElementAnchorAsync(InspectedElementAnchorConfig, string?, CancellationToken)

Task<SetShowInspectedElementAnchorResult> SetShowInspectedElementAnchorAsync(InspectedElementAnchorConfig inspectedElementAnchorConfig, string? session = null, CancellationToken cancellationToken = default)

Parameters

inspectedElementAnchorConfig InspectedElementAnchorConfig

Node identifier for which to show an anchor for.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowInspectedElementAnchorResult>

A task representing the asynchronous operation, containing a SetShowInspectedElementAnchorResult.

SetShowIsolatedElementsAsync(ImmutableArray<IsolatedElementHighlightConfig>, string?, CancellationToken)

Show elements in isolation mode with overlays.

Task<SetShowIsolatedElementsResult> SetShowIsolatedElementsAsync(ImmutableArray<IsolatedElementHighlightConfig> isolatedElementHighlightConfigs, string? session = null, CancellationToken cancellationToken = default)

Parameters

isolatedElementHighlightConfigs ImmutableArray<IsolatedElementHighlightConfig>

An array of node identifiers and descriptors for the highlight appearance.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowIsolatedElementsResult>

A task representing the asynchronous operation, containing a SetShowIsolatedElementsResult.

SetShowLayoutShiftRegionsAsync(bool, string?, CancellationToken)

Requests that backend shows layout shift regions

Task<SetShowLayoutShiftRegionsResult> SetShowLayoutShiftRegionsAsync(bool result, string? session = null, CancellationToken cancellationToken = default)

Parameters

result bool

True for showing layout shift regions

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowLayoutShiftRegionsResult>

A task representing the asynchronous operation, containing a SetShowLayoutShiftRegionsResult.

SetShowPaintRectsAsync(bool, string?, CancellationToken)

Requests that backend shows paint rectangles

Task<SetShowPaintRectsResult> SetShowPaintRectsAsync(bool result, string? session = null, CancellationToken cancellationToken = default)

Parameters

result bool

True for showing paint rectangles

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowPaintRectsResult>

A task representing the asynchronous operation, containing a SetShowPaintRectsResult.

SetShowScrollBottleneckRectsAsync(bool, string?, CancellationToken)

Requests that backend shows scroll bottleneck rects

Task<SetShowScrollBottleneckRectsResult> SetShowScrollBottleneckRectsAsync(bool show, string? session = null, CancellationToken cancellationToken = default)

Parameters

show bool

True for showing scroll bottleneck rects

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowScrollBottleneckRectsResult>

A task representing the asynchronous operation, containing a SetShowScrollBottleneckRectsResult.

SetShowScrollSnapOverlaysAsync(ImmutableArray<ScrollSnapHighlightConfig>, string?, CancellationToken)

Task<SetShowScrollSnapOverlaysResult> SetShowScrollSnapOverlaysAsync(ImmutableArray<ScrollSnapHighlightConfig> scrollSnapHighlightConfigs, string? session = null, CancellationToken cancellationToken = default)

Parameters

scrollSnapHighlightConfigs ImmutableArray<ScrollSnapHighlightConfig>

An array of node identifiers and descriptors for the highlight appearance.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowScrollSnapOverlaysResult>

A task representing the asynchronous operation, containing a SetShowScrollSnapOverlaysResult.

SetShowViewportSizeOnResizeAsync(bool, string?, CancellationToken)

Paints viewport size upon main frame resize.

Task<SetShowViewportSizeOnResizeResult> SetShowViewportSizeOnResizeAsync(bool show, string? session = null, CancellationToken cancellationToken = default)

Parameters

show bool

Whether to paint size or not.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowViewportSizeOnResizeResult>

A task representing the asynchronous operation, containing a SetShowViewportSizeOnResizeResult.

SetShowWebVitalsAsync(bool, string?, CancellationToken)

Deprecated, no longer has any effect.

[Obsolete]
Task<SetShowWebVitalsResult> SetShowWebVitalsAsync(bool show, string? session = null, CancellationToken cancellationToken = default)

Parameters

show bool
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowWebVitalsResult>

A task representing the asynchronous operation, containing a SetShowWebVitalsResult.

SetShowWindowControlsOverlayAsync(WindowControlsOverlayConfig?, string?, CancellationToken)

Show Window Controls Overlay for PWA

Task<SetShowWindowControlsOverlayResult> SetShowWindowControlsOverlayAsync(WindowControlsOverlayConfig? windowControlsOverlayConfig = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

windowControlsOverlayConfig WindowControlsOverlayConfig

Window Controls Overlay data, null means hide Window Controls Overlay

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetShowWindowControlsOverlayResult>

A task representing the asynchronous operation, containing a SetShowWindowControlsOverlayResult.