Skip to main content

Overview

Some websites detect and block automated browsers. BAP provides a --stealth flag that applies anti-detection techniques at the Playwright level.
Stealth mode is designed for legitimate automation use cases (testing your own sites, accessibility auditing, etc.). Respect website terms of service.

Three Tiers

BAP’s stealth mode applies techniques progressively:

CLI Usage

Connecting to an Existing Browser

For maximum stealth, launch Chrome manually with specific flags and connect via CDP:
This approach uses a real Chrome profile instead of Playwright’s Chromium, which some detection systems distinguish.

TypeScript SDK

Best Practices

Set channel: "chrome" or channel: "msedge" instead of using Playwright’s bundled Chromium. Detection systems often check for Chromium-specific build artifacts.
Headless browsers have subtle differences (viewport handling, GPU compositing) that some detection scripts flag. Use headless: false for critical flows.
Use common viewport sizes (1920x1080, 1440x900) and up-to-date user agent strings. BAP’s emulation API makes this simple:
Rapid-fire actions are a bot signal. Space out actions naturally, especially on sites with aggressive detection.
Use userDataDir in browser/launch to maintain cookies, cached data, and browser fingerprint across sessions. Fresh profiles are a detection signal.