Skip to content

fix(browse): use CDP websocket fallback on Windows#84

Open
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn:fix/browse-windows-cdp-websocket
Open

fix(browse): use CDP websocket fallback on Windows#84
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn:fix/browse-windows-cdp-websocket

Conversation

@mvanhorn
Copy link

Summary

  • Detects Windows (process.platform === 'win32') in browser-manager.ts and launches Chromium with --remote-debugging-port=0 to use websocket transport instead of the default pipe transport
  • macOS and Linux behavior is unchanged - only Windows gets the fallback

Fixes #77. Bun's child process pipe implementation does not work with Playwright's --remote-debugging-pipe on Windows. Chromium launches but the DevTools Protocol pipe never connects, causing an indefinite hang. This adds a platform check that uses websocket transport on Windows, bypassing the broken pipe.

Test plan

  • Verify bun test passes on macOS/Linux (no regression)
  • Verify browse goto https://example.com no longer hangs on Windows
  • Verify isHealthy() works with CDP-connected browser
  • Verify recreateContext() saves/restores state correctly
  • Verify idle timeout shutdown works with CDP connection

Bun's pipe transport hangs when Playwright launches Chromium on Windows
(garrytan#77). Detect Windows and pass --remote-debugging-port=0 to use websocket
transport instead. macOS/Linux behavior is unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

browse: Playwright Chromium launch hangs on Windows (Bun pipe transport issue)

1 participant