Commit Graph

363 Commits

Author SHA1 Message Date
Tommy D. Rossi 0903105129 docs: use .mp4 extension in recording examples 2026-01-27 13:35:23 +01:00
Tommy D. Rossi 53450ee36f refactor: remove dependency injection, use direct imports
- Export store, connectionManager, logger, sendMessage, getTabBySessionId from background.ts
- recording.ts now imports directly instead of using initRecording()
- Simplify RecordingRelay constructor to take params directly instead of interface
2026-01-27 13:35:23 +01:00
Tommy D. Rossi 4a8caf19bd refactor: extract recording code into separate modules with proper types
- Create extension/src/offscreen-types.ts with Chrome tabCapture constraint types
- Create extension/src/recording.ts extracting recording functions from background.ts
- Create playwriter/src/recording-relay.ts extracting recording logic from cdp-relay.ts
- Remove 'as any' usages by adding proper MediaStream constraint types
- Add typesafe message types for offscreen document communication
- Remove duplicate OUR_EXTENSION_IDS constant (uses EXTENSION_IDS from utils.ts)
2026-01-27 13:35:23 +01:00
Tommy D. Rossi 98c62eab60 Update utils.ts 2026-01-27 13:35:23 +01:00
Tommy D. Rossi 54d3f02a5b feat: support concurrent screen recordings across multiple tabs
- Change offscreen.ts from single recording variable to Map<tabId, RecordingState>
- Update all recording message handlers to route by tabId
- Track sessionId in relay server for proper recording lookup when stopping
- All recording operations now consistently require tabId
2026-01-27 13:35:23 +01:00
Tommy D. Rossi c9e8361a54 fix: address PR review comments
- Fix misleading comment about user gesture requirement in background.ts
- Remove unused 'target' variable in /recording/stop endpoint
- Fix /recording/cancel to not delete all recordings (handled by event)
- Remove redundant security middlewares (CORS handles it)
2026-01-27 13:35:22 +01:00
Tommy D. Rossi df63f418e5 feat: add Chrome flags for automated recording without user interaction
- Add getChromeRestartCommand() with --allowlisted-extension-id and --auto-accept-this-tab-capture flags
- Move EXTENSION_IDS to utils.ts for cleaner imports
- Add sessionId support for multi-tab recording
- Add helpful error message when activeTab permission is missing
- Add null check for empty extension result
- Document offscreen recording flow with ASCII diagram
2026-01-27 13:35:22 +01:00
Tommy D. Rossi 8449006e59 refactor: simplify screen recording code
- Fix vite output path (was broken lib/background.mjs, now background.js)
- Import recording types from protocol.ts instead of duplicating in background.ts
- Remove dead getSessionId() and unused sessionId params from screen-recording.ts
- Replace 4 executor wrapper functions with single withRecordingDefaults helper
- Fix binary chunk routing with lastRecordingMetadataTabId tracking
- Add ExtensionStopRecordingResult type for proper extension/relay separation

Saves ~56 lines while improving correctness of multi-tab recording.
2026-01-27 13:35:22 +01:00
Tommy D. Rossi 3b5427ebe8 update notes on permissions for recording 2026-01-27 13:35:22 +01:00
Tommy D. Rossi 608afc8d54 fix: clear setTimeout on successful recording stop to prevent process hang 2026-01-27 13:35:22 +01:00
Tommy D. Rossi b159d6fbc7 refactor: use satisfies for fetch body types in screen-recording 2026-01-27 13:35:22 +01:00
Tommy D. Rossi e79dd472db test: skip recording test, write proper test flow for manual testing 2026-01-27 13:35:22 +01:00
Tommy D. Rossi 74497c2a1a feat: implement screen recording via chrome.tabCapture with offscreen document
- Use chrome.tabCapture.getMediaStreamId() from service worker
- Pass stream ID to offscreen document for MediaRecorder
- Recording survives page navigation (unlike getDisplayMedia)
- Requires user to click extension icon first (activeTab permission)
- Add esbuild to build offscreen.ts separately
- Update prompt docs with recording instructions
2026-01-27 13:35:22 +01:00
Tommy D. Rossi e56e27e5e5 WIP: screen recording via chrome.tabCapture
Work in progress for navigation-safe screen recording.

Implemented:
- tabCapture permission in manifest
- Recording handlers in extension background.ts
- Recording endpoints in relay server
- Binary WebSocket streaming for video chunks
- Protocol types for recording messages
- Executor integration

Needs:
- Offscreen document implementation (tabCapture not available in service workers)
- Connect background.ts to offscreen document via messages
- Update manifest for offscreen document

