Skip to main content

Stealth Chromium that passes every bot detection test. Drop-in Playwright replacement with source-level fingerprint patches.

Project description

CloakBrowser

CloakBrowser

PyPI npm Python License Downloads Stars Last Commit

Stealth Chromium that passes every bot detection test.

Drop-in Playwright/Puppeteer replacement for Python and JavaScript. Same API, same code โ€” just swap the import. Your browser now scores 0.9 on reCAPTCHA v3, passes Cloudflare Turnstile, and clears 14 out of 14 stealth detection tests.

  • ๐Ÿ”’ 16 source-level C++ patches โ€” not JS injection, not config flags
  • ๐ŸŽฏ 0.9 reCAPTCHA v3 score โ€” human-level, server-verified
  • โ˜๏ธ Passes Cloudflare Turnstile, FingerprintJS, BrowserScan โ€” 14/14 tests
  • ๐Ÿ”„ Drop-in replacement โ€” works with Playwright (Python & JS) and Puppeteer (JS)
  • ๐Ÿ“ฆ pip install cloakbrowser or npm install cloakbrowser โ€” binary auto-downloads, zero config
  • ๐ŸฆŠ Fills the Camoufox vacuum โ€” Chromium-based, actively maintained

Python:

from cloakbrowser import launch

browser = launch()
page = browser.new_page()
page.goto("https://protected-site.com")  # no more blocks
browser.close()

JavaScript (Playwright):

import { launch } from 'cloakbrowser';

const browser = await launch();
const page = await browser.newPage();
await page.goto('https://protected-site.com');
await browser.close();

JavaScript (Puppeteer):

import { launch } from 'cloakbrowser/puppeteer';

const browser = await launch();
const page = await browser.newPage();
await page.goto('https://protected-site.com');
await browser.close();

Install

Python:

pip install cloakbrowser

JavaScript / Node.js:

# With Playwright
npm install cloakbrowser playwright-core

# With Puppeteer
npm install cloakbrowser puppeteer-core

On first run, the stealth Chromium binary is automatically downloaded (~200MB, cached locally).

Why CloakBrowser?

  • Config-level patches break โ€” playwright-stealth, undetected-chromedriver, and puppeteer-extra inject JavaScript or tweak flags. Every Chrome update breaks them. Antibot systems detect the patches themselves.
  • CloakBrowser patches Chromium source code โ€” fingerprints are modified at the C++ level, compiled into the binary. Detection sites see a real browser because it is a real browser.
  • One line to switch โ€” same Playwright API, no new abstractions, no CAPTCHA-solving services.

Test Results

All tests verified against live detection services. Last tested: Feb 2026 (Chromium 142).

Detection Service Stock Playwright CloakBrowser Notes
reCAPTCHA v3 0.1 (bot) 0.9 (human) Server-side verified
Cloudflare Turnstile (non-interactive) FAIL PASS Auto-resolve
Cloudflare Turnstile (managed) FAIL PASS Single click
ShieldSquare (yad2.co.il) BLOCKED PASS Production site
FingerprintJS bot detection DETECTED PASS demo.fingerprint.com
BrowserScan bot detection DETECTED NORMAL (4/4) browserscan.net
bot.incolumitas.com 13 fails 1 fail WEBDRIVER spec only
deviceandbrowserinfo.com 6 true flags 0 true flags isBot: false
navigator.webdriver true false Source-level patch
navigator.plugins.length 0 5 Real plugin list
window.chrome undefined object Present like real Chrome
UA string HeadlessChrome Chrome/142.0.0.0 No headless leak
CDP detection Detected Not detected isAutomatedWithCDP: false
TLS fingerprint Mismatch Identical to Chrome ja3n/ja4/akamai match

14/14 tests passed.

Proof

reCAPTCHA v3 โ€” Score 0.9
reCAPTCHA v3 score 0.9 โ€” server-side verified (human-level)

Cloudflare Turnstile โ€” Success
Cloudflare Turnstile non-interactive challenge โ€” auto-resolved

BrowserScan โ€” Normal
BrowserScan bot detection โ€” NORMAL (4/4 checks passed)

FingerprintJS โ€” Passed
FingerprintJS web-scraping demo โ€” data served, not blocked

How It Works

CloakBrowser is a thin wrapper (Python + JavaScript) around a custom-built Chromium binary:

  1. You install โ†’ pip install cloakbrowser or npm install cloakbrowser
  2. First launch โ†’ binary auto-downloads for your platform (Linux x64 / macOS arm64)
  3. Every launch โ†’ Playwright or Puppeteer starts with our binary + stealth args
  4. You write code โ†’ standard Playwright/Puppeteer API, nothing new to learn

The binary includes 16 source-level patches that modify:

  • Canvas fingerprint generation
  • WebGL renderer output
  • Audio processing fingerprint
  • Font enumeration results
  • Hardware concurrency reporting
  • Client rect measurements
  • GPU vendor/renderer strings
  • WebDriver flag
  • Headless detection signals
  • And more...

