Commit Graph

132 Commits

Author SHA1 Message Date
Tommy D. Rossi a1178cbd35 add Ghost Browser API integration
Exposes chrome.ghostPublicAPI, chrome.ghostProxies, and chrome.projects
in the executor sandbox when running in Ghost Browser.

- protocol.ts: add GhostBrowserCommandMessage type
- background.ts: handle ghost-browser messages, call chrome APIs
- cdp-relay.ts: route ghost-browser commands to extension
- executor.ts: inject chrome object with Proxy-based API namespaces
- skill.md: document Ghost Browser integration with examples

Enables multi-identity automation for managing multiple accounts,
rotating proxies per tab/identity, and isolated cookie sessions.
2026-02-04 13:09:41 +01:00
Tommy D. Rossi a52ec9a8f2 add Ghost Browser API type definitions
Extracted from Ghost Browser.app binary. Includes:
- chrome.ghostPublicAPI: tab/identity management
- chrome.ghostProxies: full proxy control per tab/identity/session
- chrome.projects: identity/workspace/session management
- Extended chrome.tabs with Ghost-specific properties
2026-02-04 12:55:03 +01:00
Tommy D. Rossi a9a40e1183 fix screen recording: resolve relative paths, buffer chunks, wait for encoder 2026-01-29 23:30:01 +01:00
Tommy D. Rossi db54c35b83 mp4 2026-01-29 20:30:10 +01:00
Tommy D. Rossi 4251562ff7 no MCP in name 2026-01-29 20:23:52 +01:00
Tommy D. Rossi 7e4dc3fd18 Update welcome.html 2026-01-27 18:39:55 +01:00
Tommy D. Rossi 5dc39cc4fe style(extension): tweak welcome page text opacity and remove redundant copy 2026-01-27 18:39:43 +01:00
Tommy D. Rossi 653f00c3a3 feat(extension): redesign welcome page with Prism.js syntax highlighting 2026-01-27 18:38:41 +01:00
Tommy D. Rossi 67d017237e fix(cdp): isolate extension builds and keep oopif auto-attach 2026-01-27 16:05:15 +01:00
Tommy D. Rossi a8412343e1 fix merge artifacts. fix build 2026-01-27 13:54:26 +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 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 050c6d5b50 feat: use MP4 format for screen recording instead of WebM 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 09f502cc43 Update background.ts 2026-01-27 13:35:22 +01:00
Tommy D. Rossi b52928cc90 refactor: move HTML files to src/, use vite HTML entry points
- Move welcome.html to src/
- Use vite HTML inputs instead of static copy for offscreen.html and welcome.html
- Source HTML references .ts, vite transforms to .js
- Update paths in background.ts to src/
2026-01-27 13:35:22 +01:00
Tommy D. Rossi f8d6640819 refactor: use vite rollupOptions instead of esbuild for offscreen.ts 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 81988c3305 show cli examples in welcome 2026-01-27 13:29:03 +01:00
Tommy D. Rossi d4107d1ddd fix(extension): detach child sessions on parent detach 2026-01-26 15:04:37 +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 4d2606253b add source param in CDP messages 2026-01-26 13:07:59 +01:00
Tommy D. Rossi dc771ddc1d sync tab state for automated tabs 2026-01-26 12:56:27 +01:00
Tommy D. Rossi 0fb9d2c229 Clamp extension log payloads 2026-01-25 15:01:40 +01:00
Tommy D. Rossi d4e49b2d5d nn 2026-01-25 14:58:00 +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 f9869a59f2 refactor: move welcome.html to src/, simplify vite build config, cleanup cli.ts formatting 2026-01-23 23:57:25 +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 cc699670b4 fix: clarify error messages when another Playwriter extension connects 2026-01-16 13:07:24 +01:00
Tommy D. Rossi b86e215570 Create CHANGELOG.md 2026-01-15 12:51:23 +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 1fd0242277 Allow attaching to our own extension pages while blocking other extensions 2026-01-14 12:07:28 +01:00
Tommy D. Rossi e87f801700 release: playwriter@0.0.40, extension@0.0.67 2026-01-05 10:12:42 +01:00
Tommy D. Rossi 8e62b657cc fix: query playwriter tab group by title instead of caching ID
- Remove global playwriterGroupId cache that could become stale
- Query chrome.tabGroups by title on each sync instead
- Use batch chrome.tabs.ungroup() with array of IDs instead of loops
- Fixes issue where group wasn't created after debugger detach/reattach
2026-01-04 16:09:32 +01:00
Tommy D. Rossi 1ad94f3930 release: playwriter@0.0.39, extension@0.0.66
- fix icon not updating on WS disconnect
- increase aria-labels auto-hide timeout to 30s
2026-01-03 17:38:28 +01:00
Tommy D. Rossi f9a2312a58 diconnect tabs on close of ws 2026-01-03 17:36:18 +01:00
Tommy D. Rossi 22a255e1dd refactor extension with ConnectionManager. log memory usage 2026-01-02 14:41:37 +01:00
Tommy D. Rossi a53342f36a add reload packge.json script 2026-01-02 14:41:05 +01:00
Tommy D. Rossi 90179dea17 handle connecting ws 2026-01-01 03:12:30 +01:00
Tommy D. Rossi ef6ab59351 Fix auto-enable to work without delay by skipping duplicate Target.attachedToTarget
Move auto-create logic from onOpen to Target.setAutoAttach handler so it runs
synchronously in the CDP command flow. Add skipAttachedEvent option to extension's
attachTab to prevent sending Target.attachedToTarget when the relay will send it
via the Target.setAutoAttach response handler.
2026-01-01 02:53:10 +01:00
Tommy D. Rossi 178387ec97 Persistent WS connection and auto-create initial tab
- Connect WS at extension startup via maintainConnection() loop
- Auto-retry every 5 seconds silently (no connecting badge)
- Never disconnect WS based on tab count
- Rename ConnectionState 'disconnected' to 'idle', remove global 'connecting'
- Fix race condition with tabGroupQueue for syncTabGroup/disconnectEverything/onTabUpdated
- Add auto-create initial tab when Playwright connects (PLAYWRITER_AUTO_ENABLE env var)
- Add test for auto-create feature
2026-01-01 01:14:16 +01:00
Tommy D. Rossi be1b9514d3 Add ping/pong keep-alive to prevent service worker termination 2025-12-31 16:15:17 +01:00
Tommy D. Rossi 02fda90578 add more logs on detach 2025-12-31 16:07:57 +01:00
Tommy D. Rossi 3d0d280f6a Fix context menu duplicate ID crash and add global error logging 2025-12-31 15:45:32 +01:00