Puppeteer manages browser processes in one of two ways: it either starts a browser with puppeteer.launch() or connects to a browser started elsewhere with puppeteer.connect(). If Puppeteer launched it, use await browser.close() to shut it down gracefully. If another process owns it, use browser.disconnect() to detach without stopping the browser. Choosing the right cleanup method prevents a client from terminating a browser that other work still needs.
Choose the lifecycle based on who owns the browser
| Situation | Use | What happens |
|---|---|---|
| Your Node.js application starts and owns the browser. | puppeteer.launch(), then await browser.close() during cleanup. |
Puppeteer shuts down the browser it launched gracefully. |
| A service or another process owns the browser. | puppeteer.connect(), then browser.disconnect() when your client is finished. |
The Puppeteer client detaches; the browser and its pages remain running. |
| You need to inspect the process for a browser Puppeteer launched. | browser.process() |
Returns a Node.js ChildProcess. For a connected browser, it returns null. |
The key question is not simply whether your code can reach a browser. It is whether your code owns the browser’s lifecycle and is responsible for stopping or restarting it. Puppeteer’s browser management guide describes the launch and connection models.
Start a browser with Puppeteer
Call puppeteer.launch(options) to start a browser and receive a Browser handle. This is the straightforward choice when the Node.js application should control the browser process and its lifetime.
const puppeteer = require('puppeteer');
async function main() {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com');
console.log(await page.title());
} finally {
await browser.close();
}
}
main().catch(error => {
console.error(error);
process.exitCode = 1;
});
The finally block makes cleanup run whether page work succeeds or throws. For a long-running application, put browser cleanup in the application’s coordinated shutdown path rather than closing the browser after each task if it is meant to serve multiple tasks.
#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.
Configure how the browser starts
The launch options can select the browser executable or release channel, set command-line arguments and environment variables, configure the user data directory, control headless behavior, and select WebSocket or pipe transport. Puppeteer’s current generic launch-options documentation lists Chrome as the default browser, headless mode enabled by default, and a 30-second startup timeout. These are version-sensitive defaults; check the documentation for the version installed in your application before depending on them. See the LaunchOptions interface.
Puppeteer says it works best with the Chrome for Testing version it downloads by default and does not guarantee compatibility with arbitrary Chrome versions. With puppeteer-core, provide options.executablePath or options.channel; do not assume it will choose a browser binary for you. The PuppeteerNode.launch() documentation explains that distinction.
Connect to a browser started elsewhere
If a browser is managed by another process or service, connect to its browser WebSocket endpoint with puppeteer.connect(). The external launcher remains responsible for starting, supervising, and ultimately stopping that browser.
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.
const puppeteer = require('puppeteer');
async function main() {
const browser = await puppeteer.connect({
browserWSEndpoint: process.env.BROWSER_WS_ENDPOINT,
});
try {
const pages = await browser.pages();
console.log(`Connected; open pages: ${pages.length}`);
} finally {
// Detaches this Puppeteer client; it does not stop the external browser.
browser.disconnect();
}
}
main().catch(error => {
console.error(error);
process.exitCode = 1;
});
Supply a valid endpoint from the process that launched the browser. Avoid calling browser.close() merely to end a client session when the browser is shared or externally managed: closing is a browser shutdown operation, while disconnecting is a client detach operation. See Puppeteer’s Browser.disconnect() documentation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Understand process handles and shutdown behavior
Check whether Puppeteer launched the browser
browser.process() returns the associated Node.js ChildProcess when the browser was started by Puppeteer. It returns null when the browser was reached through puppeteer.connect(), because the external launcher owns that process. Treat this as an ownership clue, not as a substitute for choosing the correct cleanup method. The API is documented at Browser.process().
Close versus disconnect
await browser.close(): gracefully closes a browser Puppeteer launched; use it when your application owns that browser and its work is finished.browser.disconnect(): detaches the Puppeteer client and leaves a connected browser running; use it when another process owns the browser or it should remain available.
Launch options enable handling for SIGHUP, SIGINT, and SIGTERM by default; the documented behavior is to close the browser process on those signals. An optional AbortSignal can also close the browser when it is aborted. If your application has its own shutdown hooks, account for Puppeteer’s signal handling so cleanup is coordinated rather than duplicated or conflicting. Details are in the launch options documentation.
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.
Manage browser binaries separately when needed
Browser process ownership and browser installation are related but distinct concerns. Puppeteer configuration can control downloads and cache behavior; the separate @puppeteer/browsers package provides APIs to install and uninstall browsers, list available installations, compute executable paths, and launch a managed browser. Its Process wrapper exposes the underlying Node child process, close and kill operations, closed-state inspection, and recent browser logs. Consult the Configuration interface and @puppeteer/browsers API for the installed version’s supported methods.
Troubleshoot process lifecycle problems
The browser stays open after my script finishes
If your code launched it, make sure every success and error path reaches await browser.close(). A process that is still doing useful work should instead remain open by design. If your code connected to an externally launched browser, browser.disconnect() intentionally leaves that process running; stop it through its owning service or launcher.
Disconnecting appears to stop shared browser work
browser.disconnect() detaches the Puppeteer client; it is not intended to shut down the browser. Check whether another part of your application is calling browser.close(), or whether the external owner is stopping or restarting the process. A connected browser’s browser.process() result is null, so the Puppeteer client does not hold its child-process handle.
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
Launch fails or the expected browser binary is missing
Check which package you use and which executable it is configured to start. With puppeteer-core, pass an executablePath or channel. For compatibility, Puppeteer recommends its downloaded Chrome for Testing build rather than promising support for arbitrary Chrome versions. Check the version-specific launch and configuration documentation before changing binary or download settings.
Cleanup runs twice or conflicts with application shutdown
Puppeteer’s documented launch behavior handles SIGHUP, SIGINT, and SIGTERM by closing the browser, and an AbortSignal can also trigger closure. Review those settings alongside your own process signal listeners and abort handling. Assign one coordinated cleanup path responsibility for closing a Puppeteer-owned browser; do not use process-level force termination as a substitute for ordinary graceful cleanup.
Or skip the browser setup
If your goal is to capture a website rather than manage a browser process, ScreenshotNeo provides a website screenshot API and MCP server. A single GET request returns a PNG, JPEG, WebP, or PDF. For example, this cURL request saves a WebP screenshot of Stripe:
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for authentication and options. Cookie and consent banners are accepted before capture and more than 60 known consent platforms, newsletter popups, and chat widgets are removed; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers indicating the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try it without a card.
Frequently Asked Questions
Does browser.disconnect() close the pages in an externally managed browser?
No. It detaches the Puppeteer client; the browser and its pages continue running unless their owner stops them.
Can browser.process() tell me who launched a connected browser?
It returns null for a browser reached through puppeteer.connect(), so it indicates that Puppeteer does not own the child-process handle; it does not identify the external launcher.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchAre Puppeteer launch defaults identical across versions?
No. Launch defaults can change, so consult the LaunchOptions documentation corresponding to your installed Puppeteer version.
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.

