Skip to content

Canvas Interaction

DevBridge provides 12 canvas-specific sub-actions via the computer tool: one for reading canvas content and 11 for interaction.

Read

Sub-actionDescription
canvas_screenshotCapture the canvas bitmap as an image (downscales large canvases by default)

Interact (11 sub-actions)

Sub-actionDescription
canvas_clickClick at coordinates within a canvas
canvas_dragDrag from one canvas coordinate to another
canvas_draw_pathDraw a multi-point path on the canvas
canvas_gesturePerform touch-like gestures (pinch, rotate, swipe)
canvas_scrollScroll within a canvas element
canvas_hoverHover over canvas coordinates
canvas_keypressSend key events while canvas is focused
canvas_pixelRead the color of a single pixel or pixel region
canvas_pixel_bulkRead colors of multiple pixels at once (up to 1000 points)
canvas_hit_testTest which element or region is at given coordinates
canvas_recordRecord canvas frame output

Canvas in the accessibility tree

read_page includes canvas elements with metadata: viewportRect, documentRect, bitmapSize, fallback content (if any), and a [large, WxH] label for oversized canvases.

Library hit-test support

DevBridge includes built-in adapters for hit-testing elements drawn by popular canvas libraries:

  • Chart.js — identify chart data points and series
  • ECharts — identify chart components
  • Fabric.js — identify canvas objects
  • Konva.js — identify stage nodes

DevBridge — Browser Debugging & Automation via MCP