Commit Graph

683 Commits

Author SHA1 Message Date
Tommy D. Rossi 8b603ff766 fix: show log file path on connection refused error 2026-01-22 20:16:03 +01:00
Tommy D. Rossi 2b9d6b4952 feat: improve error messages for extension connection states
- Split NO_TABS_ERROR into EXTENSION_NOT_CONNECTED_ERROR and NO_TABS_ENABLED_ERROR
- Add checkExtensionStatus() to detect extension state before connecting
- Provide actionable guidance in error messages
2026-01-22 20:16:00 +01:00
Tommy D. Rossi 7e2b4e2546 fix: restore relay server auto-recovery on every execute
The old mcp.ts called ensureRelayServer on every execute call to
auto-recover from relay server crashes. This was missing in the
refactored code.
2026-01-22 20:04:05 +01:00
Tommy D. Rossi 62cf6db240 security: block browser access to CLI endpoints
- Add localhost-only check for /cli/* endpoints
- Reject requests with Origin header (browsers always send it, CLI tools don't)
- Prevents website-based attacks even with CORS
2026-01-22 19:54:16 +01:00
Tommy D. Rossi 67dd9aaef4 feat: add -e/--eval CLI flag for code execution
- Add -e/--eval flag to execute JavaScript code via relay server
- Extract PlaywrightExecutor class to shared executor.ts module
- Extract relay server utilities to relay-client.ts
- Add /cli/execute, /cli/reset, /cli/sessions endpoints
- Fix CDP session client ID collision by using fresh unique URLs for each connection
2026-01-22 19:48:43 +01:00
Tommy D. Rossi 58dc932990 Add CLI usage instructions to playwriter skill 2026-01-22 19:31:15 +01:00
Tommy D. Rossi eea0e57a1b Generate playwriter skill for add-skill discovery 2026-01-22 19:27:55 +01:00
Tommy D. Rossi 7fa6049b88 Update PLAYWRITER_AGENTS.md 2026-01-21 21:22:35 +01:00
Tommy D. Rossi 8ab0fda2b7 fix: preserve tabs during relay reconnects 2026-01-21 21:20:29 +01:00
Tommy D. Rossi 93fdcb6b35 feat: first extension with active tabs keeps connection instead of being replaced
- Server rejects new extension (code 4002) if existing has active tabs
- Idle extensions (no tabs) can still be replaced
- Extension properly enters polling mode when rejected during handshake
- /extension/status now returns activeTargets count for smarter reconnection
2026-01-21 19:09:37 +01:00
Tommy D. Rossi c3a6003fa9 gitignore shadcn-ui-accessibility.md snapshot 2026-01-21 18:22:34 +01:00
Tommy D. Rossi d444079e9f use my own install-mcp lib 2026-01-20 14:25:02 +01:00
Tommy D. Rossi 495035ccef fix: sharp fallback with viewport clipping when unavailable 2026-01-19 14:07:01 +01:00
Tommy D. Rossi 6af2373fe6 agents 2026-01-17 00:34:41 +01:00
Tommy D. Rossi 141ace59d7 Update prompt.md 2026-01-17 00:18:43 +01:00
Tommy D. Rossi d2925832aa serve: add --replace flag, make --token optional for localhost 2026-01-16 19:43:39 +01:00
Tommy D. Rossi 868d339a09 exit serve if already connected 2026-01-16 19:36:12 +01:00
Tommy D. Rossi 69ac4db338 release: playwriter@0.0.49 2026-01-16 16:25:24 +01:00
Tommy D. Rossi 11d0612736 Merge branch 'main' of https://github.com/remorses/playwriter 2026-01-16 16:24:16 +01:00
FiftyX 5631fc3d19 add CORS support to relay server for local extension development (#25)
* fix: add CORS middleware to allow extension connection

* fix(cors): validate extension ID to prevent other extensions from accessing endpoints

---------

Co-authored-by: Tommy D. Rossi <beats.by.morse@gmail.com>
2026-01-16 16:24:06 +01:00
Tommy D. Rossi cc699670b4 fix: clarify error messages when another Playwriter extension connects 2026-01-16 13:07:24 +01:00
Tommy D. Rossi 7ebd3c190e chore: release playwriter@0.0.48 2026-01-15 16:51:18 +01:00
Tommy D. Rossi 68f5896ab6 Update README.md 2026-01-15 16:50:11 +01:00
Tommy D. Rossi 0ba4acfbce fix: disable Network buffering by default to fix SSE streaming
Fixes #22

CDP's Network.enable buffers response bodies by default, which breaks
SSE/streaming - data arrives at Chrome but ReadableStream never receives it.

Changes:
- Intercept Network.enable in relay, default maxTotalBufferSize: 0
- Agents can re-enable buffering via Network.disable + Network.enable
  with explicit buffer sizes when they need response.body()
- Added test and documentation for reading response bodies
2026-01-15 15:55:18 +01:00
Tommy D. Rossi 171317f8cb fix: auto-switch to another page when default page is closed 2026-01-15 13:43:45 +01:00
Tommy D. Rossi cda69383f0 clean up deps: remove unused, update zod v4, replace chalk with picocolors 2026-01-15 13:32:54 +01:00
Tommy D. Rossi 423365caae resize screenshots with sharp to optimize Claude token usage 2026-01-15 13:26:33 +01:00
Tommy D. Rossi b7738ffdd5 tell about using css scale for screenshots 2026-01-15 13:23:28 +01:00
Tommy D. Rossi b86e215570 Create CHANGELOG.md 2026-01-15 12:51:23 +01:00
Tommy D. Rossi 59583703fb Update package.json 2026-01-15 12:51:02 +01:00
Tommy D. Rossi 415c9f839f Update PLAYWRITER_AGENTS.md 2026-01-14 17:56:37 +01:00
Tommy D. Rossi d6d7a63acd Update .gitignore 2026-01-14 17:43:22 +01:00
Tommy D. Rossi 939bc4ad75 release: playwriter@0.0.47 2026-01-14 17:41:28 +01:00
Tommy D. Rossi 9a15af8b42 Update package.json 2026-01-14 17:40:41 +01:00
Tommy D. Rossi 330d65e8f9 refactor: consolidate extension ID arrays and centralize target filtering 2026-01-14 17:36:46 +01:00
Tommy D. Rossi 17a15f6c49 framer html not fetched 2026-01-14 17:33:25 +01:00
Tommy D. Rossi 8b9fe157b4 fix: improve connection reliability with global timeout and IPv4
- Use 127.0.0.1 instead of localhost to avoid DNS/IPv6 resolution issues
- Add 15s global timeout wrapper around connect() to prevent hanging forever
- Reduce HTTP retry attempts from 30 to 5 (maintainLoop retries anyway)
- Fix WebSocket cleanup: close socket on timeout to prevent orphaned connections
- Improve settled state tracking in WebSocket connection promise
2026-01-14 12:13:25 +01:00
Tommy D. Rossi 0f980f2fa5 Update htmlrewrite test snapshots 2026-01-14 12:09:35 +01:00
Tommy D. Rossi dcaaf68f1a Make wsUrl optional in getCDPSessionForPage, default to getCdpUrl() 2026-01-14 12:09:34 +01:00
Tommy D. Rossi e6d9cfe5e4 docs: clarify WebSocket security uses Origin validation, not CORS 2026-01-14 12:09:32 +01:00
Tommy D. Rossi 1fd0242277 Allow attaching to our own extension pages while blocking other extensions 2026-01-14 12:07:28 +01:00
Tommy D. Rossi cfe3059fee Merge pull request #17 from Pipboyguy/main
fix: recommend domcontentloaded for page.goto()
2026-01-13 17:28:33 +01:00
Marcel Coetzee a6b90ba9e5 fix: use domcontentloaded instead of load everywhere
- getCurrentPage() waitForLoadState: 'load' -> 'domcontentloaded'
- prompt.md: consistent guidance for domcontentloaded
2026-01-13 17:14:13 +02:00
Tommy D. Rossi cbe62bc1a4 release: playwriter@0.0.46 2026-01-13 00:14:58 +01:00
Tommy D. Rossi 3ae65a2dd6 update agents 2026-01-13 00:13:19 +01:00
Tommy D. Rossi 1dcfee7eab fix: limit screenshot dimensions to 2000px for Claude API compatibility 2026-01-13 00:10:51 +01:00
Tommy D. Rossi b1e7852c57 Add MIT license 2026-01-12 23:50:51 +01:00
Tommy D. Rossi 9849afad16 fix: clean up typos and improve phrasing in AGENTS.md 2026-01-12 23:50:25 +01:00
Tommy D. Rossi f27486c80e release: playwriter@0.0.45 2026-01-12 19:02:23 +01:00
Tommy D. Rossi 3ac560792a feat: add CDP discovery endpoints (/json/version, /json/list)
Standard Chrome DevTools Protocol HTTP discovery endpoints that allow
tools like Playwright to connect using just the HTTP URL.

- /json/version returns browser info and webSocketDebuggerUrl
- /json/list returns array of connected targets
- Supports GET/PUT methods and trailing slashes for compatibility
2026-01-12 18:46:21 +01:00