October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Chrome Headless Mode Changes: What Selenium Users Need to Know

Use --headless in current Chrome Selenium options. Here’s what Chrome 132 removed, how to replace Selenium’s old convenience methods, and when Headless Shell makes sense.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For current Chrome, add --headless to Selenium’s Chrome options. Chrome’s unified Headless mode arrived in Chrome 112; Chrome 132 removed the old implementation from the Chrome binary, so --headless=old no longer works there. Separately, Selenium deprecated its Headless convenience methods in 4.8 and removed them in 4.10. Replace those methods with an explicit browser argument.

What changed, and when?

There are two separate migrations: Chrome changed which Headless implementation its browser binary runs, and Selenium changed how its APIs set the browser option.

  • Chrome 112: Chrome introduced unified Headless. It uses the main Chrome browser implementation, creating platform windows without displaying them. Chrome’s Headless documentation describes the current mode.
  • Chrome 132: Chrome removed the legacy Headless implementation from the Chrome binary. The --headless=old flag now produces an error; both --headless and --headless=new select unified Headless. See Chrome’s removal announcement.
  • Selenium 4.8 and 4.10: Selenium deprecated convenience methods for enabling Headless in 4.8 and removed them in 4.10. This API change is distinct from Chrome 132’s browser change. Selenium’s migration post explains the transition.

How to run Selenium with current Chrome Headless

Set Chrome’s arguments through the Chrome options object for your language binding. Use --headless for current Chrome. The exact class and method names depend on the Selenium binding and version; the JavaScript example below follows Chrome’s official Selenium-WebDriver example.

JavaScript

const { Builder } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');

const options = new chrome.Options();
options.addArguments('--headless');

const driver = await new Builder()
  .forBrowser('chrome')
  .setChromeOptions(options)
  .build();

try {
  await driver.get('https://example.com');
  console.log(await driver.getTitle());
} finally {
  await driver.quit();
}

For another language, use that binding’s Chrome options API and add the same browser argument. Check the current API documentation for the method spelling in your binding. The Selenium migration post includes examples for Java, JavaScript, C#, Ruby, and Python; its --headless=new examples reflect the 2023 transition period. Chrome’s current documentation recommends plain --headless.

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

Replacing a removed Selenium convenience method

If your code calls setHeadless(true) or a binding equivalent, remove that call and add --headless to the Chrome options arguments instead. This keeps the browser choice explicit and avoids relying on an API Selenium removed in 4.10.

Should you use unified Headless or chrome-headless-shell?

Choose based on what your test needs to exercise. Chrome describes unified Headless as the real Chrome browser implementation, suitable when you want behavior and feature coverage aligned with headful Chrome. The standalone chrome-headless-shell retains the old implementation outside the Chrome browser binary. Chrome describes it as a lightweight wrapper around Chromium’s content module with fewer dependencies. These are qualitative descriptions, not a quantified performance comparison. See Chrome’s Headless Shell documentation.

Need Better starting point Trade-off
End-to-end tests that should exercise Chrome’s main browser implementation or browser extensions Unified Headless with --headless Uses the Chrome browser implementation rather than the older shell.
Compatibility with behavior specific to the former Headless implementation Evaluate chrome-headless-shell It is separate from the Chrome browser binary and does not provide the same full-browser fidelity.
A smaller dependency footprint for a task such as screenshot capture or scraping Consider chrome-headless-shell Chrome says it may be more performant for some tasks, but does not provide a quantified comparison.

If an old test behaves differently after migration, first determine whether it depended on behavior unique to the old implementation. Otherwise, run it with unified Headless and check its output and behavior. Keep Chrome and ChromeDriver aligned with your supported setup, and review ChromeDriver downloads and release notes when upgrading; driver-level Headless Shell discovery and legacy workarounds have changed across versions.

Do you still need Xvfb or –disable-gpu?

Chrome’s Headless Shell documentation says a display server such as Xvfb is not needed for Headless Chrome. It also says --disable-gpu is needed only on Windows in the described context, as a temporary workaround for a few bugs. Do not carry either setting forward as a universal requirement; confirm whether your platform and browser version actually need it.

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

Troubleshooting Selenium Headless

  • Chrome reports an error for --headless=old. Chrome 132 removed the old implementation from the browser binary. Use --headless for unified Headless, or evaluate the separate chrome-headless-shell if your workload specifically needs old behavior.
  • Your code no longer compiles or the method is missing. Selenium removed Headless convenience methods in 4.10 after deprecating them in 4.8. Set --headless in Chrome options instead.
  • The test starts but behaves differently from the old setup. Unified Headless uses Chrome’s main browser implementation. Check whether the test relied on old-implementation-specific behavior; compare the result with the workload’s requirements before selecting Headless Shell.
  • ChromeDriver cannot find or launch the intended browser. Check Chrome and ChromeDriver setup and consult the versioned ChromeDriver release notes for changes to Headless Shell discovery and legacy workarounds.
  • A container setup assumes a display server or GPU flag. Chrome says Xvfb is unnecessary for Headless Chrome. Treat --disable-gpu as platform- and issue-specific, not a default fix.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a website screenshot rather than a Selenium browser test, ScreenshotNeo provides a screenshot API and MCP server. For a one-request capture, use cURL:

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. It removes cookie banners, newsletter popups, and chat widgets before capture; 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 a month with no card; paid plans start at $5 for 3,000.

Sign up free for ScreenshotNeo and capture up to 1,000 screenshots a month without a card.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.