OverlayApi class
This domain provides various functionality related to drawing atop the inspected page.
Constructors
- OverlayApi(Client _client)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onInspectModeCanceled → Stream
-
Fired when user cancels the inspect mode.
no setter
-
onInspectNodeRequested
→ Stream<
BackendNodeId> -
Fired when the node should be inspected. This happens after call to
setInspectMode
or when user manually inspects an element.no setter -
onNodeHighlightRequested
→ Stream<
NodeId> -
Fired when the node should be highlighted. This happens after call to
setInspectMode
.no setter -
onScreenshotRequested
→ Stream<
Viewport> -
Fired when user asks to capture screenshot of some area on the page.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
disable(
) → Future< void> - Disables domain notifications.
-
enable(
) → Future< void> - Enables domain notifications.
-
getGridHighlightObjectsForTest(
List< NodeId> nodeIds) → Future<Map< String, dynamic> > -
For Persistent Grid testing.
nodeIds
Ids of the node to get highlight object for. Returns: Grid Highlight data for the node ids provided. -
getHighlightObjectForTest(
NodeId nodeId, {bool? includeDistance, bool? includeStyle, ColorFormat? colorFormat, bool? showAccessibilityInfo}) → Future< Map< String, dynamic> > -
For testing.
nodeId
Id of the node to get highlight object for.includeDistance
Whether to include distance info.includeStyle
Whether to include style info.colorFormat
The color format to get config with (default: hex).showAccessibilityInfo
Whether to show accessibility info (default: true). Returns: Highlight data for the node. -
getSourceOrderHighlightObjectForTest(
NodeId nodeId) → Future< Map< String, dynamic> > -
For Source Order Viewer testing.
nodeId
Id of the node to highlight. Returns: Source order highlight data for the node id provided. -
hideHighlight(
) → Future< void> - Hides any highlight.
-
highlightFrame(
FrameId frameId, {RGBA? contentColor, RGBA? contentOutlineColor}) → Future< void> -
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.
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(
HighlightConfig highlightConfig, {NodeId? nodeId, BackendNodeId? backendNodeId, RemoteObjectId? objectId, String? selector}) → Future< void> -
Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or
objectId must be specified.
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(
Quad quad, {RGBA? color, RGBA? outlineColor}) → Future< void> -
Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
quad
Quad to highlightcolor
The highlight fill color (default: transparent).outlineColor
The highlight outline color (default: transparent). -
highlightRect(
int x, int y, int width, int height, {RGBA? color, RGBA? outlineColor}) → Future< void> -
Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
x
X coordinatey
Y coordinatewidth
Rectangle widthheight
Rectangle heightcolor
The highlight fill color (default: transparent).outlineColor
The highlight outline color (default: transparent). -
highlightSourceOrder(
SourceOrderConfig sourceOrderConfig, {NodeId? nodeId, BackendNodeId? backendNodeId, RemoteObjectId? objectId}) → Future< void> -
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.
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. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setInspectMode(
InspectMode mode, {HighlightConfig? highlightConfig}) → Future< void> -
Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted.
Backend then generates 'inspectNodeRequested' event upon element selection.
mode
Set an inspection mode.highlightConfig
A descriptor for the highlight appearance of hovered-over nodes. May be omitted ifenabled == false
. -
setPausedInDebuggerMessage(
{String? message}) → Future< void> -
message
The message to display, also triggers resume and step over controls. -
setShowAdHighlights(
bool show) → Future< void> -
Highlights owner element of all frames detected to be ads.
show
True for showing ad highlights -
setShowContainerQueryOverlays(
List< ContainerQueryHighlightConfig> containerQueryHighlightConfigs) → Future<void> -
containerQueryHighlightConfigs
An array of node identifiers and descriptors for the highlight appearance. -
setShowDebugBorders(
bool show) → Future< void> -
Requests that backend shows debug borders on layers
show
True for showing debug borders -
setShowFlexOverlays(
List< FlexNodeHighlightConfig> flexNodeHighlightConfigs) → Future<void> -
flexNodeHighlightConfigs
An array of node identifiers and descriptors for the highlight appearance. -
setShowFPSCounter(
bool show) → Future< void> -
Requests that backend shows the FPS counter
show
True for showing the FPS counter -
setShowGridOverlays(
List< GridNodeHighlightConfig> gridNodeHighlightConfigs) → Future<void> -
Highlight multiple elements with the CSS Grid overlay.
gridNodeHighlightConfigs
An array of node identifiers and descriptors for the highlight appearance. -
setShowHinge(
{HingeConfig? hingeConfig}) → Future< void> -
Add a dual screen device hinge
hingeConfig
hinge data, null means hideHinge -
setShowHitTestBorders(
bool show) → Future< void> -
Deprecated, no longer has any effect.
show
True for showing hit-test borders -
setShowIsolatedElements(
List< IsolatedElementHighlightConfig> isolatedElementHighlightConfigs) → Future<void> -
Show elements in isolation mode with overlays.
isolatedElementHighlightConfigs
An array of node identifiers and descriptors for the highlight appearance. -
setShowLayoutShiftRegions(
bool result) → Future< void> -
Requests that backend shows layout shift regions
result
True for showing layout shift regions -
setShowPaintRects(
bool result) → Future< void> -
Requests that backend shows paint rectangles
result
True for showing paint rectangles -
setShowScrollBottleneckRects(
bool show) → Future< void> -
Requests that backend shows scroll bottleneck rects
show
True for showing scroll bottleneck rects -
setShowScrollSnapOverlays(
List< ScrollSnapHighlightConfig> scrollSnapHighlightConfigs) → Future<void> -
scrollSnapHighlightConfigs
An array of node identifiers and descriptors for the highlight appearance. -
setShowViewportSizeOnResize(
bool show) → Future< void> -
Paints viewport size upon main frame resize.
show
Whether to paint size or not. -
setShowWebVitals(
bool show) → Future< void> - Request that backend shows an overlay with web vital metrics.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited