Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →ConnectionTransport.send() sends a string across Puppeteer’s low-level browser connection; it is not the usual API for issuing a Chrome DevTools Protocol (CDP) command. For a CDP command, connect Puppeteer to the browser, create a CDPSession, then call session.send(method, params). Implement a custom transport only when you need to adapt the connection itself.
Choose the right send method
Puppeteer has two distinct interfaces that can look like “sending a message”:
As an Amazon Associate I earn from qualifying purchases.
| What you need to do | Use | Input | Purpose |
|---|---|---|---|
| Send a browser-protocol command | CDPSession.send() |
A protocol method name and its parameters | Issues a CDP command and returns a promise for its result. |
| Provide or adapt the underlying connection | ConnectionTransport.send() |
A string message | Passes a message through a custom transport implementation supplied to puppeteer.connect(). |
For ordinary commands such as evaluating a script or controlling a page, use CDPSession.send(). The transport interface is a lower-level adapter boundary: Puppeteer uses it to communicate with the browser, and a custom implementation must handle that connection’s messages and closure.
Send a CDP command through an existing browser connection
First obtain the browser’s WebSocket debugger endpoint. Puppeteer documents getting it from browser.wsEndpoint(); when you have access to the browser’s debugging HTTP endpoint, its /json/version response includes a webSocketDebuggerUrl. The documented endpoint format is ws://HOST:PORT/devtools/browser/<id>. See the Browser.wsEndpoint() reference.
#1 Best Overall
-
Make sure the target browser is already running with remote debugging enabled and that your process can reach its WebSocket endpoint.
-
Connect using
puppeteer.connect(), then create a page-level CDP session. -
Call
session.send()with the protocol method and its parameters. The following Node.js example evaluates1 + 1and prints the returned value:Recommended: Crashes or Glitches? A Free Driver Scan Usually Finds the Culprit →Recommended: Fix Windows Errors and Clear Junk Files in Minutes - Free Scan →Recommended: Update Every Outdated Driver on Your PC in One Scan - Free →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Rank #2
const puppeteer = require('puppeteer'); async function main() { const browserWSEndpoint = process.env.BROWSER_WS_ENDPOINT; if (!browserWSEndpoint) { throw new Error('Set BROWSER_WS_ENDPOINT to the browser WebSocket endpoint'); } const browser = await puppeteer.connect({ browserWSEndpoint }); try { const page = await browser.newPage(); const session = await page.createCDPSession(); const result = await session.send('Runtime.evaluate', { expression: '1 + 1', }); console.log(result); await session.detach(); } finally { await browser.disconnect(); } } main().catch(error => { console.error(error); process.exitCode = 1; });Run it after setting the endpoint in your environment—for example,
BROWSER_WS_ENDPOINT='ws://HOST:PORT/devtools/browser/ID' node send-cdp.js, replacing the example endpoint with the actual one. Check the exact command and parameter names against the protocol version supported by the browser you connect to; the method example does not guarantee that every browser version supports every command.
puppeteer.connect() resolves to a Browser. Its connection options are documented in the ConnectOptions reference, and the function is described in the connect() reference. The CDPSession.send() reference documents the command-level signature as send(method, params?, options?); it returns a promise for the command’s mapped result.
When and how to implement ConnectionTransport
Use a custom adapter only if Puppeteer’s normal connection mechanism does not fit your setup. The public ConnectionTransport interface defines the basic shape, not a complete transport recipe. Your implementation must expose send(message: string), receive messages through an onmessage callback, signal closure through onclose, and implement close(). Pass the instance in the transport option to puppeteer.connect().
const browser = await puppeteer.connect({ transport: customTransport });
At the interface boundary, send() takes a string message. Do not substitute a CDP method name and parameter object for that string-level contract. Puppeteer’s API reference does not provide a complete working adapter implementation or establish guarantees about reconnecting, buffering, backpressure, or error propagation. Those behaviors depend on the transport you build and should be verified against the exact Puppeteer release and underlying connection. See the ConnectionTransport interface.
Runtime and connection considerations
The official API pages cited here display Puppeteer version 25.12.0, checked on October 3, 2026. Confirm options against the version you install because the API can change. The ConnectOptions reference states that the protocol defaults to CDP when connecting to a browser and when launching Chrome, and to WebDriver BiDi when launching Firefox. It lists protocolTimeout with a default of 180,000 milliseconds for individual CDP calls; adjust it only if your workload needs a different limit.
The guide to running Puppeteer in a browser describes a browser-compatible puppeteer-core build connecting over WebSocket to an already running browser. In that runtime, launching or downloading a browser is unsupported because those operations rely on Node.js APIs. Use a Node.js environment when your workflow needs Puppeteer to manage browser installation or launch.
Rank #4
Troubleshooting
-
Connection fails before a session is created: confirm the browser is running, remote debugging is available, and the endpoint is the browser WebSocket URL—not an ordinary page URL. If you use
/json/version, read itswebSocketDebuggerUrlvalue. -
A CDP command rejects or returns an unexpected result: verify that the protocol method and parameter names match the browser’s supported protocol version, and inspect the returned error. A valid Puppeteer connection alone does not mean a particular command is supported.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
A call waits too long: check whether the browser or operation is stalled. The documented default
protocolTimeoutis 180,000 milliseconds for individual CDP calls; a timeout is a failure signal, not evidence that the command completed.Best Value
The SQL Programming Language: .- Used Book in Good Condition
-
A custom transport connects but commands do not flow: check that outgoing messages are delivered by
send(), incoming string messages reachonmessage, and connection closure invokesonclose. The public interface does not specify buffering or reconnection behavior, so confirm those details in your own adapter and test against your installed Puppeteer version. -
Browser-runtime code tries to launch Chromium: use an already running browser and connect over WebSocket, or move the launch workflow to Node.js. Browser-compatible Puppeteer does not support launching or downloading the browser.
Or skip the browser setup
If your goal is a website screenshot rather than a custom Puppeteer connection, ScreenshotNeo provides a screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF; its API accepts the usual screenshot parameters and supports options such as full-page capture, CSS selectors, viewport and device settings, custom CSS or JavaScript, and waits. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Does ConnectionTransport.send() return a CDP command result?
No. It is the transport interface’s string-message send method. Use CDPSession.send() when you need the promise for a CDP command’s result.
Can I use Puppeteer’s browser build to launch a browser?
No. The browser-compatible build connects to an existing browser; launching or downloading one requires Node.js APIs.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.




