Skip to content

Windows: browse.exe won't start (stdio bug) + cookie import completely non-functional #448

Closed

Description

@hyunsungko

Environment

  • OS: Windows 11 Home 10.0.26200
  • gstack version: 0.11.14.0
  • Node.js: v24.13.1
  • Bun: 1.2.x (compiled binary)

Bug 1: stdio must be an array — browse.exe won't start

Repro

$ browse status
[browse] Starting server...
[browse] stdio must be an array

Root Cause

cli.ts lines 237 and 239 pass stdio as string 'ignore' to Node.js child_process.spawn. Windows Node.js requires an array.

// Line 237 (launcherCode):
{detached:true,stdio:'ignore',...}  // ❌ fails on Windows
// Line 239 (Bun.spawnSync):
Bun.spawnSync([...], { stdio: 'ignore' });  // ❌ fails on Windows

Fix

// Line 237:
{detached:true,stdio:['ignore','ignore','ignore'],...}  // ✅
// Line 239:
Bun.spawnSync([...], { stdio: ['ignore','ignore','ignore'] });  // ✅

After fix + recompile (bun build src/cli.ts --compile --outfile dist/browse.exe), browse works perfectly on Windows.


Bug 2: Cookie import has zero Windows support

Repro

$ browse cookie-import-browser
No Chromium browsers found. Supported: Comet, Chrome, Chromium, Arc, Brave, Edge

Root Cause (4 layers)

  1. getHostPlatform() returns null for win32 — browsers never found
  2. No Windows paths — BrowserInfo has dataDir (macOS) and linuxDataDir but no winDataDir. Windows stores cookies at %LOCALAPPDATA%\Google\Chrome\User Data\Default\Network\Cookies
  3. bun:sqlite stubbed to null — build-node-server.sh replaces it with const Database = null, so even listing domains fails with Database is not a constructor
  4. v20 App-Bound Encryption — All Chromium browsers on Windows (Chrome 127+, Edge 127+) now use v20 encryption. The macOS/Linux decryption pipeline (Keychain/PBKDF2 → AES-128-CBC) cannot decrypt v20. DPAPI alone is insufficient — the key is bound to Chrome's system elevation service.

Solution: Edge CDP bypass

We found and verified a complete workaround:

  1. Edge (unlike Chrome) allows --remote-debugging-port on its default profile
  2. Launch Edge with debugging → connect via CDP WebSocket
  3. Storage.getCookies returns all cookies in plaintext (bypasses v20 entirely)
  4. Export → browse cookie-import <file.json> → injected into Playwright session

Tested: 267 cookies from 72 domains imported. Gmail inbox accessible via headless browse.

Key findings:

  • Network.getAllCookies returns 0 on Windows — must use Storage.getCookies
  • Chrome blocks remote debugging on its default profile dir (security feature)
  • Profile copies don't work with v20 (encryption is path-bound)

Suggested Implementation

File Change
src/cli.ts:237,239 stdio string → array
src/cookie-import-browser.ts Add win32 platform, winDataDir, Default/Network/Cookies, CDP import path
src/write-commands.ts URL open: powershell Start-Process on Windows
dist/bun-polyfill.cjs better-sqlite3 polyfill with .query() shim for domain listing
scripts/build-node-server.sh Use better-sqlite3 instead of stubbing to null

Happy to submit a PR if helpful.

Activity

  1. BigOtis commented on Mar 24, 2026

    @BigOtis

    Ran into the same bug, would love the PR

  2. garrytan commented on Mar 25, 2026

    @garrytan
    Owner

    Fixed in a3e2295 — stdio: 'ignore' changed to stdio: ['ignore', 'ignore', 'ignore'] array format for Bun Windows compatibility.

  3. added 2 commits that reference this issue on Mar 25, 2026
    a3e2295
    9870a4e
  4. added a commit that references this issue on Mar 29, 2026
    95fee38
  5. added a commit that references this issue on Mar 29, 2026
    749ae15
  6. added a commit that references this issue on May 30, 2026
    5a6aa2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions