Chrome deprecated Debugger.setScriptSource in Chrome 142+ (removed in 145).
Falls back to Runtime.evaluate to re-execute modified scripts, which
works for scripts defining functions at global scope.
- Add "No changes since last call" hints for snapshots/html/markdown
- Adjust truncation message to suggest search
- Update skill.md snapshot behavior doc
Tabs created via Ghost Browser's openTab API now automatically
attach to Playwriter's debugger, making them immediately available
in context.pages() without requiring manual extension icon click.
- Resolve extension connections by stable key and map to current connection
- Reject Playwright clients without explicit extension binding when multiple browsers connected
- Reject duplicate clientId connections
- Allow default extension only when a single browser is connected
- Include stableKey in /extensions/status response
- Move recording cleanup before connection delete (was no-op)
- Only fallback to default extension when extensionId is null
- Add cwd param to /cli/session/new, CLI passes process.cwd()
- Require pre-existing sessions for execute/reset endpoints
- Remove duplicate ensureRelayServer call in CLI
- Increase fetch timeouts from 500ms to 2000ms
- Extension connections are now tracked per-connection with isolated state
- Each connection has its own connectedTargets, pendingRequests, messageId
- Sessions are bound to specific extensionId via SessionMetadata
- New /extensions/status endpoint for listing all connected browsers
- CLI session new shows browser selection when multiple connected
- Browser detection via navigator.userAgentData (Ghost, Brave, Edge, etc)
- Added identity permission for Chrome profile email detection
- Constants, types, proxy factory, and handler in one file
- Works in both Node.js (executor) and Chrome (extension) environments
- executor.ts imports createGhostBrowserChrome factory
- background.ts imports handleGhostBrowserCommand handler
- Parse code with acorn to detect single expression statements
- Auto-wrap expressions with 'return await (...)' for implicit return
- Exclude side-effects: assignments, updates (x++), delete operator
- Update skill.md examples to remove console.log (keep await)
- Add unit tests for shouldAutoReturn function
The test was slow due to:
1. Page scanning by content (slow waitForLoadState + content() per page)
2. Using example.com which only has inline scripts with empty URLs
Fix:
- Use URL matching instead of content scanning (fast)
- Use news.ycombinator.com which has scripts with actual URLs
- The Debugger class filters out scripts without URLs, so we need
a page that actually has external script files
Total relay-session.test.ts time: 74s → 27s
Two tests were taking 30s and 10s respectively due to avoidable waits:
1. 'should pause on all exceptions with setPauseOnExceptions' (30.6s → 0.5s)
- Was awaiting page.evaluate() while debugger was paused
- Playwright's evaluate has 30s timeout, so it sat there waiting
- Fix: use Runtime.evaluate via CDP session (don't await until after resume)
2. 'should manage breakpoints with Debugger class' (10.6s → 0.4s)
- Was connecting over CDP and scanning all pages with waitForLoadState
- Each page waited up to 5s for domcontentloaded + content check
- Fix: use getCDPSessionForPage directly on the page we just created
- no-change returns newContent directly
- full returns newContent directly (no 'Content changed significantly' prefix)
- diff only returned when shorter than full content