$ show CloakHQ/CloakBrowser
CloakBrowser is a commercial stealth browser automation library that wraps Playwright (Python, JavaScript, .NET) with a custom patched Chromium binary. Its core purpose is to evade bot detection by spoofing browser fingerprints, providing human-like interaction (Bezier mouse moves, realistic typing with typos, smooth scrolling), and managing licensed binary downloads with cryptographic verification. The architecture is a multi-language SDK sharing identical logic across Python, TypeScript, and C#, with a common human interaction engine, proxy/GeoIP integration, and license enforcement via denial files and server validation. Key entry points are the `launch()` and `humanize()` APIs, CLI diagnostics (`info`, `login`, `install`), and the `cloakserve` CDP multiplexer. External dependencies include Playwright/Puppeteer, MaxMind GeoLite2 database, Ed25519 signature verification (BouncyCastle), and a license validation server. The codebase demonstrates high engineering discipline with extensive cross-language parity tests and security-conscious binary distribution, but carries drift risks from triple-language duplication and reliance on Playwright internal APIs.
The LLM identified 5 files worth highlighting for reuse:
Manages the download and verification of the proprietary Chromium binary. Uses Ed25519 signature verification and SHA256 checksums with version binding. Implements atomic file writes, concurrent download guards, stale-directory cleanup, and fallback paths (Pro binary vs free). This component is safely extractable for any project needing signed binary distribution.
The human interaction engine implementing the full action pipeline: element resolution, scroll-into-view with acceleration/deceleration, Bezier curve mouse movement, hit-target verification, and keyboard typing with mistype simulation. Configurable via presets ('default'/'careful') and per-call overrides. The pattern is self-contained and could be reused in any automation framework requiring realistic input simulation.
Abstraction over Chrome DevTools Protocol isolated worlds for stealth DOM access. Manages per-frame world creation, Playwright InjectedScript installation, element registry, geometry queries, and handles OOPIFs and stale-world recreation. This isolated-world pattern prevents script leakage and is reusable for any CDP-based automation needing safe DOM interaction.
License management with server validation (24-hour cache), Pro/free tier routing, and post-handshake denial detection via exit-code mapping and denial files. Implements a denial file pattern where the binary writes a JSON integer before exit, which the wrapper reads on subsequent calls to surface errors. The pattern is generic and could be extracted for any licensed software distribution.
A Roslyn source generator that automatically emits delegating wrapper classes for interfaces, solving Playwright .NET's sealed-interface problem without runtime monkey-patching. Generates typed wrappers that delegate all members to an inner instance while allowing override of specific methods. This is a novel, reusable code generation pattern for any C# project needing interface-based decorators without manual boilerplate.