npx playwright screenshot, pdf, codegen, open) launches a
new browser and exposes a small utility command set. The newer @playwright/cli adds a
run-code command and can attach to a browser, but by default both still drive a separate
browser profile, not the Chrome you're using right now.| Playwriter | Playwright CLI | |
| Browser | Your running Chrome (extension) | New browser by default |
| Login state | Your live sessions, zero setup | Persistent profile, separate from your daily Chrome |
| Extensions | Your existing ones | None by default |
| Captchas | Disconnect extension to solve manually | Managed automation profile |
| Collaboration | Same tab as user | Separate window |
| Programmable JS | execute with persistent state | run-code (no cross-call state) |
| Raw CDP access | First-class | Not exposed |
| Native video | chrome.tabCapture (30-60fps) | Trace / screencast based |
| Cloud + remote tab share | Built-in | No |
# Playwright CLI: fresh browser, no state npx playwright screenshot https://example.com shot.png # Playwriter: your browser, your cookies, your extensions playwriter -s 1 -e "state.page = await context.newPage(); await state.page.goto('https://example.com'); await state.page.screenshot({ path: './shot.png', scale: 'css' })"
getCDPSession. This lets
agents set breakpoints, profile performance, intercept network requests, and live-edit
page scripts. The Playwright CLI doesn't expose CDP at all.playwriter -s 1 -e "state.cdp = getCDPSession({ page: state.page })" playwriter -s 1 -e "state.cdp.send('Performance.getMetrics').then(console.log)"
chrome.tabCapture for native 30-60fps recording that survives page navigation.playwriter -s 1 -e "recording.start({ page: state.page, outputPath: './demo.mp4' })" playwriter -s 1 -e "state.page.click('a'); state.page.waitForLoadState('domcontentloaded')" playwriter -s 1 -e "recording.stop({ page: state.page })"