The offscreen.ts/html files are scaffolding for this next step.
2026-01-27 13:35:22 +01:00
Tommy D. Rossi d51d8b8e72 feat(cdp): allow iframe targets and serialize extension builds 2026-01-26 14:56:17 +01:00
Tommy D. Rossi 1f59a819da update test snapshots 2026-01-26 14:23:33 +01:00
Tommy D. Rossi c8bd87d8f6 release: playwriter@0.0.56 2026-01-26 14:10:26 +01:00
Tommy D. Rossi 9e79565e1a test: add youtube navigation hang regression 2026-01-26 14:09:42 +01:00
Tommy D. Rossi 3fa98ab689 fix(cdp): resume filtered targets to avoid hung navigations 2026-01-26 13:54:47 +01:00
Tommy D. Rossi 67e8976d2f cover auto-enable after closing pages 2026-01-26 13:50:22 +01:00
Tommy D. Rossi 60495a8b9a add auto-enable mcp test for no pages 2026-01-26 13:42:29 +01:00
Tommy D. Rossi db93e0d841 Fix auto-enable page selection when no pages 2026-01-26 13:31:46 +01:00
Tommy D. Rossi a64fc2d8a0 add cdp jsonl logging and update log docs 2026-01-26 13:28:18 +01:00
Tommy D. Rossi 4d2606253b add source param in CDP messages 2026-01-26 13:07:59 +01:00
Tommy D. Rossi 2eb2c4fe3d set default timeout 2026-01-26 12:54:21 +01:00
Tommy D. Rossi 4fa618134d nicer logging of returned output 2026-01-26 12:46:36 +01:00
Tommy D. Rossi 5ade53bed1 print logs using node.js util.inspect 2026-01-26 12:18:58 +01:00
Tommy D. Rossi b000fd42b5 release: playwriter@0.0.55 2026-01-25 23:04:54 +01:00
Tommy D. Rossi 45cdc372a8 refactor: move SKILL.md to src, add playwriter skill command
- Move skills/playwriter/SKILL.md to playwriter/src/skill.md (source of truth)
- Add 'playwriter skill' CLI command to output full docs
- Make skills/playwriter/SKILL.md a lightweight stub pointing to CLI
- Generate prompt.md to dist/ instead of src/
- Strip CLI-only content from MCP prompt
2026-01-25 16:18:23 +01:00
Tommy D. Rossi dba08e932f chore: stop tracking generated prompt.md 2026-01-25 15:04:55 +01:00
Tommy D. Rossi 8313b7a43a release: playwriter@0.0.54 2026-01-25 15:02:59 +01:00
Tommy D. Rossi b29b1395d1 Optimize aria snapshot ref lookup 2026-01-25 15:02:26 +01:00
Tommy D. Rossi 5175f5cc8e Update executor.ts 2026-01-25 14:58:08 +01:00
Tommy D. Rossi ee1f9729d6 add sse test to make sure responses are not buffered 2026-01-25 14:54:08 +01:00
Tommy D. Rossi b769df94e3 wait for extension only if ws restarted 2026-01-25 14:44:35 +01:00
Tommy D. Rossi 316a10e9c9 remove Network.enable buffering override 2026-01-25 14:22:34 +01:00
Tommy D. Rossi baac31ab6a add test for notion.so not loading 2026-01-25 14:12:42 +01:00
Tommy D. Rossi 26a353e3bc use waitForPageLoad inall examples 2026-01-25 13:48:04 +01:00
Tommy D. Rossi a15b06082b Add stable extension ID for development builds
Inject manifest key via vite plugin for dev/test builds (not production).
This ensures all developers get the same extension ID: pebbngnfojnignonigcnkdilknapkgid

- Update vite.config.mts to inject key when !PRODUCTION
- Update release script to use PRODUCTION=true
- Replace old hardcoded dev extension ID in all files
2026-01-25 11:19:51 +01:00
Tommy D. Rossi 77ea5512d0 Increase default execution timeout from 5s to 10s 2026-01-24 18:44:16 +01:00
Tommy D. Rossi 5469af0d30 Add playwriter logfile command and fix documentation paths 2026-01-24 18:31:33 +01:00
Tommy D. Rossi 4cbb3102f8 fix: pass cwd to executor in MCP so file operations use correct directory 2026-01-24 18:07:34 +01:00
Tommy D. Rossi 38b1b6d3ed docs: improve session isolation, extract MCP to separate file, add remote CLI 2026-01-24 15:10:53 +01:00
Tommy D. Rossi ad6ce1c2a8 remove old md files 2026-01-24 14:29:47 +01:00
Tommy D. Rossi 31bfddef74 chore: release playwriter@0.0.53 2026-01-24 14:26:26 +01:00
Tommy D. Rossi e11322905e add colors to CLI setup messages 2026-01-24 14:25:20 +01:00
Tommy D. Rossi 1d744e7995 fix CLI relay server startup and extension reconnection
- detect source vs compiled via __filename.endsWith('.ts') instead of env var
- add waitForExtension() to poll for extension connection after server start
- CLI waits up to 10s for extension to reconnect before executing commands
2026-01-24 14:23:50 +01:00
Tommy D. Rossi 1474b2c38c chore: release playwriter@0.0.52 2026-01-24 13:36:13 +01:00
Tommy D. Rossi 2a62fa60d6 add snapshot format option with deduplication for accessibility snapshots
- add compactSnapshot, interactiveSnapshot, deduplicateSnapshot functions
- add format option to accessibilitySnapshot() with default 'interactive-dedup'
- deduplication removes redundant parent names that repeat child content
- compression stats: HN 72% smaller, GitHub 68% smaller vs raw
- add format documentation comment explaining expected aria snapshot structure
2026-01-24 13:32:25 +01:00
Tommy D. Rossi 19d8c78d90 delete files 2026-01-24 13:19:36 +01:00