Stealth Routes
Stealth routes use path-based semantics and the Chrome DevTools Protocol to provide stronger anti-detection than solutions like puppeteer-stealth. They are the recommended first step for BaaS users: changing your connection URL is all that's required to get started.
-
Stealth Route (Recommended) -
/stealthOur recommended managed stealth environment with advanced anti-detection and realistic fingerprinting. This route applies comprehensive browser fingerprint mitigations and entropy injection for maximum effectiveness against bot detection systems. -
Chromium Stealth -
/chromium/stealthOptimized for our platform, this route applies a comprehensive set of fingerprinting mitigations and entropy injection tailored to Chromium. It modifies browser APIs with subtle, realistic values to closely emulate a real browser and reduce detectability. Chromium's flexibility allows this route to be better tailored at stealthiness compared to/chrome/stealth. -
Chrome Stealth -
/chrome/stealthDesigned for the standard Chrome experience, this route delivers anti-detection protections adjusted to preserve Chrome's native behaviors, while also providing enhanced resistance to bot-detection systems.
| Route | Browser | Best For | Notes |
|---|---|---|---|
/stealth | Chromium/Chrome | Most use cases | Recommended. Managed environment with comprehensive fingerprint mitigations and entropy injection. |
/chromium/stealth | Chromium | Custom configurations | Chromium's flexibility allows more tailored stealthiness than /chrome/stealth. |
/chrome/stealth | Chrome | Chrome-native behavior | Preserves Chrome's native behaviors while adding anti-detection protections. |
Stealth routes modify browser behavior in ways that can produce unexpected results for some automation tasks. They are not the default for this reason. Use them when you are dealing with bot detection issues, not as a general-purpose browser configuration.
- Puppeteer
- Playwright
// Stealth (Recommended):
await puppeteer.connect({
browserWSEndpoint:
"wss://production-sfo.browserless.io/stealth?token=YOUR_API_TOKEN_HERE",
});
// Chromium:
await puppeteer.connect({
browserWSEndpoint:
"wss://production-sfo.browserless.io/chromium/stealth?token=YOUR_API_TOKEN_HERE",
});
// Chrome:
await puppeteer.connect({
browserWSEndpoint:
"wss://production-sfo.browserless.io/chrome/stealth?token=YOUR_API_TOKEN_HERE",
});
- Javascript
- Python
- Java
- C#
// Stealth (Recommended)
const stealthBrowser = await playwright.chromium.connectOverCDP(
"wss://production-sfo.browserless.io/stealth?token=YOUR_API_TOKEN_HERE"
);
// Chromium
const chromiumBrowser = await playwright.chromium.connectOverCDP(
"wss://production-sfo.browserless.io/chromium/stealth?token=YOUR_API_TOKEN_HERE"
);
// Chrome
const chromeBrowser = await playwright.chromium.connectOverCDP(
"wss://production-sfo.browserless.io/chrome/stealth?token=YOUR_API_TOKEN_HERE"
);
import asyncio
from playwright.async_api import async_playwright
STEALTH_URL = "wss://production-sfo.browserless.io/stealth?token=YOUR_API_TOKEN_HERE"
CHROMIUM_URL = "wss://production-sfo.browserless.io/chromium/stealth?token=YOUR_API_TOKEN_HERE"
CHROME_URL = "wss://production-sfo.browserless.io/chrome/stealth?token=YOUR_API_TOKEN_HERE"
async def main():
async with async_playwright() as p:
# Stealth (Recommended)
stealth_browser = await p.chromium.connect_over_cdp(STEALTH_URL)
# Chromium
chromium_browser = await p.chromium.connect_over_cdp(CHROMIUM_URL)
# Chrome
chrome_browser = await p.chromium.connect_over_cdp(CHROME_URL)
asyncio.run(main())
import com.microsoft.playwright.*;
public class PlaywrightConnectExample {
public static void main(String[] args) {
String STEALTH_URL = "wss://production-sfo.browserless.io/stealth?token=YOUR_API_TOKEN_HERE";
String CHROMIUM_URL = "wss://production-sfo.browserless.io/chromium/stealth?token=YOUR_API_TOKEN_HERE";
String CHROME_URL = "wss://production-sfo.browserless.io/chrome/stealth?token=YOUR_API_TOKEN_HERE";
try (Playwright playwright = Playwright.create()) {
// Stealth (Recommended)
Browser stealthBrowser = playwright.chromium().connectOverCDP(STEALTH_URL);
// Chromium
Browser chromiumBrowser = playwright.chromium().connectOverCDP(CHROMIUM_URL);
// Chrome
Browser chromeBrowser = playwright.chromium().connectOverCDP(CHROME_URL);
}
}
}
using System;
using System.Threading.Tasks;
using Microsoft.Playwright;
class Program
{
static async Task Main(string[] args)
{
string stealthUrl = "wss://production-sfo.browserless.io/stealth?token=YOUR_API_TOKEN_HERE";
string chromiumUrl = "wss://production-sfo.browserless.io/chromium/stealth?token=YOUR_API_TOKEN_HERE";
string chromeUrl = "wss://production-sfo.browserless.io/chrome/stealth?token=YOUR_API_TOKEN_HERE";
var playwright = await Playwright.CreateAsync();
// Stealth (Recommended)
var stealthBrowser = await playwright.Chromium.ConnectOverCDPAsync(stealthUrl);
// Chromium
var chromiumBrowser = await playwright.Chromium.ConnectOverCDPAsync(chromiumUrl);
// Chrome
var chromeBrowser = await playwright.Chromium.ConnectOverCDPAsync(chromeUrl);
}
}
Customizing Stealth Flags
Stealth routes apply a comprehensive set of Chrome flags by default to optimize anti-detection behavior. However, you can selectively remove specific flags if needed for your use case. This is particularly useful when:
- You have sufficient shared memory configured in your container and want to remove
--disable-dev-shm-usagefor better performance - You need to customize specific browser behaviors while maintaining other stealth protections
- You're troubleshooting compatibility issues with certain websites
Removing Stealth Flags
Use the ignoreDefaultArgs parameter in your launch options to remove specific stealth flags. This parameter accepts an array of flag names to exclude from the default stealth configuration.
Example: Remove --disable-dev-shm-usage flag
- Puppeteer
- Playwright
import puppeteer from "puppeteer-core";
const launchOptions = {
ignoreDefaultArgs: ["--disable-dev-shm-usage"]
};
const queryParams = new URLSearchParams({
token: 'YOUR_API_TOKEN_HERE',
launch: JSON.stringify(launchOptions)
});
const browser = await puppeteer.connect({
browserWSEndpoint: `wss://production-sfo.browserless.io/chromium/stealth?${queryParams.toString()}`,
});
import playwright from "playwright";
const launchOptions = {
ignoreDefaultArgs: ["--disable-dev-shm-usage"]
};
const queryParams = new URLSearchParams({
token: 'YOUR_API_TOKEN_HERE',
launch: JSON.stringify(launchOptions)
});
const browser = await playwright.chromium.connectOverCDP(
`wss://production-sfo.browserless.io/chromium/stealth?${queryParams.toString()}`
);
Example: Remove multiple flags
const launchOptions = {
ignoreDefaultArgs: [
"--disable-dev-shm-usage",
"--no-sandbox",
"--disable-infobars"
]
};
- All stealth flags are included by default for optimal anti-detection behavior
- Only flags explicitly listed in
ignoreDefaultArgswill be removed - Other stealth protections remain active even when specific flags are removed
- This feature is available on all stealth routes:
/stealth,/chromium/stealth, and/chrome/stealth