What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use await browser.disconnect() to detach Puppeteer while leaving the browser process and its pages running. Use await browser.close() instead only when you want to close the browser and its associated pages.
Disconnect Puppeteer without closing the browser
Call browser.disconnect() on the connected Browser instance. It returns a Promise<void>; await it so the disconnection completes before your code proceeds. Puppeteer’s Browser.disconnect() API reference describes this as disconnecting Puppeteer while leaving the browser process running. The browser-management guide also says its pages remain open when you disconnect: Puppeteer browser management.
await browser.disconnect();
Disconnecting is a client-connection action, not a browser shutdown. The browser can continue running after Puppeteer detaches, though what happens to it later may depend on how that browser is hosted or supervised.
Save the endpoint if you will reconnect
Before disconnecting, save the browser’s WebSocket endpoint. Pass it to puppeteer.connect() when you want Puppeteer to attach again. Puppeteer documents this pattern in its Browser class reference.
#1 Best Overall
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const browserWSEndpoint = browser.wsEndpoint();
// Detach Puppeteer; the browser and its pages remain open.
await browser.disconnect();
// Reconnect using the endpoint saved before disconnecting.
const browserAgain = await puppeteer.connect({ browserWSEndpoint });
// Use browserAgain as needed, then shut down the browser if intended.
await browserAgain.close();
})();
The endpoint must still be available to the process doing the reconnect. The documented example shows how to obtain and use it; it does not guarantee that an endpoint remains valid indefinitely in every third-party hosting environment. The connect() API reference documents connecting to a browser instance.
Choose between disconnecting and closing
| Call | Effect | Use it when |
|---|---|---|
await browser.disconnect() |
Detaches Puppeteer; browser process and pages stay running. | You want to release this Puppeteer connection but leave the browser available. |
await browser.close() |
Closes the browser and its associated pages. | You intend to shut down the browser. |
These are different lifecycle choices, not interchangeable cleanup methods. See Puppeteer’s Browser.close() API reference for the shutdown behavior.
Use the same method for launched and connected browsers
Puppeteer’s Browser API covers browser instances launched through Puppeteer as well as instances attached to with puppeteer.connect(). In either case, call disconnect() on the Browser instance when you want to detach the Puppeteer client rather than close the browser.
Troubleshooting
- The browser closed after cleanup. Check whether your code called
browser.close()rather thanbrowser.disconnect(). The former closes the browser and its pages. - Reconnect fails. Confirm you saved the exact value from
browser.wsEndpoint()before disconnecting and pass it asbrowserWSEndpointtopuppeteer.connect(). The endpoint must still be accessible; its longevity is not guaranteed across all hosting setups. - Your script seems to continue before detaching. Await the returned promise:
await browser.disconnect(). - The browser is managed outside your script. Disconnecting Puppeteer does not itself stop the browser, but an external supervisor or hosting environment may separately manage its lifetime.
Or skip the browser setup
If the task is to capture a page rather than keep a Puppeteer session running, ScreenshotNeo is a website screenshot API and MCP server. Its one-request example is:
Rank #3
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://pptr.dev -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie banners, popups and chat widgets are removed before the shot; bot checks, blank pages and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up free for 1,000 screenshots a month, with 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.

