feat(browserType): throw on remote connectOverCDP(transport)#40997
Merged
pavelfeldman merged 1 commit intoMay 26, 2026
Merged
Conversation
Passing a ConnectionTransport to connectOverCDP only works when client and server share a heap: the protocol declares `transport: binary` but the dispatcher uses `as any` to forward the live object with its send/close/onmessage methods. Over a real wire the transport would be coerced to a Buffer and the server would fail downstream with a confusing error. Add an isRemote() guard with a clear message, matching the pattern in artifact.ts, video.ts, and elementHandle.ts.
Contributor
Test results for "MCP"7181 passed, 1113 skipped Merge workflow run. |
Contributor
Test results for "tests 1"7 flaky43921 passed, 861 skipped Merge workflow run. |
pavelfeldman
approved these changes
May 26, 2026
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
connectOverCDP(transport)when the client is connected to a remote server.transport: binarybut the dispatcher usesas anyon both sides to forward the live JS object — so it only works in-process. Over a wire the validator would coerce the transport to a Buffer and the server would fail downstream.isRemote()guards inartifact.ts,video.ts, andelementHandle.ts.Context: introduced in 8f50322 ("feat(browserType): allow passing a ConnectionTransport to connectOverCDP", #40972).