The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Headless Chrome does not automatically exit when a page finishes loading. Your script must close the browser it launched, or the browser’s owner must shut down an externally managed instance. Start by identifying which process is still alive, then fix the matching cleanup or wait condition.
Why headless Chrome may keep running
“Headless” means Chrome runs without a visible user interface; it is not an instruction to exit when page work is complete. In automation, the script, browser, driver, and child processes have separate lifecycles. A missing shutdown call can leave Chrome alive, while an ended Chrome process can still appear to leave a Node.js program waiting because a stream or another process remains open.
Chrome’s Headless mode has also changed over time. Chrome for Developers says that Chrome 112 updated Headless to create platform windows without displaying them, and that since Chrome 132.0.6793.0 the old Headless implementation is available as a separate binary named chrome-headless-shell. These details can matter when diagnosing an environment, but they do not change the basic requirement to close automation resources explicitly. Chrome Headless documentation.
First identify what has not exited
Do not infer the cause just from seeing a Chrome process in a process list. Work out whether the remaining process is the Node.js script or test runner, Chrome itself, a driver, or a child process whose standard input/output/error streams remain open.
#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.
- Check the process tree. Identify the process ID and parent process for the remaining process. Establish whether your script launched Chrome or connected to an existing browser.
- Check whether the script reached cleanup. Look for errors, early returns, failed navigation, or thrown exceptions between browser startup and the shutdown call.
- Determine whether the code closed or detached. In Puppeteer,
browser.disconnect()detaches the client; it does not close the browser or its pages. The browser’s owner or managing service must stop that instance. Puppeteer Browser API. - Separate page waiting from process shutdown. Navigation and capture waits, browser shutdown, and Node process events are different things. A timeout for a particular capture operation is not a general watchdog for every Chrome process.
Close the browser on success and error paths
Puppeteer
For a browser started with puppeteer.launch(), put the work in a try block and await browser.close() in finally. That way cleanup runs even if page creation, navigation, or later work throws an error.
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto(url);
// Do the required work.
} finally {
await browser.close();
}
browser.close() is the shutdown call for a browser launched by Puppeteer. If instead the script connected to a browser managed elsewhere, browser.disconnect() only ends that connection; it leaves the browser running. Make sure the process or service that owns the browser is responsible for shutting it down. Puppeteer Browser API.
Playwright
For a browser created through browserType.launch(), use browser.close() to close it. If your code explicitly created browser contexts and needs graceful page-close events, Playwright recommends closing those contexts before closing the browser. Use the calls in a cleanup path so an error during page work does not skip them.
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 browser = await chromium.launch();
try {
const context = await browser.newContext();
try {
const page = await context.newPage();
await page.goto(url);
// Do the required work.
} finally {
await context.close();
}
} finally {
await browser.close();
}
The explicit context cleanup is useful when graceful context and page shutdown matters; browser shutdown remains necessary for the launched browser. Playwright Browser API.
Recommended Free Tools
Selenium
When Selenium owns the session, await driver.quit() in cleanup. Selenium’s documented shutdown call ends the session; do not substitute a call that merely closes a single window when the goal is to end the driver session.
const { Builder } = require('selenium-webdriver');
const driver = await new Builder().forBrowser('chrome').build();
try {
await driver.get(url);
// Do the required work.
} finally {
await driver.quit();
}
See Chrome’s official Headless examples for the documented Puppeteer and Selenium shutdown calls: Chrome Headless 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.
Bound Chrome CLI capture waits
If the job is a Chrome Headless command-line capture using --dump-dom, --screenshot, or --print-to-pdf, Chrome’s --timeout option sets the maximum wait before capture even if the page is still loading. For example:
chrome --headless --print-to-pdf --timeout=5000 https://example.com/
In Chrome’s documented example, --timeout=5000 limits the wait before the specified capture to five seconds. This is a capture-wait limit, not a universal watchdog for arbitrary Chrome runs or automation API calls. Use an API- or process-level timeout appropriate to the rest of your job where needed. Chrome Headless documentation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Inspect a live Headless page and diagnose process events
Inspect the remote target
When you need to see what a live Headless instance is doing, launch it with --remote-debugging-port=0. Chrome prints a WebSocket endpoint to standard output. Take that endpoint and use chrome://inspect in a separate headful Chrome instance to inspect remote targets and the live page. This helps distinguish a page that is still active from an automation script that has simply failed to reach cleanup. Chrome Headless documentation.
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
Distinguish Node’s exit and close events
For a Node.js spawned process, exit means the process ended. The close event is emitted after the process has ended and its standard I/O streams have closed. If you see exit but your code is still waiting for close, investigate whether another process inherited or is holding those streams open; that does not by itself prove Chrome is still running. Node.js child process documentation.
Troubleshoot common “runs forever” cases
| Symptom | Likely cause | What to check or change |
|---|---|---|
| Chrome remains after a Puppeteer task finishes | The launched browser was not closed, often because cleanup was skipped on an error path. | Await browser.close() in finally for a browser started with launch(). |
| Puppeteer stops controlling Chrome, but Chrome stays open | The code called browser.disconnect(), which detaches without shutting down the browser. |
Identify the browser’s owner. Have that owner or its managing service close the browser; use browser.close() when Puppeteer launched the instance and should shut it down. Puppeteer Browser API. |
| Playwright pages need graceful close handling | Contexts created explicitly were not closed before the browser. | Close each relevant context, then close the browser. Playwright Browser API. |
| A Selenium job ends its useful work but its session persists | The driver session shutdown call is missing or not reached. | Await driver.quit() in cleanup. Chrome Headless documentation. |
| A CLI screenshot or PDF waits on a slow page | The command is waiting for capture while the page continues loading. | For supported Headless capture operations, set --timeout; do not treat it as a general process timeout. Chrome Headless documentation. |
| Your Node parent waits after the child exits | The child has ended, but standard I/O streams have not closed. | Compare the child-process exit and close events and inspect which process may still hold the streams. Node.js child process documentation. |
| You cannot tell what the live browser is doing | The process is active, but its page state is not visible from the current terminal output. | Use a remote debugging port and inspect the printed WebSocket endpoint through chrome://inspect. Chrome Headless documentation. |
Set expectations for timeouts, reliability, and cost
There is no single timeout value that applies across standalone Chrome, Puppeteer, Playwright, and Selenium. A page-navigation wait, a capture wait, a browser shutdown, and a parent process waiting on streams are separate conditions. Choose the timeout at the layer that can actually be waiting, and still close owned resources in a cleanup path. The documented Chrome CLI --timeout described above covers waiting before specific Headless captures, not every possible hang.
For repeatable jobs, make lifecycle ownership explicit: know which component launched the browser, await its shutdown method, and log enough process and error information to determine whether the browser, driver, script, or streams remain. The cited documentation does not establish a universal shutdown duration or resource-use figure, so avoid assuming that a process remaining for a particular number of seconds proves one specific failure.
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.
Or skip the browser setup
If your goal is simply to capture a website, ScreenshotNeo offers a one-request screenshot API instead of requiring you to manage a local Headless Chrome process. Cookie banners are accepted before capture and more than 60 known consent platforms, newsletter popups, and chat widgets are removed; each of those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers say which page verdict applied and whether the request was billed. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
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. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. ScreenshotNeo is worth trying when you want a capture without setting up and cleaning up a browser process. Sign up for free and get 1,000 screenshots a month with no card.
Frequently Asked Questions
Does closing a Puppeteer page stop Chrome?
A page close and browser shutdown are different lifecycle actions. To shut down a browser launched with Puppeteer, await browser.close().
Can Chrome’s --timeout stop any Headless Chrome process?
No. It bounds waiting before supported Headless capture operations such as --screenshot or --print-to-pdf; it is not a universal process watchdog.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsWhat does it mean if Node emits exit but not close?
The process ended, but its standard I/O streams have not all closed. Investigate which process may still hold those streams open.
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.

