Undetected (UC) mode reduces the fingerprints that websites use to identify automated browsers. It combines Chromium launch flags, JavaScript evasions, and optional binary patching to make the browser look more like a regular user session.
This page explains how to enable UC mode, what it does automatically, and how to layer additional evasions when a site is still detecting you.
What you will learn
- How to enable UC mode with
BrowserConfig. - Which automation markers are masked automatically.
- How to spoof timezone, geolocation, user agent, and locale.
- How to patch
chromedriverand add engine spoofing arguments.
Enable UC mode#
Set the driver mode to Uc in BrowserConfig:
BrowserConfig::default() is headless; with_headless(false) opens a window.
On the command line, --uc selects UC mode (a global option, so
it goes before the subcommand; --cdp and --uc cannot be combined).
UC mode drives Chrome through CDPChrome DevTools Protocol: the protocol DevTools uses to control Chrome., so it needs a Chromium-based browser (Chrome,
Chromium or Edge). With Firefox, BaseCase::new returns an
InvalidConfig error.
What is patched automatically#
When UC mode is active, the framework starts Chrome with the standard
undetected-Chrome launch arguments (--disable-blink-features=AutomationControlled,
--no-first-run, --disable-infobars and more), leaves out the
enable-automation switch, turns off the automation extension, and injects a
stealth script into every new document. The script applies these evasions:
cdc_variables injected bychromedriverare removed from the page context.navigator.webdriveris masked or removed.navigator.plugins,navigator.languages,hardwareConcurrency, anddeviceMemoryare mocked to realistic values.- Chrome-only objects such as
chrome.app,chrome.runtime,chrome.csi, andchrome.loadTimesare created. - WebGL vendor and renderer report a common Intel profile.
navigator.permissions.queryreturns natural values for notifications.navigator.mediaDevices.enumerateDevicesreturns realistic device labels.- iframe
contentWindowpatches propagate the mask into nested frames.
If you set no user agent and Chrome reports HeadlessChrome, the user agent is
overridden to say Chrome. If the BrowserConfig carries a Fingerprint, its
bootstrap script and CDP overrides are applied too.
UC mode does not patch the chromedriver binary for you; see Patch the chromedriver binary.
Extra evasions you can apply#
Timezone and geolocation#
These use CDP, so they work in Cdp and Uc mode; in plain WebDriver mode they
return an “Enable mode cdp or uc” error.
Custom user agent and locale#
Human-like input and fresh sessions#
uc_click(css) and uc_type(css, text) are aliases for human_click and
human_type, which move and type with human-like timing. uc_open_with_reconnect(url)
reconnects the session and then opens the URL; uc_open_with_disconnect(url)
quits the session, connects a new one with the same config, then opens the URL.
Reconnect for a fresh session#
reconnect closes the current WebDriver session and connects a new one with the
same configuration. With a driver you run yourself (--webdriver URL) the driver
process keeps running; with the auto-started driver, a new chromedriver is
started for the new session. This is useful when a site invalidates the current
session.
Patch the chromedriver binary#
Even in UC mode, a stock chromedriver may inject cdc_ variables into every
page. Patch the executable to strip those signatures:
From code:
The auto-started driver is downloaded_drivers/chromedriver (sbrs install
puts it there), so that is the file to patch. See
Binary Patching for backup, restore, and safety notes.
Engine spoofing arguments#
Add Chromium flags that disable automation telemetry:
engine_spoofing_args() returns flags such as
--disable-blink-features=AutomationControlled and disables background
networking and default apps.
Still detected?#
If a site still flags the browser, combine all layers:
Patch chromedriver
Patch chromedriver with ChromedriverPatcher and verify needs_patch()
returns false.
Add the spoofing arguments
Add engine_spoofing_args() to the launch flags.
Use a coherent fingerprint
Use a coherent Fingerprint with consistent user
agent, platform, screen size, WebGL vendor, and geolocation.
Run headful
Run headful (with_headless(false)). A headless session already uses
--headless=new, not the legacy headless implementation.
Enable native spoofing
Enable native_spoofing to move spoofing out of JavaScript and into CDP
where possible.
Try the pure CDP engine
Try the pure CDP engine, which launches Chrome without chromedriver at all.
When to use UC mode#
Use UC mode when:
- A site blocks normal WebDriver traffic.
- You need to interact with Cloudflare-like challenges.
- You want the most human-like browser fingerprint possible.
Avoid UC mode when you do not need anti-detection, because the extra flags and patches can make debugging harder and may conflict with some CI environments.