fix: prefer DevToolsActivePort websocket path over HTTP discovery in --auto-connect#1218
Open
jin-2-kakaoent wants to merge 3 commits intovercel-labs:mainfrom
Open
fix: prefer DevToolsActivePort websocket path over HTTP discovery in --auto-connect#1218jin-2-kakaoent wants to merge 3 commits intovercel-labs:mainfrom
jin-2-kakaoent wants to merge 3 commits intovercel-labs:mainfrom
Conversation
…--auto-connect Reverses the discovery order in `auto_connect_cdp()` so the exact WebSocket path from DevToolsActivePort is tried first, falling back to legacy HTTP endpoints (`/json/version`, `/json/list`) only when the direct path fails. This eliminates the duplicate remote-debugging permission prompts caused by unnecessary HTTP probes on Chrome M144+. Also adds `verify_ws_endpoint()` to validate the WebSocket URL is a live CDP server before returning it, preventing stale URLs from being handed to callers. Fixes vercel-labs#1210 Fixes vercel-labs#1206
Contributor
|
@hyunjinee is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fixes #1210
Fixes #1206
Summary
auto_connect_cdp(): tries the exact WebSocket path fromDevToolsActivePortfirst, falls back to legacy HTTP endpoints (/json/version,/json/list) only on failureverify_ws_endpoint()to validate the WebSocket URL is a live CDP server before returning itis_port_reachable()TCP probe that blocked the async runtimeWhy
On Chrome M144+,
--auto-connecttriggered two separate remote-debugging permission prompts because legacy HTTP discovery probes (/json/version,/json/list) were attempted before using the exact WebSocket path already available inDevToolsActivePort. Each probe triggered its own permission flow.Before → After
/json/version→/json/list→/devtools/browser→ exact ws_pathBrowser.getVersionhandshakeTest plan
--remote-debugging-port:--auto-connectconnects in 0.2sDevToolsActivePort(dead port): clean error instead of hang--cdpmode unaffectedclosedoes not kill external Chrome