Puppeteer either launches a browser process that your Node.js application owns, or connects to a browser that another process owns. The distinction determines cleanup: call await browser.close() to shut down a browser Puppeteer launched; call browser.disconnect() to end Puppeteer’s connection while leaving the external browser running. For a launched browser, browser.process() returns its Node.js child-process handle; for a connected browser, it returns null.
The two ways Puppeteer gets a browser
Launch a browser your application owns
Call puppeteer.launch(options) to start a browser and receive a Browser handle. Puppeteer then manages the process it created, and your application can close it when its work is finished. The launch options configure such details as browser selection, executable or release channel, command-line arguments, environment variables, user-data directory, headless behavior and transport.
Puppeteer says it works best with the Chrome for Testing build it downloads by default, and does not guarantee compatibility with arbitrary Chrome versions. With puppeteer-core, you must supply either options.executablePath or options.channel. See the PuppeteerNode.launch() documentation.
Connect to a browser managed elsewhere
Call puppeteer.connect() with the browser’s WebSocket endpoint to attach to an already-running browser. This is useful when a separate service, container supervisor or application owns startup and shutdown. Puppeteer controls its client session, but does not own the external browser process; disconnecting the client leaves the browser and its pages running. See Puppeteer’s browser management guide.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitches#1 Best Overall
- The world’s fastest gaming processor, built on AMD ‘Zen5’ technology and Next Gen 3D V-Cache.
- 8 cores and 16 threads, delivering +~16% IPC uplift and great power efficiency
- 96MB L3 cache with better thermal performance vs. previous gen and allowing higher clock speeds, up to 5.2GHz
- Drop-in ready for proven Socket AM5 infrastructure
- Cooler not included
Choose who owns shutdown
| Situation | Use | Effect |
|---|---|---|
| Your Node application starts and owns the browser | puppeteer.launch(), then await browser.close() during cleanup |
Gracefully closes the browser process. |
| A service or another process owns the browser | puppeteer.connect(), then browser.disconnect() when your client is done |
Detaches Puppeteer; the browser remains running. |
| You need the process handle for a launched browser | browser.process() |
Returns a Node.js ChildProcess; returns null for a connected browser. |
Make this decision by asking who should restart the browser, whether ending this Puppeteer client should terminate it, and how much control the deployment needs over the executable and version. Do not use browser.close() on a shared browser session when another client or service still depends on that browser.
Launch, connect, inspect and clean up
This Node.js example launches a browser, captures a page title and closes the browser even if page work fails. Install Puppeteer in the project first; the example uses its downloaded browser rather than a manually selected executable.
Rank #2
- AMD Ryzen 9 9950X3D Gaming and Content Creation Processor
- Max. Boost Clock : Up to 5.7 GHz; Base Clock: 4.3 GHz
- Form Factor: Desktops , Boxed Processor
- Architecture: Zen 5; Former Codename: Granite Ridge AM5
const puppeteer = require('puppeteer');
(async () => {
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();
}
})();
If you are using puppeteer-core, provide a compatible executable or release channel in the launch options. If a separate service already runs Chrome, connect using the WebSocket endpoint provided by that service and disconnect after your work:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.connect({
browserWSEndpoint: process.env.BROWSER_WS_ENDPOINT,
});
try {
const page = await browser.newPage();
await page.goto('https://example.com');
console.log(await page.title());
} finally {
browser.disconnect();
}
})();
The endpoint must be supplied by the external browser owner; this example does not start that browser. To inspect ownership, call browser.process() on the handle: a launched instance has a child-process handle, while a connected instance returns null. That return value is an ownership clue, not a way to obtain the external process.
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 →Rank #3
- Can deliver fast 100 plus FPS performance in the world's most popular games, discrete graphics card required
- 6 Cores and 12 processing threads, bundled with the AMD Wraith Stealth cooler
- 4.2 GHz Max Boost, unlocked for overclocking, 19 MB cache, DDR4-3200 support
- For the advanced Socket AM4 platform
Launch settings and signal handling
The LaunchOptions interface documents controls for executable selection, arguments, environment, user-data directory, headless mode, startup timeout and WebSocket or pipe transport. In the generic current documentation, Chrome is the default browser, headless mode is enabled by default, and startup timeout is 30 seconds. These defaults are version-sensitive; check the documentation for the installed Puppeteer version rather than assuming they apply unchanged to every release.
Launch options enable handling of SIGHUP, SIGINT and SIGTERM by default, with documented behavior that closes the browser process on those signals. An optional AbortSignal can also close the browser when aborted. If your application installs its own signal handlers or cancellation logic, make sure they do not conflict with or duplicate Puppeteer’s cleanup.
Rank #4
- Pure gaming performance with smooth 100+ FPS in the world's most popular games
- 6 Cores and 12 processing threads, based on AMD "Zen 5" architecture
- 5.4 GHz Max Boost, unlocked for overclocking, 38 MB cache, DDR5-5600 support
- For the state-of-the-art Socket AM5 platform, can support PCIe 5.0 on select motherboards
- Cooler not included
Browser binaries and process handles
browser.process() is available for a Puppeteer-launched browser and returns the associated Node.js ChildProcess; a browser reached through puppeteer.connect() has no process owned by that Puppeteer client, so the method returns null. See the Browser.process() API reference.
The separate @puppeteer/browsers package documents browser installation, listing, executable-path computation, launching and uninstalling. Its Process wrapper exposes the underlying Node child process, close and kill operations, closed-state inspection and recent browser logs. Configuration and package details are in the Configuration interface and @puppeteer/browsers API.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- Processor provides dependable and fast execution of tasks with maximum efficiency.Graphics Frequency : 2200 MHZ.Number of CPU Cores : 8. Maximum Operating Temperature (Tjmax) : 89°C.
- Ryzen 7 product line processor for better usability and increased efficiency
- 5 nm process technology for reliable performance with maximum productivity
- Octa-core (8 Core) processor core allows multitasking with great reliability and fast processing speed
- 8 MB L2 plus 96 MB L3 cache memory provides excellent hit rate in short access time enabling improved system performance
Common process-management problems
- The browser keeps running after your code finishes. If you launched it, ensure the code reaches and awaits
browser.close(). If you connected to it, this is expected:browser.disconnect()detaches the client and leaves the externally managed browser alive. - A shared browser disappears unexpectedly. Check whether code calls
browser.close()on a connected session. Usebrowser.disconnect()when only the client should end. browser.process()returnsnull. This is expected for a browser attached throughpuppeteer.connect(); the launcher outside Puppeteer owns its process.puppeteer-corecannot find a browser executable. SetexecutablePathorchannelin launch options, and use a browser version compatible with the installed Puppeteer release.- A browser closes when the Node process receives a signal. Puppeteer’s documented launch defaults handle
SIGHUP,SIGINTandSIGTERMby closing the browser. Review your application’s own signal handlers and the launch options if that is not the intended lifecycle. - Startup fails or times out. Verify the executable or channel, browser installation and launch configuration. The generic documented startup timeout is 30 seconds, but confirm the setting for your installed version and adjust the launch option if the environment needs longer.
Or skip the browser setup
If your task is simply to capture a webpage rather than manage a browser process, ScreenshotNeo is a screenshot API and MCP server for developers. One GET request returns a PNG, JPEG, WebP or PDF. See the ScreenshotNeo documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners and removes 60+ known consent platforms, newsletter popups and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and responses report page verdict and billing headers. Its MCP server provides take_screenshot, get_page_info and capture_pdf for AI agents and MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
FAQ
Does browser.disconnect() close pages?
It ends Puppeteer’s connection; the browser and its pages remain running.
Can I get a process handle for a browser launched by another service?
Not through browser.process() on a connected Puppeteer handle; it returns null because Puppeteer did not launch that process.
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.




