wucong220/playwright-direct
Lets Playwright drive your already-signed-in Chrome or Edge over CDP via a companion extension, with no debug port, relaunch or re-login.
Exposes a CDP endpoint from inside the browser instead of from a launch flag, using an extension that calls chrome.debugger on the real tab. Playwright connects with connectOverCDP to ws://127.0.0.1:43187/cdp/direct, which means scripts run against the browser you are actually logged into — existing sessions, cookies and extensions included — with no relaunch and no separate automation profile. The pairing code exists so that a local process cannot silently attach to your browser: the endpoint is loopback-only and refuses to serve until the four-digit code is approved.
Install
dsh plugin --profile web add github:wucong220/playwright-directInstalling the package is only half the setup: you must also load the companion extension once. Open chrome://extensions in the browser you want to drive, enable Developer mode, Load unpacked and pick extension/ from the installed package (usually under ~/.dsh/profiles/web/node_modules/playwright-direct/extension), then open http://127.0.0.1:43187/setup and approve the four-digit pairing code. Restart DSH afterwards. Without the extension the CDP endpoint has nothing to attach to.
Compatibility
Built for Chrome and Edge, and it exists because Chrome 136+ ignores --remote-debugging-port when paired with the default user-data directory, which broke the older attach-to-my-real-browser trick. The extension holds the debugger permission, so the browser will show its own warning during install. The CDP listener binds to 127.0.0.1:43187; if that port is taken the endpoint will not come up. Node.js and a DSH profile that can load a bundle patch are required.
Details
- Repo: wucong220/playwright-direct
- Category: Tools & Capabilities
- Stars: 0
- Version: Unpinned; this line installs from the GitHub default branch
Alternatives
chendefine/dsh-web-fetch-playwright · JohnXu22786/worktree-mgr · polaris-smart/dsh-devices