These are compiled into the Chromium binary โ€” not injected via JavaScript, not set via flags.

API

launch()

from cloakbrowser import launch

# Basic โ€” headless, default stealth config
browser = launch()

# Headed mode (see the browser window)
browser = launch(headless=False)

# With proxy
browser = launch(proxy="http://user:pass@proxy:8080")

# With extra Chrome args
browser = launch(args=["--disable-gpu", "--window-size=1920,1080"])

# Without default stealth args (bring your own fingerprint flags)
browser = launch(stealth_args=False, args=["--fingerprint=12345"])

Returns a standard Playwright Browser object. All Playwright methods work: new_page(), new_context(), close(), etc.

launch_async()

import asyncio
from cloakbrowser import launch_async

async def main():
    browser = await launch_async()
    page = await browser.new_page()
    await page.goto("https://example.com")
    print(await page.title())
    await browser.close()

asyncio.run(main())

launch_context()

Convenience function that creates browser + context with common options:

from cloakbrowser import launch_context

context = launch_context(
    user_agent="Custom UA",
    viewport={"width": 1920, "height": 1080},
    locale="en-US",
    timezone_id="America/New_York",
)
page = context.new_page()

Utility Functions

from cloakbrowser import binary_info, clear_cache, ensure_binary

# Check binary installation status
print(binary_info())
# {'version': '142.0.7444.175', 'platform': 'linux-x64', 'installed': True, ...}

# Force re-download
clear_cache()

# Pre-download binary (e.g., during Docker build)
ensure_binary()

JavaScript / Node.js API

CloakBrowser ships a TypeScript package with full type definitions. Choose Playwright or Puppeteer โ€” same stealth binary underneath.

Playwright (default)

import { launch, launchContext } from 'cloakbrowser';

// Basic
const browser = await launch();

// With options
const browser = await launch({
  headless: false,
  proxy: 'http://user:pass@proxy:8080',
  args: ['--window-size=1920,1080'],
});

// Convenience: browser + context in one call
const context = await launchContext({
  userAgent: 'Custom UA',
  viewport: { width: 1920, height: 1080 },
  locale: 'en-US',
  timezoneId: 'America/New_York',
});
const page = await context.newPage();

Note: Each example above is standalone โ€” not meant to run as one block.

Puppeteer

Note: The Playwright wrapper is recommended for sites with reCAPTCHA Enterprise. Puppeteer's CDP protocol leaks automation signals that reCAPTCHA Enterprise can detect, causing intermittent 403 errors. This is a known Puppeteer limitation, not specific to CloakBrowser. Use Playwright for best results.

import { launch } from 'cloakbrowser/puppeteer';

const browser = await launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://example.com');
await browser.close();

Utility Functions (JS)

import { ensureBinary, clearCache, binaryInfo } from 'cloakbrowser';

// Pre-download binary (e.g., during Docker build)
await ensureBinary();

// Check installation status
console.log(binaryInfo());

// Force re-download
clearCache();

Configuration

Env Variable Default Description
CLOAKBROWSER_BINARY_PATH โ€” Skip download, use a local Chromium binary
CLOAKBROWSER_CACHE_DIR ~/.cloakbrowser Binary cache directory
CLOAKBROWSER_DOWNLOAD_URL GitHub Releases Custom download URL for binary
CLOAKBROWSER_AUTO_UPDATE true Set to false to disable background update checks

Use With Existing Playwright Code

If you have existing Playwright scripts, migration is one line:

- from playwright.sync_api import sync_playwright
- pw = sync_playwright().start()
- browser = pw.chromium.launch()
+ from cloakbrowser import launch
+ browser = launch()

page = browser.new_page()
page.goto("https://example.com")
# ... rest of your code works unchanged

Comparison

Feature Playwright playwright-stealth undetected-chromedriver Camoufox CloakBrowser
reCAPTCHA v3 score 0.1 0.3-0.5 0.3-0.7 0.7-0.9 0.9
Cloudflare Turnstile Fail Sometimes Sometimes Pass Pass
Patch level None JS injection Config patches C++ (Firefox) C++ (Chromium)
Survives Chrome updates N/A Breaks often Breaks often Yes Yes
Maintained Yes Stale Stale Dead (2025) Active
Browser engine Chromium Chromium Chrome Firefox Chromium
Playwright API Native Native No (Selenium) No Native

Platforms

CloakBrowser is in active development. Pre-built binaries are currently Linux-only. macOS and Windows builds are coming soon.

Platform Status
Linux x86_64 โœ… Available
macOS arm64 (Apple Silicon) Coming soon
macOS x86_64 (Intel) Coming soon
Windows Planned

