CDPotion.Domain.Overlay (cdpotion v0.1.0)

Summary

Functions

Disables domain notifications.

Enables domain notifications.

For Persistent Grid testing.

For Source Order Viewer testing.

Hides any highlight.

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.

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

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

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

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.

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

Parameters:

  • message:string: (Optional) The message to display, also triggers resume and step over controls.

Highlights owner element of all frames detected to be ads.

Parameters:

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

Requests that backend shows debug borders on layers

Parameters:

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

Requests that backend shows the FPS counter

Highlight multiple elements with the CSS Grid overlay.

Add a dual screen device hinge

Deprecated, no longer has any effect.

Show elements in isolation mode with overlays.

Requests that backend shows layout shift regions

Requests that backend shows paint rectangles

Requests that backend shows scroll bottleneck rects

Parameters:

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

Paints viewport size upon main frame resize.

Request that backend shows an overlay with web vital metrics.

Functions

Disables domain notifications.

Enables domain notifications.

Link to this function

get_grid_highlight_objects_for_test(node_ids)

For Persistent Grid testing.

Parameters:

  • nodeIds:array: Ids of the node to get highlight object for.
Link to this function

get_highlight_object_for_test(node_id, include_distance \\ nil, include_style \\ nil, color_format \\ nil, show_accessibility_info \\ nil)

For testing.

Parameters:

  • nodeId:DOM.NodeId: Id of the node to get highlight object for.
  • includeDistance:boolean: (Optional) Whether to include distance info.
  • includeStyle:boolean: (Optional) Whether to include style info.
  • colorFormat:ColorFormat: (Optional) The color format to get config with (default: hex).
  • showAccessibilityInfo:boolean: (Optional) Whether to show accessibility info (default: true).
Link to this function

get_source_order_highlight_object_for_test(node_id)

For Source Order Viewer testing.

Parameters:

  • nodeId:DOM.NodeId: Id of the node to highlight.
Link to this function

hide_highlight()

Hides any highlight.

Link to this function

highlight_frame(frame_id, content_color \\ nil, content_outline_color \\ nil)

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.

Parameters:

  • frameId:Page.FrameId: Identifier of the frame to highlight.
  • contentColor:DOM.RGBA: (Optional) The content box highlight fill color (default: transparent).
  • contentOutlineColor:DOM.RGBA: (Optional) The content box highlight outline color (default: transparent).
Link to this function

highlight_node(highlight_config, node_id \\ nil, backend_node_id \\ nil, object_id \\ nil, selector \\ nil)

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

Parameters:

  • highlightConfig:HighlightConfig: A descriptor for the highlight appearance.
  • nodeId:DOM.NodeId: (Optional) Identifier of the node to highlight.
  • backendNodeId:DOM.BackendNodeId: (Optional) Identifier of the backend node to highlight.
  • objectId:Runtime.RemoteObjectId: (Optional) JavaScript object id of the node to be highlighted.
  • selector:string: (Optional) Selectors to highlight relevant nodes.
Link to this function

highlight_quad(quad, color \\ nil, outline_color \\ nil)

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

Parameters:

  • quad:DOM.Quad: Quad to highlight
  • color:DOM.RGBA: (Optional) The highlight fill color (default: transparent).
  • outlineColor:DOM.RGBA: (Optional) The highlight outline color (default: transparent).
Link to this function

highlight_rect(x, y, width, height, color \\ nil, outline_color \\ nil)

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

Parameters:

  • x:integer: X coordinate
  • y:integer: Y coordinate
  • width:integer: Rectangle width
  • height:integer: Rectangle height
  • color:DOM.RGBA: (Optional) The highlight fill color (default: transparent).
  • outlineColor:DOM.RGBA: (Optional) The highlight outline color (default: transparent).
Link to this function

highlight_source_order(source_order_config, node_id \\ nil, backend_node_id \\ nil, object_id \\ nil)

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:SourceOrderConfig: A descriptor for the appearance of the overlay drawing.
  • nodeId:DOM.NodeId: (Optional) Identifier of the node to highlight.
  • backendNodeId:DOM.BackendNodeId: (Optional) Identifier of the backend node to highlight.
  • objectId:Runtime.RemoteObjectId: (Optional) JavaScript object id of the node to be highlighted.
Link to this function

set_inspect_mode(mode, highlight_config \\ nil)

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:InspectMode: Set an inspection mode.
  • highlightConfig:HighlightConfig: (Optional) A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false.
Link to this function

set_paused_in_debugger_message(message \\ nil)

Parameters:

  • message:string: (Optional) The message to display, also triggers resume and step over controls.
Link to this function

set_show_ad_highlights(show)

Highlights owner element of all frames detected to be ads.

Parameters:

  • show:boolean: True for showing ad highlights
Link to this function

set_show_container_query_overlays(container_query_highlight_configs)

Parameters:

  • containerQueryHighlightConfigs:array: An array of node identifiers and descriptors for the highlight appearance.
Link to this function

set_show_debug_borders(show)

Requests that backend shows debug borders on layers

Parameters:

  • show:boolean: True for showing debug borders
Link to this function

set_show_flex_overlays(flex_node_highlight_configs)

Parameters:

  • flexNodeHighlightConfigs:array: An array of node identifiers and descriptors for the highlight appearance.
Link to this function

set_show_fps_counter(show)

Requests that backend shows the FPS counter

Parameters:

  • show:boolean: True for showing the FPS counter
Link to this function

set_show_grid_overlays(grid_node_highlight_configs)

Highlight multiple elements with the CSS Grid overlay.

Parameters:

  • gridNodeHighlightConfigs:array: An array of node identifiers and descriptors for the highlight appearance.
Link to this function

set_show_hinge(hinge_config \\ nil)

Add a dual screen device hinge

Parameters:

  • hingeConfig:HingeConfig: (Optional) hinge data, null means hideHinge
Link to this function

set_show_hit_test_borders(show)

Deprecated, no longer has any effect.

Parameters:

  • show:boolean: True for showing hit-test borders
Link to this function

set_show_isolated_elements(isolated_element_highlight_configs)

Show elements in isolation mode with overlays.

Parameters:

  • isolatedElementHighlightConfigs:array: An array of node identifiers and descriptors for the highlight appearance.
Link to this function

set_show_layout_shift_regions(result)

Requests that backend shows layout shift regions

Parameters:

  • result:boolean: True for showing layout shift regions
Link to this function

set_show_paint_rects(result)

Requests that backend shows paint rectangles

Parameters:

  • result:boolean: True for showing paint rectangles
Link to this function

set_show_scroll_bottleneck_rects(show)

Requests that backend shows scroll bottleneck rects

Parameters:

  • show:boolean: True for showing scroll bottleneck rects
Link to this function

set_show_scroll_snap_overlays(scroll_snap_highlight_configs)

Parameters:

  • scrollSnapHighlightConfigs:array: An array of node identifiers and descriptors for the highlight appearance.
Link to this function

set_show_viewport_size_on_resize(show)

Paints viewport size upon main frame resize.

Parameters:

  • show:boolean: Whether to paint size or not.
Link to this function

set_show_web_vitals(show)

Request that backend shows an overlay with web vital metrics.

Parameters:

  • show:boolean: description not provided :(