Files
Junliang Feng e992b91ba3 feat: use CDP Accessibility tree for extension mode snapshot (#203)
* [packages/actionbook-rs]feat: use CDP Accessibility.getFullAXTree for extension mode snapshot

Extension mode previously used a primitive JS DOM walker (snapshot_js_fallback)
that couldn't compute accessible names, resulting in empty names for links,
headings, and other elements. Now extension mode uses CDP Accessibility.getFullAXTree
through the extension bridge, same as isolated mode.

Changes:
- Add DOM.enable, Accessibility.enable, Accessibility.getFullAXTree to CDP
  allowlist in both Rust bridge and Chrome extension
- Remove snapshot_js_fallback; extension mode now shares the CDP code path
- Skip noise roles: StaticText, LineBreak, ListMarker, strong, emphasis etc.
- Remove empty leaf structural nodes (empty <div>/<span> wrappers)
- Rewrite compact_tree_nodes (-c) to match agent-browser: keep only ref'd/valued
  nodes and their ancestors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [packages/actionbook-rs]refactor: remove level attribute from snapshot output

Level info (e.g. level=1 on listitem/heading) adds noise without
actionable value for agents. Remove it from format_compact output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [packages/actionbook-rs]feat: add /url: metadata to snapshot output for links and images

Extract URL property from CDP AX tree nodes and output as indented
`- /url: <href>` metadata line under link/image elements, matching
agent-browser's snapshot format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [packages/actionbook-rs]fix: address code review issues from Codex and self-review

- Fix scope filter pruning entire subtrees: traverse children even when
  ancestor is outside scope (Codex P1)
- Fix --interactive filter including non-interactive content roles like
  heading/navigation; now filters by interactive roles only (Codex P2)
- Fix compact_tree_nodes ancestor marking: only mark true ancestor chain
  (depth-1 walk) instead of all preceding lower-depth nodes (Codex P2)
- Fix cursor ref ID collision: use cache.next_ref from parse_ax_tree
  instead of nodes.len() which diverges after filtering
- Remove dead code: "Skip empty StaticText" guard unreachable since
  StaticText is already in SKIP_ROLES
- Fix format_compact doc comment: remove level=1 from format example
  since level is intentionally not emitted
- Fix estimate_tokens_compact test to use realistic format_compact output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 00:23:52 +08:00
..

Actionbook Extension

Chrome extension that bridges the Actionbook CLI with your browser for AI-powered automation.

Installation

  1. Open Actionbook on Chrome Web Store
  2. Click Add to Chrome
  3. Confirm Add extension

Option 2: CLI fallback (local debug install)

actionbook extension install

This installs the local debug fallback package to ~/.actionbook/extension/.

Option 3: Manual download

  1. Go to GitHub Releases
  2. Find the latest actionbook-extension-v* release
  3. Download the .zip file
  4. Unzip to a local folder

Load in Chrome

  1. Open chrome://extensions
  2. Enable Developer mode
  3. Click Load unpacked
  4. Select the extension directory (actionbook extension path to find it)

Usage

Use the extension

The extension communicates with the CLI via a local WebSocket bridge that auto-starts when you run browser commands.

No manual bridge start needed - just run commands:

actionbook browser open https://example.com
# Bridge starts automatically in the background

The CLI registers Native Messaging on install, so the extension connects automatically when the bridge starts.

Verify connection

actionbook extension status
actionbook extension ping

Run commands in extension mode

Recommended: run setup once and choose extension mode:

actionbook setup

After setup, run browser commands normally (no extra mode flags):

actionbook browser open "https://example.com"
actionbook browser fill "#username" "demo"
actionbook browser click "button[type='submit']"
actionbook browser screenshot result.png

If you need to switch modes later, run actionbook setup again.

See the full command reference in the main README.

Releasing a new version

The extension has its own independent release cycle, separate from the CLI.

Steps

  1. Make changes in packages/actionbook-extension/
  2. Update version in manifest.json (e.g. 0.2.0 -> 0.3.0)
  3. Commit:
    git commit -m "[packages/actionbook-extension]feat: description of change"
    
  4. Tag:
    git tag actionbook-extension-v0.3.0
    
  5. Push:
    git push origin main --tags
    
  6. GitHub Actions automatically:
    • Verifies tag version matches manifest.json version
    • Packages the extension as a .zip
    • Creates a GitHub Release with the .zip and install instructions

Local packaging

cd packages/actionbook-extension
npm run package

Output: dist/actionbook-extension-v{version}.zip

Version compatibility

The CLI and extension are versioned independently. Compatibility is guaranteed by the bridge protocol version exchanged during the WebSocket hello handshake. As long as both sides speak the same protocol version, they work together regardless of their individual version numbers.

Troubleshooting

  1. Ping failed / not running - The bridge auto-starts with browser commands. Ensure the extension is loaded in Chrome. Check status with actionbook extension status.

  2. Port conflict - Browser mode uses fixed bridge address ws://127.0.0.1:19222. If startup fails, free that port and retry (macOS/Linux: lsof -i :19222).

  3. No tab attached - Make sure Chrome has a visible tab. Run open or goto first.

  4. Web Store install failed - Use fallback actionbook extension install, then load it from chrome://extensions with Load unpacked.

  5. Offline install - Download the .zip from another machine, unzip to ~/.actionbook/extension/, then load it as an unpacked extension in chrome://extensions.