On macOS/Windows? You can still use CloakBrowser via Docker or with your own Chromium binary by setting CLOAKBROWSER_BINARY_PATH=/path/to/chrome.

Examples

Python โ€” see examples/:

JavaScript โ€” see js/examples/:

Roadmap

Feature Status
Linux x64 binary โœ… Released
macOS arm64 (Apple Silicon) ๐Ÿ”œ In progress
Chromium 145 build ๐Ÿ”œ In progress
JavaScript/Puppeteer + Playwright support โœ… Released
Fingerprint rotation per session ๐Ÿ“‹ Planned
Built-in proxy rotation ๐Ÿ“‹ Planned
Windows support ๐Ÿ“‹ Planned

โญ Star this repo to get notified when Chromium 145 and macOS builds drop.

Docker

A ready-to-use Dockerfile is included. It installs system deps, the package, and pre-downloads the stealth binary during build:

docker build -t cloakbrowser .
docker run --rm cloakbrowser python examples/basic.py

The key steps in the Dockerfile:

  1. System deps โ€” Chromium requires ~15 shared libraries (libnss3, libgbm1, etc.)
  2. pip install . โ€” installs CloakBrowser + Playwright
  3. ensure_binary() โ€” downloads the stealth Chromium binary at build time (~200MB), so containers start instantly

To extend with your own script, just add a COPY + CMD:

FROM cloakbrowser
COPY your_script.py /app/
CMD ["python", "your_script.py"]

Note: If you run CloakBrowser inside a web server with uvloop (e.g., uvicorn[standard]), use --loop asyncio to avoid subprocess pipe hangs.

Headed Mode (for aggressive bot detection)

Some sites using advanced bot detection (e.g., DataDome, Cloudflare Turnstile) can detect headless mode even with our C++ patches. For these sites, run in headed mode with a virtual display:

# Install Xvfb (virtual framebuffer)
sudo apt install xvfb

# Start virtual display
Xvfb :99 -screen 0 1920x1080x24 &
export DISPLAY=:99
from cloakbrowser import launch

# Headed mode + residential proxy for maximum stealth
browser = launch(headless=False, proxy="http://your-residential-proxy:port")
page = browser.new_page()
page.goto("https://heavily-protected-site.com")  # passes DataDome, etc.
browser.close()

This runs a real headed browser rendered on a virtual display โ€” no physical monitor needed. Combined with a residential proxy, this passes even the most aggressive detection services.

Tip: Datacenter IPs are often flagged by IP reputation databases regardless of browser fingerprint. For sites with strict bot detection, a residential proxy makes the difference.

Troubleshooting

Binary download fails / timeout Set a custom download URL or use a local binary:

export CLOAKBROWSER_BINARY_PATH=/path/to/your/chrome

"playwright install" vs CloakBrowser binary You do NOT need playwright install chromium. CloakBrowser downloads its own binary. You only need Playwright's system deps:

playwright install-deps chromium

FAQ

Q: Is this legal? A: CloakBrowser is a browser. Using it is legal. What you do with it is your responsibility, just like with Chrome, Firefox, or any browser. We do not endorse violating website terms of service.

Q: How is this different from Camoufox? A: Camoufox patched Firefox. We patch Chromium. Chromium means native Playwright support, larger ecosystem, and TLS fingerprints that match real Chrome. Also, Camoufox is no longer maintained (since March 2025).

Q: Will detection sites eventually catch this? A: Possibly. Bot detection is an arms race. Source-level patches are harder to detect than config-level patches, but not impossible. We actively monitor and update when detection evolves.

Q: Can I use my own proxy? A: Yes. Pass proxy="http://user:pass@host:port" to launch().

Q: Can I use this with Docker? A: Yes. A ready-to-use Dockerfile is included โ€” see the Docker section above.

License

MIT โ€” see LICENSE.

Contributing

Issues and PRs welcome. Contact: cloakhq@pm.me

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloakbrowser-0.1.8.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloakbrowser-0.1.8-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file cloakbrowser-0.1.8.tar.gz.

File metadata

  • Download URL: cloakbrowser-0.1.8.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cloakbrowser-0.1.8.tar.gz
Algorithm Hash digest
SHA256 aa38ff8681b0090dc1c393370e7da67cc22be9f37f1947ce6c3240101da46980
MD5 cb5c8a6e73d6da153773ac24dc707035
BLAKE2b-256 0f6163aed3507afc847c75fc1e937fad29916f3e43a40da1008b8045ca208930

See more details on using hashes here.

File details

Details for the file cloakbrowser-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: cloakbrowser-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cloakbrowser-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b92779386aa40fa30cef94c07e1be84eab4785e94219eb0d4566e0c6ee81fb0e
MD5 f029cc0f96a5276373eb3dc34ee90eac
BLAKE2b-256 d816f2de5ed5cf1c40db6edf0dc72bf2cd98748f7342d7f259eb1c01d8763cd9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page