Use puppeteer.connect() to attach Puppeteer to a browser that is already running. If you have its complete Chrome DevTools WebSocket URL, pass it as browserWSEndpoint. In Node.js, put WebSocket headers under wsOptions.headers; use options such as protocolTimeout and defaultViewport to configure Puppeteer’s session, not to locate or authenticate the browser.
Connect Puppeteer to an existing browser
puppeteer.connect(options) resolves to a Browser instance attached to an existing browser; it does not launch one. The example below assumes you already have a debugger WebSocket endpoint and have installed Puppeteer in a Node.js project. See the Puppeteer 25.12.0 connect() reference.
import puppeteer from 'puppeteer';
const endpoint = process.env.BROWSER_WS_ENDPOINT;
if (!endpoint) {
throw new Error('Set BROWSER_WS_ENDPOINT to the browser WebSocket URL');
}
const browser = await puppeteer.connect({
browserWSEndpoint: endpoint,
});
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
console.log(await page.title());
} finally {
// Detach this Puppeteer client; leave the browser running.
browser.disconnect();
}
For an application that owns the browser lifecycle, call await browser.close() instead of disconnecting when the work is done and you intend to shut down the browser.
Find the WebSocket endpoint
When Puppeteer launched the browser
Call browser.wsEndpoint() on the connected instance to get its debugger WebSocket URL, then pass that string to browserWSEndpoint when reconnecting. Puppeteer documents this method in its Browser.wsEndpoint() reference.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
const browser = await puppeteer.launch();
const endpoint = browser.wsEndpoint();
browser.disconnect();
const reconnected = await puppeteer.connect({
browserWSEndpoint: endpoint,
});
await reconnected.close();
This reconnect pattern requires that the launched browser remain alive after the first client disconnects. Puppeteer’s Browser management guide documents disconnecting and reconnecting in this way.
When Chrome is already running independently
The Puppeteer API reference says the debugger URL is available as webSocketDebuggerUrl from http://HOST:PORT/json/version. Its documented WebSocket shape is ws://HOST:PORT/devtools/browser/<id>. Replace HOST, PORT and <id> with the values returned by that browser’s endpoint; do not guess an ID or path.
const response = await fetch('http://127.0.0.1:9222/json/version');
if (!response.ok) {
throw new Error(`Could not read Chrome version endpoint: ${response.status}`);
}
const info = await response.json();
if (!info.webSocketDebuggerUrl) {
throw new Error('Response did not include webSocketDebuggerUrl');
}
const browser = await puppeteer.connect({
browserWSEndpoint: info.webSocketDebuggerUrl,
});
This assumes the browser exposes its debugging endpoint on that host and port and that your process can reach it. Keep remote debugging access restricted to trusted clients.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
browserURL or browserWSEndpoint?
The current ConnectOptions reference (Puppeteer 25.12.0) lists both browserURL and browserWSEndpoint, but its generated table provides no descriptions for either row. If you already have the full debugger WebSocket URL, use the explicit browserWSEndpoint form shown here. The reference alone does not establish detailed discovery behavior or precedence for browserURL; consult documentation for the browser setup you use rather than assuming it is interchangeable with a WebSocket URL.
Recommended Free Tools
Pass authentication headers and WebSocket options
In Node.js, set WebSocket options through wsOptions. Current Puppeteer documentation directs users to wsOptions.headers; the top-level headers option is deprecated, and wsOptions.headers takes precedence if both are supplied.
const browser = await puppeteer.connect({
browserWSEndpoint: endpoint,
wsOptions: {
headers: {
Authorization: `Bearer ${token}`,
},
},
});
This is an illustrative configuration shape, not a universal remote-browser authentication recipe. A service may require a different endpoint, header, credential or connection process; follow that service’s current instructions. Puppeteer’s generic API reference does not establish provider-specific conventions.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
wsOptions is Node-only. The API reference also notes that browser builds lack a ping-frame API, so keep-alive options are ignored there. Do not use protocolTimeout as a substitute for WebSocket connection or handshake settings: it governs individual protocol calls.
Choose protocol and session behavior
These options affect how Puppeteer operates after connecting; they do not identify the browser endpoint.
| Option | What it controls | Documented detail |
|---|---|---|
protocol |
Protocol used for the connection. | The documented default for a browser connection is CDP. Chrome launch defaults to CDP; Firefox launch defaults to WebDriver BiDi. |
capabilities |
Capabilities for a WebDriver BiDi connection. | Documented for protocol="webDriverBiDi" with Puppeteer.connect(). |
protocolTimeout |
Timeout for individual CDP calls. | Documented default: 180_000 ms. This is not documented as a WebSocket handshake timeout. |
defaultViewport |
Viewport applied to each page. | Documented default: {width: 800, height: 600}. |
targetFilter |
Callback that decides which targets Puppeteer connects to. | Use when controlling target selection. |
slowMo |
Delays Puppeteer operations for debugging. | Value is a delay in milliseconds. |
networkEnabled |
Network-event monitoring. | Experimental. Setting it to false disables network events and breaks features that depend on them, including HTTPRequest and HTTPResponse. |
allowlist / blocklist |
Experimental URLPattern-based controls. | Chrome-only; documented for Chrome 149 or later. Existing targets that violate the controls may be detached, and disallowed requests fail. Puppeteer warns these controls are not complete network sandboxing; use container- or OS-level sandboxing where that is required. |
channel |
Finds an open Chrome WebSocket in a known user-data directory and connects to its active port. | Experimental; limited in the reference to Chrome in Node.js. |
Check the versioned ConnectOptions reference for the exact option types and compatibility as your Puppeteer version changes.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Node.js, browser builds and Chrome pipe
Node.js
Node.js supports connecting to an existing browser and also provides Puppeteer’s browser launch and download capabilities. Use this runtime when your code needs Node-only connection options such as wsOptions.
Running in a browser page
Puppeteer can connect over WebSockets to an existing browser from a browser build, but it cannot launch or download browsers there because those operations depend on Node.js APIs. The official Running Puppeteer in the browser guide demonstrates the browser-specific puppeteer-core entry point and a browserWSEndpoint connection. Browser builds do not support the Node-only WebSocket settings described above.
Chrome pipe
Puppeteer documents Chrome pipe as a launch-time transport option in LaunchOptions. It is not an endpoint format for attaching with connect() to an already-running browser.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Disconnect or close?
browser.disconnect()detaches the Puppeteer client while leaving the browser and its pages running. The Browser management guide states: “Unlikebrowser.close(),browser.disconnect()does not shut down the browser or close any pages.”await browser.close()gracefully closes the browser. Use this when your program owns the browser and should end its lifecycle.
For a shared browser, disconnect after your task so other clients or users can continue using it. For a browser dedicated to a one-off job, close it when cleanup should include shutting down Chrome.
Troubleshoot connection failures
Connection fails before a Browser is returned
- Check the endpoint value. Ensure
browserWSEndpointcontains the complete WebSocket URL, including the browser debugger path, not just an HTTP host and port. - Query the version endpoint. If the browser exposes
/json/version, read itswebSocketDebuggerUrlrather than constructing the URL yourself. - Check reachability. Confirm that the connecting process can reach the browser host and port and that the browser’s debugging endpoint is enabled and available.
- Verify service credentials and endpoint rules. For hosted browsers, use that provider’s current instructions; Puppeteer does not define a universal authentication header or endpoint convention.
Authentication is rejected
For Node.js, place headers in wsOptions.headers. Confirm the required credential format and header name with the browser service; the Bearer example is not a universal requirement. Do not rely on deprecated top-level headers.
A protocol operation times out
protocolTimeout applies to individual CDP calls, with a documented default of 180_000 ms in Puppeteer 25.12.0. Check whether the operation itself is stalled or the browser is overloaded before increasing it. It does not repair an invalid WebSocket endpoint or change the connection handshake.
Pages or network APIs behave differently than expected
Check defaultViewport, targetFilter and whether networkEnabled was disabled. The latter disables network-event monitoring and therefore affects features built on HTTPRequest and HTTPResponse.
Chrome closes unexpectedly after cleanup
Use browser.disconnect() to detach without closing the browser. browser.close() is the shutdown operation.
Or skip the browser setup
If your goal is to capture a page rather than automate an existing browser session, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. Its HTTP API returns a screenshot or PDF, and its clean-shot flow accepts consent banners and removes known consent platforms, newsletter popups and chat widgets before capture. Bot checks, blank pages, failed loads and cache hits are not billed.
For example, using cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for request options. It also provides an MCP server with take_screenshot, get_page_info and capture_pdf tools. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo and start with 1,000 free screenshots a month, no card required.
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.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →

