Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

First decide whether you need to stop a slow browser operation or close a browser that has been idle. Those are different timers. For Playwright MCP, use --idle-timeout=<milliseconds> to control when an idle server-launched browser closes. Playwright library timeouts and Selenium waits instead bound particular operations; they do not automatically shut down an idle browser.

Choose the timeout that matches the problem

“Inactivity timeout” can mean either an operation has taken too long or a browser has received no work for a while. The first is an operation timeout: it can stop a navigation, script, or element search. The second is a lifecycle timeout: it closes or disconnects an otherwise idle browser or session.

Before changing a setting, identify the resource you want to protect and the event that should end its timer. If a page sometimes takes longer to load, tune its navigation limit. If an automation server should release a browser after its controller stops making tool calls, configure an idle lifecycle timeout where that server supports one. Do not substitute one for the other.

  • Operation runs too long: set the timeout for that operation or its relevant category.
  • Element is not present yet: use an element-wait strategy suited to the framework.
  • Browser should close after no work: use an explicit lifecycle control, if available, or end the session deliberately.

Set an idle timeout in Playwright MCP

Playwright MCP documents a server-level --idle-timeout option. Its unit is milliseconds. The documented default is one hour without tool calls for a headless browser launched by the server. Set a different duration by passing the desired number of milliseconds:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.
--idle-timeout=900000

This example sets the idle interval to 900,000 milliseconds (15 minutes). Choose a duration based on how long a legitimate pause between tool calls can be and how much browser capacity you want to keep reserved; there is no universal best value.

Disable automatic closure

Use 0 to disable automatic idle closure:

--idle-timeout=0

That setting removes this automatic cleanup safeguard. Use it only when another part of your system owns browser cleanup, or when indefinite reuse is intentional.

Understand which browser modes are affected

By default, headed browsers and browsers attached through --cdp-endpoint or --extension are not automatically closed. The Playwright MCP guide says an explicit idle timeout can be applied to any mode. If you are relying on the default, account for the browser mode rather than assuming every browser has the same lifecycle.

The timer is based on the absence of tool calls, not on whether a page is visually changing or whether a browser process looks busy. Confirm the option is supplied to the MCP server process that owns the browser, not merely to code running inside a page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.

Playwright library timeouts are operation limits

Playwright’s Page API has method-level timeout options and default-timeout setters on a page or browser context. It also documents navigation-specific timeout setters. These limit operations; they are not browser idle teardown controls.

Set the scope deliberately

Use a method-level timeout when one operation is exceptional and should have its own bound. Use a page or context default when a consistent limit should apply to relevant operations in that scope. Use a navigation-specific default when navigations need a different budget from other actions.

Many listed Page operations have no timeout by default (0), while some wait methods have their own defaults. A value of timeout: 0 disables the relevant operation timeout. Do not assume a single default applies to every Playwright call: check the particular method and the version you use.

// JavaScript: bound one navigation operation (milliseconds)
await page.goto('https://example.com', { timeout: 30000 });

When an operation timeout expires, treat the result as a failed or interrupted operation and handle it in your automation flow. Do not expect the browser to close just because a page action reached its limit. If the real requirement is to release an idle browser, configure the owning server or close the browser/session explicitly.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.

Set Selenium timeouts by operation type

Selenium documents separate controls for script execution, page loading, and implicit element lookup. For a new WebDriver session, its Browser Options documentation gives defaults of 30,000 ms for scripts, 300,000 ms for page loads, and 0 ms for implicit element lookup. These are operation defaults, not a universal idle-session shutdown duration.

Timeout What it bounds Documented new-session default
Script Execution of scripts through the WebDriver timeout control 30,000 ms
Page load Waiting for a page load to complete 300,000 ms
Implicit wait Element-location calls across the session 0 ms

These defaults are stated in Selenium’s Browser Options documentation inspected in 2026. They are not recommendations for every application. Set limits according to the operations and load conditions your own automation must handle.

Example: set Selenium timeouts in Python

from selenium import webdriver

 driver = webdriver.Chrome()
 driver.set_script_timeout(30)       # seconds
 driver.set_page_load_timeout(120)   # seconds
 driver.implicitly_wait(0)           # seconds

try:
    driver.get("https://example.com")
finally:
    driver.quit()

Python WebDriver timeout methods take seconds, unlike the millisecond values in Selenium’s documented defaults. The example uses a 30-second script limit, a 120-second page-load limit, and no implicit wait; adjust them for the work you run. Keep the cleanup in a finally block so an exception does not bypass deliberate session termination.

Implicit and explicit waits

An implicit wait applies globally to element-location calls. Selenium’s waiting-strategies guide warns: “Do not mix implicit and explicit waits.” Combining them can produce unpredictable timing. If you need condition-based waits, prefer an explicit wait strategy and keep the implicit wait at zero rather than layering two waiting systems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

Neither an implicit nor an explicit element wait means “close the browser if no automation command arrives.” Once work is finished, end the WebDriver session with quit; Selenium’s driver-session guide recommends it to stop the session.

Puppeteer: a wait timeout is not idle cleanup

Puppeteer’s Page API search result documents a 30-second default for the wait timeout and says it can be changed with Page.setDefaultTimeout. That is a wait-operation setting, not evidence that Puppeteer automatically closes an idle browser after that interval. Consult the API for the specific wait you use, and close the browser deliberately when your automation lifecycle is complete.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Plan timers, recovery, and cleanup

Choose a value from observed work, not a cross-framework rule

Timeout numbers are meaningful only with their scope and unit. A 30-second script limit, a 30-second element wait, and a 30-second idle lifecycle limit would each expire under different conditions. Estimate normal and worst-case operation durations in your environment, then give important work enough time while ensuring failed work does not occupy resources indefinitely.

Handle expiry as a normal failure path

  • Log which operation or lifecycle timer expired, along with the page or task being processed.
  • For an operation timeout, decide whether to retry, capture diagnostic state, or fail the task. Retrying blindly can repeat side effects.
  • For an idle browser closure, expect the next task to need a new browser or session rather than assuming the old page is still usable.
  • Use explicit cleanup paths, such as Selenium quit, even when an idle timeout is configured.

Balance reliability and resource use

Shorter operation limits fail slow but valid work sooner; longer limits can leave a stuck job occupying capacity for longer. Shorter idle lifecycle limits release unused browsers sooner but may require a fresh startup after a long pause. Account for startup cost, concurrency, task duration, and whether a controller can resume work. A timeout is a bound, not a substitute for health checks, retry policy, or cleanup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.

Troubleshooting timeout behavior

  • The browser stays open after setting an action timeout: that timeout only bounds the action. Configure a lifecycle timeout in the browser-owning service, or close the session explicitly.
  • Playwright MCP closes the browser sooner or later than expected: verify that --idle-timeout is passed to the active server, that the value is in milliseconds, and that it is not 0. Check whether the browser was launched headless, headed, or attached through CDP or the extension.
  • A wait never seems to expire: check whether the particular Playwright operation defaults to no timeout, whether a method-level setting overrides a default, and whether 0 disabled that operation’s limit.
  • Selenium element searches take longer than expected: inspect the session-wide implicit wait and any explicit waits. Avoid mixing implicit and explicit waits.
  • Selenium reports a page-load or script timeout: identify which of those distinct limits fired and tune that category, rather than changing the element wait without evidence.
  • The WebDriver process remains after a failure: make sure session cleanup runs in a finally path and calls quit.
  • Behavior differs across framework versions: verify the exact method and defaults in the documentation for the framework version in use. The values above are documented defaults, not a guarantee that every version or wrapper behaves identically.

Or skip the browser setup

If your actual task is to capture a website screenshot rather than run an interactive browser workflow, ScreenshotNeo offers a one-request screenshot API. This does not set an idle timeout or replace browser automation for workflows that need interaction.

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 documentation for API details. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000. ScreenshotNeo is a purpose-built screenshot API, not a general browser lifecycle manager. Sign up free for 1,000 screenshots a month, with no card required.

Frequently Asked Questions

Does an operation timeout automatically kill the browser?

Not in the documented Playwright Page, Selenium wait, or Puppeteer Page timeout controls described here. Use an explicit lifecycle setting or session cleanup.

Are the Selenium defaults a recommendation for every test suite?

No. They are documented defaults for a new session, not universal target values. Set timeouts to suit the operation and environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.