---
title: "Testing Electron Apps With Vercel agent-browser Over CDP"
date: "2026-09-22"
video_id: "7688259587467709710"
tiktok_url: "https://www.tiktok.com/@isaacdyor/video/7688259587467709710"
creator: "@isaacdyor"
category: "Coding"
tags: ["agent-browser", "electron", "chrome devtools protocol", "computer use", "coding agents"]
excerpt: "Vercel's agent-browser can attach to a running Electron app over CDP with one flag. How the setup works, where it breaks and how it compares to computer use."
---
Vercel's agent-browser is a command-line tool that lets AI coding agents control a browser, and it can attach to a running Electron app over the Chrome DevTools Protocol (CDP). A TikTok from Isaac Dyor (@isaacdyor) recommends giving each agent its own worktree, its own app instance and its own debugging port instead of using computer use. The core command is real and documented, but the port belongs on the Electron process rather than the dev server, and the video's claim that computer use fails on Linux is wrong.

## What is agent-browser?

[vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser) is a public Vercel Labs repository, Apache-2.0 licensed, that describes itself as "Browser automation CLI for AI agents. Fast native Rust CLI." It installs with `npm install -g agent-browser`, Homebrew or Cargo.

Its [CDP mode documentation](https://raw.githubusercontent.com/vercel-labs/agent-browser/main/docs/src/app/cdp-mode/page.mdx) lists `agent-browser connect 9222` for a persistent binding and `agent-browser --cdp 9222 snapshot` for a single command. `--cdp` also accepts a full WebSocket URL for remote browser services. The same page says CDP mode can control "Electron apps, Chrome/Chromium with remote debugging, WebView2 applications, Remote browser services (via WebSocket URL), Any browser exposing a CDP endpoint." Electron is the first item on Vercel's own list.

## How to test Electron apps with agent-browser

The video describes four steps:

1. Put each coding agent in its own git worktree.
2. Have each agent start its own app with an explicit remote debugging port, such as 9222, 9223 and 9224.
3. Have each agent attach with `agent-browser --cdp 9222`.
4. Skip computer use, because the connection runs over CDP into the Chromium that Electron embeds.

This works because Electron is Node plus Chromium, and Chromium exposes a DevTools endpoint when you start it with `--remote-debugging-port`.

## Where do you set --remote-debugging-port in Electron?

On the Electron binary, not the dev server. The video says to "start its own dev server with an explicit remote debugging port," but a Vite or webpack dev server only serves renderer assets over HTTP and has no DevTools endpoint. [Electron's command-line switches documentation](https://www.electronjs.org/docs/latest/api/command-line-switches) lists `--remote-debugging-port` as "Enables remote debugging over HTTP on the specified `port`," and says switches can be added with `app.commandLine.appendSwitch()` in the main script before the `ready` event.

Electron's [main-process debugging guide](https://www.electronjs.org/docs/latest/tutorial/debugging-main-process) covers `--inspect` and `--inspect-brk` on port 9229. That is a separate channel for debugging Node in the main process.

## Does Chrome 136 block remote debugging for Electron?

No. Google's [March 17, 2025 post](https://developer.chrome.com/blog/remote-debugging-port) says that from Chrome 136, `--remote-debugging-port` and `--remote-debugging-pipe` "will no longer be respected if attempting to debug the default Chrome data directory" and must be paired with `--user-data-dir`. That targets your everyday Chrome profile. An Electron app uses its own userData directory, so the rule does not apply to it.

## agent-browser vs computer use

CDP gives the agent structure instead of pixels. The README describes `snapshot` as returning an accessibility tree with element references rather than screenshots, so the model gets stable handles like `<button id="export" disabled>` instead of coordinates. It also documents `console` for browser console output, `errors` for uncaught exceptions and `network requests` with filters for type, method and status code.

That matters most when something fails. In the video's example, a computer-use agent sees a red "Test failed" badge. A CDP-attached agent reads `TypeError: fps is undefined` at `export.ts:42` and a `POST /api/export 500`, which tells it where to look.

Separate ports also keep agents apart. Computer use on one shared desktop lets agents collide, which the video shows as "Agent 2 clicked Agent 1's button." When several sessions share one browser, the CDP docs say `--pin-tab` is needed, because "attaching with no binding opens a fresh tab instead of adopting an existing one." Separate Electron processes on separate ports avoid that.

## Does computer use work on Linux?

Yes. The video's spoken claim is narrow: a macOS computer-use setup does not carry over to the cloud. A slide in the video goes further and puts red crosses on Windows, Linux and Cloud VPS. Anthropic's [computer use reference implementation](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) describes itself as "a Linux desktop in Docker with X11 + VNC," and points to a separate quickstart that "runs natively on macOS (no container)." Linux in a container is the reference platform.

The video's banner "No screen to click in the cloud" is closer to the real advantage. CDP does not need a display at all, while computer use needs a real or virtual screen.

## Known issues with agent-browser CDP mode

[agent-browser issue #1272](https://github.com/vercel-labs/agent-browser/issues/1272), opened April 19, 2026 against version 0.17.1 and still open, reports that when an externally launched browser restarts and gets a new `webSocketDebuggerUrl`, "the CDP launch command is silently skipped" because the daemon is already running. The agent stays bound to a stale URL. Agents restart dev servers often, so expect to reconnect after a restart.

## What is Compound?

Dyor says the setup has helped him build "my own desktop app compound." [corporationdev/compound](https://github.com/corporationdev/compound) is a public MPL-2.0 Electron app, a video editor built for AI agents with SolidJS modules and projects written as JSX. Its README says "Edit videos with Claude Code, Codex, Cursor, Copilot, or Gemini CLI." Local setup needs Node 22 and Bun 1.3.11.

## Bottom line

`agent-browser --cdp 9222` attaches to a running Electron app, and Vercel documents Electron as a target. Set the debugging port on the Electron process, either as a switch or with `app.commandLine.appendSwitch()`, and plan for reconnects after restarts. The DOM, console and network access is the strongest reason to prefer CDP over computer use, which does run on Linux.

## Sources

- [vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser) - the tool, its license, install options and commands
- [agent-browser CDP mode documentation](https://raw.githubusercontent.com/vercel-labs/agent-browser/main/docs/src/app/cdp-mode/page.mdx) - `--cdp`, `connect`, `--pin-tab` and supported targets
- [Electron command line switches](https://www.electronjs.org/docs/latest/api/command-line-switches) - `--remote-debugging-port` and `appendSwitch()`
- [Electron main-process debugging](https://www.electronjs.org/docs/latest/tutorial/debugging-main-process) - `--inspect` on port 9229
- [agent-browser issue #1272](https://github.com/vercel-labs/agent-browser/issues/1272) - stale WebSocket URL after a browser restart
- [Chrome remote debugging changes](https://developer.chrome.com/blog/remote-debugging-port) - Chrome 136 restriction on the default profile
- [Anthropic computer-use-demo](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) - the Linux-in-Docker reference implementation
- [corporationdev/compound](https://github.com/corporationdev/compound) - the Electron app named in the video


## Video description and verification notes

**The core recipe in this video is real and documented: `agent-browser --cdp 9222` connects to an already-running Chromium instance, and Vercel's own CDP-mode docs name Electron apps as a supported target.** Isaac Dyor posted this 83-second clip on September 22, 2026. The 42 sampled frames split into two visual modes. Roughly a third are selfie-framed talking head shots in a bright room with white bookshelves, a black office chair, a QUATRO-branded board on a rack behind him, and a towel around his neck. The other two-thirds are dark, high-contrast motion slides with yellow accents that build a diagram step by step: three colored "Agent" boxes, then three `git worktree` folder cards labeled `agent-1/`, `agent-2/`, `agent-3/`, then three "Your app" windows each with a green `dev server` dot, then port chips `:9222`, `:9223`, `:9224` under the label `--remote-debugging-port`, and finally a terminal line that types out `$ agent-browser --cdp 9222`. Two frames near the start break the pattern with a phone-shot of a red-lit desk holding an ultrawide monitor running four side-by-side agent sessions and an open MacBook. The opening title card reads `Run 10 billion Electron apps at the same time`, which is a joke the audio never makes.

## What the video actually prescribes

The spoken argument is four steps. Put each coding agent in its own git worktree. Have each agent start its own dev server with an explicit remote debugging port. Have each agent attach Vercel's agent browser CLI to that port. Skip computer use entirely, because the connection runs over the Chrome DevTools Protocol into the Chromium that Electron embeds.

The slides carry detail the audio never states. Frame 14 shows the composition `Node + Chromium = Electron`. Frames 16 and 17 contrast "COMPUTER USE SEES / Pixels / a guess at what's on screen" against "CDP SEES", followed by a literal HTML block including `<button id="export" disabled>` and `<span class="status">Rendering 42%</span>`. Frames 20 through 23 build a failure scenario: a `Test failed: export` badge in the app, a console row reading `TypeError: fps is undefined  export.ts:42`, a network row reading `POST /api/export  500`, and a yellow callout pointing at the console line labeled "There's why". Frames 24 through 26 animate three cursors fighting over one window until a red banner reads `Agent 2 clicked Agent 1's button`. Frames 32 through 35 show a four-tile grid, macOS with a green check and Windows, Linux, and Cloud VPS with red crosses, plus a red banner reading "No screen to click in the cloud". Frame 38 ends on "Spin up 24 agents" with a `vps-01 · ubuntu · headless` panel holding windows on ports 9222 through 9245.

## The tooling exists and the syntax on screen is correct

[vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser) is a public repository under Vercel Labs, Apache-2.0 licensed, describing itself as "Browser automation CLI for AI agents. Fast native Rust CLI." GitHub showed 43.1k stars when I loaded it. It installs through `npm install -g agent-browser`, Homebrew, or Cargo.

The project's [CDP mode documentation](https://raw.githubusercontent.com/vercel-labs/agent-browser/main/docs/src/app/cdp-mode/page.mdx) documents exactly the command the video types on screen. It lists both `agent-browser connect 9222` for a one-time binding and `agent-browser --cdp 9222 snapshot` for per-command use, and says `--cdp` also accepts a full WebSocket URL for remote browser services. The same page states that CDP mode enables control of "Electron apps, Chrome/Chromium with remote debugging, WebView2 applications, Remote browser services (via WebSocket URL), Any browser exposing a CDP endpoint". Electron is named first in Vercel's own list, so the video is not stretching the tool into an unintended use.

The commands behind the two claimed advantages are also documented. The README describes `snapshot` as returning an accessibility tree with element references rather than screenshots, `console` for browser console output, `errors` for uncaught exceptions, and `network requests` with filtering by type, method, and status code. The specific console and network rows staged in frames 21 and 22 map onto commands that exist.

## The wiring is fussier than the diagram admits

Frames 6 and 7 attach the port chips to boxes labeled "dev server", and the audio says to "start its own dev server with an explicit remote debugging port". That conflates two processes. A Vite or webpack dev server serves renderer assets over HTTP and has no DevTools endpoint. `--remote-debugging-port` belongs to the Electron binary that hosts Chromium. [Electron's command-line switches documentation](https://www.electronjs.org/docs/latest/api/command-line-switches) lists `--remote-debugging-port` as "Enables remote debugging over HTTP on the specified `port`", and separately notes that switches can be appended with `app.commandLine.appendSwitch()` in the main script before the `ready` event fires. Electron's [main-process debugging guide](https://www.electronjs.org/docs/latest/tutorial/debugging-main-process) covers `--inspect` and `--inspect-brk` on port 9229 and does not mention `--remote-debugging-port` at all, which is a separate channel for a separate purpose.

Passing the switch on the command line is not guaranteed to work. Playwright [issue #39008](https://github.com/microsoft/playwright/issues/39008), opened January 28, 2026 against Playwright 1.57.0 and 1.58.0 with Electron 36.9.5 on macOS 15.6.1, reports the Electron binary rejecting the argument with `bad option: --remote-debugging-port=0` and states that "Electron 30+ rejects this flag at the CLI level before the Node.js script starts". The issue is closed with a linked fix, and the workaround named in the report is `app.commandLine.appendSwitch()`. I did not reproduce this myself, and Electron's docs still list the switch, so treat it as one credible report rather than a settled rule. For anyone following the video, it is the difference between a one-line npm script change and a code change in the main process.

There is also a live reliability issue in the tool itself. agent-browser [issue #1272](https://github.com/vercel-labs/agent-browser/issues/1272), opened April 19, 2026 against version 0.17.1 and still open, reports that when an externally launched browser restarts and gets a new `webSocketDebuggerUrl`, "the CDP launch command is silently skipped" because the daemon is already running, leaving the agent bound to a stale URL. Agents restart dev servers constantly. Silent failure against a stale endpoint is the exact failure mode that costs the most debugging time.

One widely cited CDP caveat does not apply here. Google's [March 17, 2025 post on remote debugging switches](https://developer.chrome.com/blog/remote-debugging-port) says that from Chrome 136, `--remote-debugging-port` and `--remote-debugging-pipe` "will no longer be respected if attempting to debug the default Chrome data directory" and "must now be accompanied by the `--user-data-dir` switch to point to a non-standard directory", as anti-infostealer hardening after App-Bound Encryption shipped. That restriction targets the real Chrome profile. An Electron app runs its own userData directory, so the video's setup sits outside the rule. The caveat matters for anyone who tries the same trick against their everyday Chrome.

## The DOM and console advantage is the strongest part of the argument

The claim that a CDP-attached agent gets structure instead of pixels holds up against the documentation. `snapshot` returns an accessibility tree with element references, which gives a model stable handles to act on rather than coordinates derived from an image. Reading `<button id="export" disabled>` directly answers a question that a screenshot only implies.

Console errors and network requests are the more valuable half. A pixel-based agent watching a failed export sees a red badge. A CDP-attached agent reads `TypeError: fps is undefined` at `export.ts:42` and a `POST /api/export 500` in the same breath. That is a diagnosis rather than an observation, and the `console`, `errors`, and `network requests` commands are all in the README. The video's framing of this as the reason failures become cheap to debug is fair.

The isolation argument is also structurally sound. Each agent addressing a distinct port is a hard binding, where computer use on one shared desktop is a soft one. The CDP docs add a wrinkle the video skips: when several sessions share one browser, `--pin-tab` is needed to keep strict tab binding, because "attaching with no binding opens a fresh tab instead of adopting an existing one", and a lost tab surfaces as a `tab_gone` error. Separate Electron processes on separate ports avoid that, but the tool clearly expects some session-management care.

## The cross-OS slide overstates what the audio says

The spoken claim is narrow and defensible. "Computer use usually does not work across different operating systems" and "if you're relying on macOS computer use, you wouldn't be able to do the same thing in the cloud" is a portability statement about a specific implementation. Porting a macOS screen-and-input harness to a headless Linux box is real work.

The slide makes a broader claim that the evidence contradicts. Frames 33 through 35 put red crosses on Windows, Linux, and Cloud VPS, which reads as computer use not working on those platforms. Anthropic's own [computer use reference implementation](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) is the opposite case. It describes itself as "a Linux desktop in Docker with X11 + VNC", and points to a separate best-practices quickstart that "runs natively on macOS (no container)". Linux in a container is the reference platform, not the unsupported one.

The video's own red banner, "No screen to click in the cloud", is the accurate version of the point and undercuts the grid above it. Even that is softened in practice by Xvfb and similar virtual displays, which is how the Docker reference implementation gets a screen at all. The honest form of the argument is that CDP removes the display dependency entirely, which is a real advantage without needing the grid.

## Compound exists, and it is an Electron app

The closing line, "it's been super helpful for me for building my own desktop app compound", checks out. [github.com/corporationdev/compound](https://github.com/corporationdev/compound) is a public MPL-2.0 repository for an Electron desktop application described as a professional video editor built for AI agents, with SolidJS modules as the document source and projects written as JSX that stays in sync with the visual canvas. Its README line is "Edit videos with Claude Code, Codex, Cursor, Copilot, or Gemini CLI." Local setup requires Node 22 and Bun 1.3.11. An Electron app driven by coding agents is precisely the workload that makes this video's setup worth building, so the recommendation comes from someone with the problem rather than from someone describing it abstractly.

## Key Takeaways

- The exact command shown on screen, `agent-browser --cdp 9222`, matches Vercel's CDP-mode documentation, which also offers `agent-browser connect 9222` for a persistent binding and names "Electron apps" first in its list of supported CDP targets.
- The DOM, console, and network advantage is backed by real commands. agent-browser's `snapshot` returns an accessibility tree with element references rather than screenshots, and `console`, `errors`, and `network requests` are documented in the README.
- The diagram attaches `--remote-debugging-port` to a "dev server", which is the wrong process. The switch belongs to the Electron binary, and a Playwright bug report from January 2026 says Electron 30+ rejected it as a CLI argument with `bad option: --remote-debugging-port=0`, pushing users toward `app.commandLine.appendSwitch()` in the main process.
- An open agent-browser bug from April 2026 reports the CDP connection silently keeping a stale `webSocketDebuggerUrl` when the target browser restarts, which is a predictable hazard for agents that restart dev servers.
- The cross-OS slide is wrong where the audio is right. Anthropic's computer use reference implementation runs on a Linux desktop in Docker with X11 and VNC, so the red cross on Linux does not survive contact with the primary source. The video's own banner, "No screen to click in the cloud", is the accurate version.
- Chrome 136's restriction on `--remote-debugging-port` against the default profile, published by Google on March 17, 2025, does not apply to an Electron app, because Electron uses its own userData directory. It does apply to anyone trying the same attach against their everyday Chrome.
- Whisper transcribed all 83.76 seconds of the 83-second video accurately, with no dropped audio and correct renderings of "Vercel's agent browser CLI", "CDP", "Electron", and "Git worktree". Its one distortion is lowercasing the product name in "my own desktop app compound", which turns Compound into a common noun. The transcript captures none of the visuals, so the literal command `agent-browser --cdp 9222`, the port numbers 9222 through 9224, the `Node + Chromium = Electron` slide, the HTML and console and network samples, the `Agent 2 clicked Agent 1's button` banner, the four-tile OS grid with red crosses, the "Spin up 24 agents" panel on ports 9222 through 9245, and the title card `Run 10 billion Electron apps at the same time` are all invisible to a transcript-only reader.
- Unverified: Isaac Dyor's professional role and whether Compound is his own project rather than one he contributes to. Search results associate him with Wordware (YC S24) and show a Compound pull request authored by his GitHub handle, but LinkedIn and the pull request itself were not pages I loaded, so I am not asserting either. Also unverified: whether multiple agents can hold simultaneous CDP sessions against separate Electron instances at the scale the video implies, since the "24 agents on one VPS" figure appears only as an animated slide with no benchmark behind it. I also could not confirm the widely repeated claim that only one CDP debug session at a time can attach to an Electron app, so I have not relied on it. Finally, the Playwright Electron 30+ flag rejection rests on a single closed issue report that I did not reproduce, and Electron's own documentation still lists `--remote-debugging-port` without that caveat.

## Resources

- [Better way to test Electron apps](https://www.tiktok.com/@isaacdyor/video/7688259587467709710) - the source video, 3,170 views, 142 likes, 8 comments, and 22 reposts at capture, running 83 seconds
- [vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser) - establishes the tool exists under Vercel Labs, is Apache-2.0 licensed with 43.1k stars at capture, installs via npm, Homebrew, or Cargo, and documents `snapshot`, `console`, `errors`, and `network requests`
- [agent-browser CDP mode documentation](https://raw.githubusercontent.com/vercel-labs/agent-browser/main/docs/src/app/cdp-mode/page.mdx) - establishes `agent-browser connect 9222` and `agent-browser --cdp 9222 snapshot`, the WebSocket URL form, `--auto-connect` discovery, `--pin-tab` for shared browsers, and the statement that CDP mode controls "Electron apps"
- [Electron command line switches](https://www.electronjs.org/docs/latest/api/command-line-switches) - establishes `--remote-debugging-port` as a supported switch and that switches can be appended via `app.commandLine.appendSwitch()` before the `ready` event
- [Electron debugging the main process](https://www.electronjs.org/docs/latest/tutorial/debugging-main-process) - establishes that main-process debugging uses `--inspect` and `--inspect-brk` on port 9229 and is a separate channel from remote debugging
- [Playwright issue #39008](https://github.com/microsoft/playwright/issues/39008) - reports Electron 36.9.5 rejecting `--remote-debugging-port=0` as a CLI argument, claims Electron 30+ rejects the flag before the Node script starts, and names `app.commandLine.appendSwitch()` as the workaround
- [agent-browser issue #1272](https://github.com/vercel-labs/agent-browser/issues/1272) - open bug reporting that a restarted external browser leaves agent-browser on a stale `webSocketDebuggerUrl` because "the CDP launch command is silently skipped"
- [Changes to remote debugging switches to improve security (Chrome for Developers, March 17, 2025)](https://developer.chrome.com/blog/remote-debugging-port) - establishes that from Chrome 136 the remote debugging switches are ignored against the default Chrome data directory and require `--user-data-dir`
- [anthropics/anthropic-quickstarts computer-use-demo](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) - establishes that the computer use reference implementation is "a Linux desktop in Docker with X11 + VNC", contradicting the video's red cross on Linux
- [corporationdev/compound](https://github.com/corporationdev/compound) - establishes that Compound is a real, public, MPL-2.0 Electron desktop app, an agent-driven video editor built on SolidJS with JSX project files
