How to Disable Default Stealth Args for Custom Fingerprint Configuration in CloakBrowser
Set stealthArgs: false in your launch options to bypass the built-in fingerprint flags and supply your own Chromium arguments.
CloakBrowser automatically injects default "stealth" Chromium flags—such as --fingerprint seeds and --no-sandbox—whenever you launch a browser instance. This behavior is hardcoded in the argument builder at js/src/args.ts, which calls getDefaultStealthArgs() unless explicitly instructed otherwise. To disable default stealth args for custom fingerprint configuration in CloakBrowser, you must set the stealthArgs option to false in your launch configuration, allowing you to define precise fingerprint parameters while retaining the library's other anti-detection protections.
How Default Stealth Arguments Are Applied
The launch process constructs the final Chromium command-line arguments through a builder pattern implemented in js/src/args.ts. Before processing user-supplied options, the builder inserts flags returned by getDefaultStealthArgs() from js/src/config.ts (lines 8-26). These defaults include randomized fingerprint seeds and sandbox disable flags that ensure baseline stealth compatibility.
When stealthArgs is omitted or set to true, the library automatically prepends these flags to your argument list. This automatic injection occurs in the conditional block at lines 15-22 of js/src/args.ts, potentially overwriting or conflicting with custom fingerprint configurations you provide via the args array.
Using stealthArgs: false to Disable Built-In Flags
To take full control of the fingerprint configuration, pass stealthArgs: false in your LaunchOptions as defined in js/src/types.ts (lines 8-22). This boolean gate controls whether getDefaultStealthArgs() executes at all.
When disabled, the builder skips the default flag injection entirely. The library proceeds directly to processing your custom args, along with any derived flags from the timezone and locale convenience options. Critically, this bypass only affects the fingerprint-related defaults—other stealth mechanisms like GPU-blocklist bypass and headless mode detection prevention remain fully active.
Implementing Custom Fingerprint Configurations
With the defaults disabled, you can supply precise fingerprint parameters through two complementary approaches.
Method 1: Direct Chromium Arguments
Pass raw Chromium flags through the args array to set custom fingerprint seeds, platforms, and language settings:
import { launch } from "cloakbrowser";
await launch({
headless: true,
stealthArgs: false,
args: [
"--fingerprint=12345",
"--fingerprint-platform=linux",
"--fingerprint-timezone=Europe/London",
"--lang=fr-FR",
],
});
Method 2: Using Convenience Helpers
Alternatively, use the high-level timezone and locale options, which automatically translate into the appropriate --fingerprint-timezone, --lang, and --fingerprint-locale flags:
import { launch } from "cloakbrowser";
await launch({
headless: false,
stealthArgs: false,
args: ["--fingerprint=98765"],
timezone: "America/New_York",
locale: "en-US",
});
In this example, the timezone option appends --fingerprint-timezone=America/New_York, while locale injects both --lang=en-US and --fingerprint-locale=en-US alongside your custom fingerprint seed.
What Remains Active When You Disable stealthArgs
Disabling stealthArgs only removes the default fingerprint-related flags generated by getDefaultStealthArgs() in js/src/config.ts. The following CloakBrowser protections continue to function normally:
- GPU-blocklist bypass and hardware acceleration flags
- Headless mode detection prevention (when
headless: true) - Proxy configuration passed via the
proxyoption - Window size and viewport adjustments
This selective disabling allows you to customize fingerprint randomization while retaining the library's other anti-detection capabilities.
Summary
- Set
stealthArgs: falseinLaunchOptionsto skip the automatic injection of default stealth flags defined injs/src/config.ts. - The gate condition in
js/src/args.ts(lines 15-22) preventsgetDefaultStealthArgs()from executing when this option is explicitly set tofalse. - Provide custom fingerprint flags directly via the
argsarray or use thetimezoneandlocalehelpers for convenient parameter generation. - Other stealth mechanisms—including GPU-blocklist bypass and proxy handling—remain active regardless of the
stealthArgssetting.
Frequently Asked Questions
What happens if I omit stealthArgs when specifying custom fingerprint flags?
If you omit stealthArgs or set it to true, CloakBrowser merges your custom args with the defaults from getDefaultStealthArgs(). This can result in conflicting --fingerprint values or redundant flags, as the builder in js/src/args.ts concatenates both sets before launching Chromium.
Can I selectively disable only specific default flags?
No. The stealthArgs option is a boolean switch that controls the entire getDefaultStealthArgs() invocation. To use only specific defaults, you must set stealthArgs: false and manually re-add the desired flags from js/src/config.ts to your custom args array.
Does disabling stealthArgs affect proxy or headless configuration?
No. The stealthArgs flag governs only the fingerprint-related Chromium arguments generated by getDefaultStealthArgs(). Proxy settings, headless mode, GPU-blocklist bypass, and other launch parameters continue to function according to their respective options in LaunchOptions as defined in js/src/types.ts.
Where are the default stealth arguments defined in the source code?
The default stealth arguments are generated in js/src/config.ts (lines 8-26) by the getDefaultStealthArgs() function. These typically include --fingerprint seeds and --no-sandbox flags. The js/src/types.ts file (lines 8-22) defines the stealthArgs?: boolean property in the LaunchOptions interface that controls whether these defaults are applied.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →