How to Spoof Your Platform with CloakBrowser: Running Windows on Linux
On Linux systems, CloakBrowser automatically applies Windows platform spoofing by default through the --fingerprint-platform=windows flag, though you can explicitly override this via the extra_args parameter when needed.
CloakBrowser, developed by CloakHQ, enables sophisticated platform spoofing by masquerading as a different operating system than the host machine. When running on Linux, the browser automatically presents itself as Windows to evade fingerprinting detection, leveraging specific logic defined in the configuration layer.
How CloakBrowser Determines the Platform Profile
The decision logic for selecting a fingerprint profile resides in two critical locations within the source code.
Platform Detection in config.py
In cloakbrowser/config.py, the SUPPORTED_PLATFORMS constant maps the host operating system and CPU architecture to a specific platform tag (such as linux-x64 or windows-x64). This detection occurs during initialization to identify the underlying hardware environment (lines 74-81).
Default Stealth Arguments Logic
The get_default_stealth_args() function in the same file constructs the baseline Chromium flags. According to the CloakHQ/CloakBrowser source code, this function applies different defaults based on the host OS: on macOS, it forces the macOS fingerprint using --fingerprint-platform=macos, but on all other systems—including Linux—it defaults to the Windows fingerprint with --fingerprint-platform=windows (lines 40-61).
Automatic Windows Spoofing on Linux Systems
When you launch CloakBrowser on a Linux host, platform spoofing happens automatically. The default stealth arguments already instruct the patched Chromium binary to masquerade as a Windows browser, eliminating the need for manual configuration in standard deployments.
This behavior is hardcoded in the configuration layer, specifically within cloakbrowser/config.py, where the default flag assignment occurs before any user input is processed.
Explicit Platform Override Methods
While Linux defaults to Windows spoofing, you may need to explicitly set the platform or override existing configurations on other operating systems. CloakBrowser provides multiple interfaces to inject the --fingerprint-platform flag.
Using the CLI with cloakserve
The cloakserve entry-point provides a convenient command-line interface for launching the browser with custom arguments:
# Linux – default already spoofs Windows
cloakserve launch
# Explicitly request Windows spoofing (works on any OS)
cloakserve launch --extra-args="--fingerprint-platform=windows"
Python API Implementation
For programmatic control, import the launch and build_args functions from cloakbrowser.browser:
from cloakbrowser.browser import launch, build_args
# Let CloakBrowser decide (Linux → Windows spoofing)
browser = launch()
# Force Windows spoofing on any host
args = build_args(
stealth_args=True, # include all default stealth flags
extra_args=["--fingerprint-platform=windows"]
)
browser = launch(extra_args=args)
Inspecting Effective Arguments
To verify which platform flag is actually being passed to Chromium, inspect the effective argument list using the build_args() helper:
from cloakbrowser.browser import build_args
args = build_args(
stealth_args=True,
extra_args=[],
)
print("Effective launch args:", args)
# Output includes: ['--no-sandbox', '--fingerprint=12345', '--fingerprint-platform=windows']
This debugging approach confirms that build_args() merges default stealth flags with user-provided parameters, giving precedence to manual overrides as implemented in cloakbrowser/browser.py (lines 38-87).
Summary
- CloakBrowser automatically spoofs Windows on Linux systems through default Chromium flags in
cloakbrowser/config.py. - The
get_default_stealth_args()function assigns--fingerprint-platform=windowsto all non-macOS hosts. - Override capabilities exist via the
extra_argsparameter in both CLI and Python API interfaces. - The
build_args()function incloakbrowser/browser.pyhandles argument merging while preserving user precedence. - Use
cloakserve launchor thelaunch()function with explicit flags to force specific platform fingerprints when needed.
Frequently Asked Questions
Does CloakBrowser require manual configuration to spoof Windows on Linux?
No manual configuration is necessary. According to the CloakHQ/CloakBrowser source code in cloakbrowser/config.py, the get_default_stealth_args() function automatically applies --fingerprint-platform=windows when running on any non-macOS system, including Linux.
How can I override the default platform fingerprint on macOS?
While macOS defaults to --fingerprint-platform=macos, you can force Windows spoofing by passing the flag explicitly through extra_args. The build_args() function in cloakbrowser/browser.py merges user-provided arguments with defaults, giving precedence to your specified --fingerprint-platform=windows value.
What file handles the platform detection logic?
The platform detection occurs in cloakbrowser/config.py, where SUPPORTED_PLATFORMS maps the host OS and CPU architecture to platform tags, and get_default_stealth_args() determines which fingerprint platform flag to inject into the Chromium launch arguments.
Can I verify which platform flag is actually being used?
Yes. Import build_args from cloakbrowser.browser and call it with stealth_args=True to inspect the generated argument list. This reveals the effective flags including --fingerprint-platform before passing them to the launch() function.
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 →