Interface IOverlay
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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
nodeIdsImmutableArray<NodeId>Ids of the node to get highlight object for.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
nodeIdNodeIdId of the node to get highlight object for.
includeDistancebool?Whether to include distance info.
includeStylebool?Whether to include style info.
colorFormatColorFormat?The color format to get config with (default: hex).
showAccessibilityInfobool?Whether to show accessibility info (default: true).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
nodeIdNodeIdId of the node to highlight.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
frameIdFrameIdIdentifier of the frame to highlight.
contentColorRGBAThe content box highlight fill color (default: transparent).
contentOutlineColorRGBAThe content box highlight outline color (default: transparent).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
highlightConfigHighlightConfigA descriptor for the highlight appearance.
nodeIdNodeIdIdentifier of the node to highlight.
backendNodeIdBackendNodeIdIdentifier of the backend node to highlight.
objectIdRemoteObjectIdJavaScript object id of the node to be highlighted.
selectorstringSelectors to highlight relevant nodes.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
quadImmutableArray<double>Quad to highlight
colorRGBAThe highlight fill color (default: transparent).
outlineColorRGBAThe highlight outline color (default: transparent).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
xlongX coordinate
ylongY coordinate
widthlongRectangle width
heightlongRectangle height
colorRGBAThe highlight fill color (default: transparent).
outlineColorRGBAThe highlight outline color (default: transparent).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sourceOrderConfigSourceOrderConfigA descriptor for the appearance of the overlay drawing.
nodeIdNodeIdIdentifier of the node to highlight.
backendNodeIdBackendNodeIdIdentifier of the backend node to highlight.
objectIdRemoteObjectIdJavaScript object id of the node to be highlighted.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
modeInspectModeSet an inspection mode.
highlightConfigHighlightConfigA descriptor for the highlight appearance of hovered-over nodes. May be omitted if
enabled == false.sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
messagestringThe message to display, also triggers resume and step over controls.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
showboolTrue for showing ad highlights
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
containerQueryHighlightConfigsImmutableArray<ContainerQueryHighlightConfig>An array of node identifiers and descriptors for the highlight appearance.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
showboolTrue for showing debug borders
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
displayCutoutConfigDisplayCutoutConfigdisplay cutout data, null means hide display cutout
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
showboolTrue for showing the FPS counter
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
flexNodeHighlightConfigsImmutableArray<FlexNodeHighlightConfig>An array of node identifiers and descriptors for the highlight appearance.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
gridNodeHighlightConfigsImmutableArray<GridNodeHighlightConfig>An array of node identifiers and descriptors for the highlight appearance.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
hingeConfigHingeConfighinge data, null means hideHinge
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
showboolTrue for showing hit-test borders
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
inspectedElementAnchorConfigInspectedElementAnchorConfigNode identifier for which to show an anchor for.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
isolatedElementHighlightConfigsImmutableArray<IsolatedElementHighlightConfig>An array of node identifiers and descriptors for the highlight appearance.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
resultboolTrue for showing layout shift regions
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
resultboolTrue for showing paint rectangles
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
showboolTrue for showing scroll bottleneck rects
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
scrollSnapHighlightConfigsImmutableArray<ScrollSnapHighlightConfig>An array of node identifiers and descriptors for the highlight appearance.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
showboolWhether to paint size or not.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
showboolsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
windowControlsOverlayConfigWindowControlsOverlayConfigWindow Controls Overlay data, null means hide Window Controls Overlay
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetShowWindowControlsOverlayResult>
A task representing the asynchronous operation, containing a SetShowWindowControlsOverlayResult.