From 8871a3f36ff94e9dc41dc895f3a274b4e8bcb377 Mon Sep 17 00:00:00 2001
From: "Tommy D. Rossi"
- Playwriter lets you control your Chrome browser with the full
- Playwright API. A Chrome extension, a local relay, and a CLI. No new
- browser windows, no Chrome flags, no context bloat.{" "}
+ You want your agent to control the browser. Your actual
+ Chrome {" \u2014 "} with logins, extensions, and cookies already
+ there. Not a headless instance that gets blocked by every captcha
+ and bot detector.{" "}
Star on GitHub.
- Every browser automation MCP I tried either spawns a new Chrome
- instance or forces you into a limited set of predefined tools. Playwriter
- does neither. It connects to the browser you already have open,
- exposes the full Playwright API through a single{" "}
-
+ Playwriter gives agents the full Playwright API through
+ a single
- Three steps. Extension, icon click, then you're automating.
+ Three steps and your agent is browsing.
- The extension uses
- No Chrome restart required. No
+ Because the agent works in your browser, you can
+ collaborate. You see everything it does in real time. When it hits
+ a captcha, you solve it. When a consent wall
+ appears, you click through it. When the agent gets stuck, you
+ disable the extension on that tab, fix things manually, re-enable
+ it, and the agent picks up where it left off.
+
+ You{"'"}re not watching a remote screen or reading logs after the
+ fact. You{"'"}re sharing a browser {" \u2014 "} the
+ agent does the repetitive work, you step in when it needs a human.
- The core feedback loop is observe → act → observe.
- Accessibility snapshots are the primary way to read page state. They return
- the full interactive element tree as text, with Playwright locators attached
- to every element.
+ Your agent needs to see the page before it can act.
+ Accessibility snapshots return every interactive element as text,
+ with Playwright locators attached. 5{"\u2013"}20KB instead of
+ 100KB+ for a screenshot {" \u2014 "} cheaper, faster, and the
+ agent can parse them without vision.
- Snapshots are text. They cost a fraction of what screenshots cost in
- tokens. Use them as your primary debugging tool. Only reach for
- screenshots when spatial layout matters — grids, dashboards, maps.
+ Use snapshots as the primary way to read pages. Only
+ reach for screenshots when spatial layout matters {" \u2014 "} grids,
+ dashboards, maps.
- For pages where spatial layout matters,{" "}
+ When the agent needs to understand where things are on
+ screen,{" "}
- Each session runs in an isolated sandbox with its own{" "}
-
- Full Chrome DevTools Protocol access. Set breakpoints, step through
- code, inspect variables at runtime. Live-edit page scripts and CSS
- without reloading.
+ Things no other browser MCP can do. Set breakpoints,
+ step through code, inspect variables at runtime. Live-edit
+ page scripts and CSS without reloading. Full Chrome DevTools
+ Protocol access, not a watered-down subset.
` must have explicit `width` and `height` attributes matching the intrinsic pixel dimensions of the source file. Add `style={{ height: "auto" }}` to keep it responsive. This lets the browser reserve the correct aspect ratio space before the image loads, preventing layout shift.
+
+```tsx
+
+```
+
+Use `sips -g pixelWidth -g pixelHeight
execute tool, and gets out of the way.
- One tool. Any Playwright code. No wrappers.
+ Other browser MCPs either spawn a fresh Chrome or give agents
+ a fixed set of tools. New Chrome means no logins, no extensions,
+ instant bot detection, and double the memory. Fixed tools mean the
+ agent can{"'"}t profile performance, can{"'"}t set breakpoints,
+ can{"'"}t intercept network requests {" \u2014 "} it can only do what someone
+ decided to expose.
+ execute tool. One tool, any Playwright code,
+ no wrappers. Low context usage because there{"'"}s no schema bloat
+ from dozens of tool definitions. And it runs in your existing browser,
+ so nothing extra gets spawned.
@@ -130,12 +142,12 @@ export default function IndexPage() {
chrome.debugger to
- attach to tabs where you clicked the icon. It opens a WebSocket
- connection to a local relay server. The CLI (or MCP, or your own
- Playwright script) connects to the same relay. CDP commands flow
- through; the extension forwards them to Chrome and sends responses
- back.
+ Click the extension icon on a tab {" \u2014 "} it attaches via{" "}
+ chrome.debugger and opens a WebSocket to a
+ local relay. Your agent (CLI, MCP, or a Playwright script) connects
+ to the same relay. CDP commands flow through; the extension
+ forwards them to Chrome and sends responses back. No Chrome restart,
+ no flags, no special setup.
--remote-debugging-port{" "}
- flags. The extension handles the CDP attachment transparently, and
- the relay multiplexes sessions so multiple agents or CLI instances
- can work with the same browser simultaneously.
+ The relay multiplexes sessions, so multiple agents
+ or CLI instances can work with the same browser at the same time.
+ screenshotWithAccessibilityLabels overlays{" "}
- Vimium-style labels on every interactive element. Take a screenshot,
- read the labels, click by reference.
+ Vimium-style labels on every interactive element.
+ The agent sees the screenshot, reads the labels, and clicks by
+ reference.
state object. Variables, pages, listeners
- persist between calls within a session. Different sessions get
- different state. Browser tabs are shared.
+ Run multiple agents at once without them stepping on
+ each other. Each session is an isolated sandbox with its own{" "}
+ state object. Variables, pages, and listeners
+ persist between calls. Browser tabs are shared, but state is not.
- Intercept requests and responses to reverse-engineer APIs, scrape
- data, or debug network issues. Store captured data in{" "}
- state and analyze across calls.
+ Let the agent watch network traffic to
+ reverse-engineer APIs, scrape data behind JavaScript rendering,
+ or debug failing requests. Captured data lives in{" "}
+ state and persists across calls.
- This is faster than scrolling through DOM. Capture the real API - calls, inspect their schemas, and replay them with different - parameters. Works for pagination, authenticated endpoints, and - anything behind JavaScript rendering. + Faster than scraping the DOM. The agent captures the + real API calls, inspects their schemas, and replays them with + different parameters. Works for pagination, authenticated endpoints, + and anything behind client-side rendering.
- Record the active tab as video using{" "}
- chrome.tabCapture. The recording runs in
- the extension context, so it survives page navigation. Video is saved
- as MP4.
+ Have the agent record what it{"'"}s doing as MP4
+ video. The recording uses chrome.tabCapture and
+ runs in the extension context, so it survives page
+ navigation.
- How Playwriter compares to other browser automation approaches. + Why use this over the alternatives.
- Control Chrome on any machine from anywhere over the internet. - The relay runs on the host alongside Chrome. - A{" "} + Control Chrome on a remote machine {" \u2014 "} a headless + Mac mini, a cloud VM, a devcontainer. A{" "} traforo{" "} - tunnel exposes it through Cloudflare, giving you a secure public URL. - No VPN, no firewall rules, no port forwarding. + tunnel exposes the relay through Cloudflare. No VPN, no + firewall rules, no port forwarding.
- Also works on a LAN without tunnels — just set{" "}
+ Also works on a LAN without tunnels {" \u2014 "} just set{" "}
- Playwriter is local by default. The relay runs on{" "}
- PLAYWRITER_HOST=192.168.1.10. Works for MCP
- too — set PLAYWRITER_HOST and{" "}
+ too {" \u2014 "} set PLAYWRITER_HOST and{" "}
PLAYWRITER_TOKEN in your MCP client env config.
Use cases: headless Mac mini, remote user support,
multi-machine automation, dev from a VM or devcontainer.
@@ -454,28 +483,27 @@ export default function IndexPage() {
localhost:19988 and only accepts connections
- from the extension. There's no remote server, no account, no
- telemetry.
+ Everything runs on your machine. The relay binds
+ to localhost:19988 and only accepts connections
+ from the extension. No remote server, no account, no telemetry.