Repository navigation
Windows 浏览器 CDP 传输与 Node 跨平台路径修复 - #272
Merged
Merged
Conversation
…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
marked this pull request as ready for review
December 3, 2026 05:07
ZLHad
enabled auto-merge (squash)
December 3, 2026 05:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/textcheck/browser.mjs: Dual CDP transport — keeps POSIX--remote-debugging-pipedefault unchanged, and uses--remote-debugging-port=0with a zero-dependency direct loopback RFC 6455 WebSocket client overnode:neton Windows (and opt-inOVH_CDP_TRANSPORT=wson POSIX), immune toHTTP_PROXY/NODE_USE_ENV_PROXY=1. Adds strict loopback URL validation, RFC 6455 handshake/frame validation, WindowsSystem32\taskkill.exe /T /F+ orphaned helper cleanup,SIGBREAKhandling, and case-preservinginsideDir().tools/film/{host,edit,patch,render,versions}.mjs: Replaces all 6new URL(import.meta.url).pathnamecalls withfileURLToPath(import.meta.url)so Windows drive paths work cleanly.tools/web/web.py+tools/procutil.py+bin/vh: UsesTemporaryFile+procutil.ProcessTreeGuard, forwardsINT/TERM/HUPcleanly throughbin/vh webandweb.py(cleaning up Chrome, temporary profiles, and unfinished capture directories), and verifies exactlstarttimestamps before POSIX process-group cleanup.tools/ci/py/static_checks/browser_portable.py(static.pathnameguard, unit/lifecycle tests, and--with-browserreal headless Chrome/Edge WebSocket CDP smoke test) wired intostatic_checks,film_checks, and GitHub Actionswindows-latest.Verification
gpt-6.2-sol,xhigh)tools/ci.sh --committed: 43/43 groups passedtools/ci.shagainst this Core: 5/5 groups passedwindows-latestCI (Node 22 + Python 3.12 + real headless Chrome/Edge WebSocket CDP): pending on PR