Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:AIPexStudio AIPex Dual Mode Automation

From Leeroopedia
Knowledge Sources
Domains Browser_Automation, Accessibility
Last Updated 2026-10-24 12:00 GMT

Overview

A strategy that switches between Chrome DevTools Protocol (CDP) and pure DOM scripting based on whether the automation should be visible or background-silent.

Description

Browser automation traditionally requires either attaching a debugger (CDP) for full access to the accessibility tree, input simulation, and screenshots, or using injected content scripts for DOM manipulation. Dual Mode Automation provides a unified interface that selects the backend at runtime based on user preference: "focus" mode attaches the CDP debugger for visual automation (screenshots, visual effects, accurate AX tree), while "background" mode uses pure DOM traversal (no debugger, silent operation, no visual tools). This lets the same tool API work in both modes—the mode only affects which implementation is used internally.

Usage

Use this principle when a browser extension needs to operate both visibly (with screenshots and visual feedback) and silently (without disturbing the user). The mode is user-selectable and persisted in Chrome storage.

Theoretical Basis

mode = getAutomationMode()  // "focus" | "background"

if mode === "focus":
  CDP path: attach debugger, use Accessibility.getFullAXTree
  Enables: screenshots, visual effects, CDP input simulation
  Requires: debugger attachment permission

if mode === "background":
  DOM path: inject content script, traverse DOM
  Enables: silent element location, no debugger
  Disables: screenshots, visual tools
  No fallback to CDP (strict silent mode)

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment