Skip to content

Windows 浏览器 CDP 传输与 Node 跨平台路径修复 - #272

Merged
ZLHad merged 1 commit into
mainfrom
codex/windows-browser-cdp
Dec 3, 2026
Merged

ZLHad merged 1 commit into
mainfrom
codex/windows-browser-cdp

Conversation

@ZLHad

@ZLHad ZLHad commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • tools/textcheck/browser.mjs: Dual CDP transport — keeps POSIX --remote-debugging-pipe default unchanged, and uses --remote-debugging-port=0 with a zero-dependency direct loopback RFC 6455 WebSocket client over node:net on Windows (and opt-in OVH_CDP_TRANSPORT=ws on POSIX), immune to HTTP_PROXY / NODE_USE_ENV_PROXY=1. Adds strict loopback URL validation, RFC 6455 handshake/frame validation, Windows System32\taskkill.exe /T /F + orphaned helper cleanup, SIGBREAK handling, and case-preserving insideDir().
  • tools/film/{host,edit,patch,render,versions}.mjs: Replaces all 6 new URL(import.meta.url).pathname calls with fileURLToPath(import.meta.url) so Windows drive paths work cleanly.
  • tools/web/web.py + tools/procutil.py + bin/vh: Uses TemporaryFile + procutil.ProcessTreeGuard, forwards INT/TERM/HUP cleanly through bin/vh web and web.py (cleaning up Chrome, temporary profiles, and unfinished capture directories), and verifies exact lstart timestamps before POSIX process-group cleanup.
  • Tests & Windows CI: Adds tools/ci/py/static_checks/browser_portable.py (static .pathname guard, unit/lifecycle tests, and --with-browser real headless Chrome/Edge WebSocket CDP smoke test) wired into static_checks, film_checks, and GitHub Actions windows-latest.

Verification

  • 4 passes of independent read-only audit (gpt-6.2-sol, xhigh)
  • Local tools/ci.sh --committed: 43/43 groups passed
  • Studio tools/ci.sh against this Core: 5/5 groups passed
  • Native windows-latest CI (Node 22 + Python 3.12 + real headless Chrome/Edge WebSocket CDP): pending on PR

…s and fix JS fileURLToPath

Make headless Chrome/Edge automation work natively on Windows without npm dependencies
while preserving POSIX --remote-debugging-pipe behavior unchanged:
- tools/textcheck/browser.mjs: add direct RFC 6455 loopback WebSocket client over
  node:net (--remote-debugging-port=0 on win32 or OVH_CDP_TRANSPORT=ws, immune to
  HTTP_PROXY/NODE_USE_ENV_PROXY, O(n) for 12+ MB screenshots), System32 taskkill /T /F
  + orphaned profile helper sweep, SIGBREAK handling, and case-preserving insideDir().
- tools/film/{host,edit,patch,render,versions}.mjs: replace all 6 occurrences of
  new URL(import.meta.url).pathname with fileURLToPath(import.meta.url), add
  Windows SIGBREAK cleanup in render.mjs, and use insideDir() in host.mjs.
- tools/web/web.py: attach ProcessTreeGuard before feeding stdin to chrome.mjs,
  forward KeyboardInterrupt SIGINT on POSIX, isolate Windows TMP/TEMP under home.
- Add tools/ci/py/static_checks/browser_portable.py (JS guard + stub & real Chrome/Edge
  WebSocket CDP checks) and wire it into static_checks, film_checks, and windows-latest CI.
@ZLHad
ZLHad marked this pull request as ready for review December 3, 2026 05:07
@ZLHad
ZLHad enabled auto-merge (squash) December 3, 2026 05:07
@ZLHad
ZLHad merged commit c8a2754 into main Dec 3, 2026
5 checks passed
@ZLHad
ZLHad deleted the codex/windows-browser-cdp branch December 3, 2026 05:27
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.

1 participant