Overview
Some websites detect and block automated browsers. BAP provides a--stealth flag that applies anti-detection techniques at the Playwright level.
Three Tiers
BAP’s stealth mode applies techniques progressively:| Tier | What It Does |
|---|---|
| Basic | Removes navigator.webdriver flag, sets standard user agent |
| Standard | Basic + overrides navigator.plugins, navigator.languages, WebGL renderer strings |
| Full | Standard + patches chrome.runtime, permissions.query, canvas fingerprint noise |
CLI Usage
Connecting to an Existing Browser
For maximum stealth, launch Chrome manually with specific flags and connect via CDP:TypeScript SDK
Best Practices
Use a real Chrome channel
Use a real Chrome channel
Set
channel: "chrome" or channel: "msedge" instead of using Playwright’s bundled Chromium. Detection systems often check for Chromium-specific build artifacts.Run headful when possible
Run headful when possible
Headless browsers have subtle differences (viewport handling, GPU compositing) that some detection scripts flag. Use
headless: false for critical flows.Set realistic viewport and user agent
Set realistic viewport and user agent
Use common viewport sizes (1920x1080, 1440x900) and up-to-date user agent strings. BAP’s emulation API makes this simple:
Add natural delays between actions
Add natural delays between actions
Rapid-fire actions are a bot signal. Space out actions naturally, especially on sites with aggressive detection.
Persist user data directory
Persist user data directory
Use
userDataDir in browser/launch to maintain cookies, cached data, and browser fingerprint across sessions. Fresh profiles are a detection signal.