Stealth Mode
How to use Stealth Mode for CAPTCHA solving and anti-bot avoidance.
Overview
Morally “good” automations play a vital role in modern web development with automated browsers performing legitimate tasks like testing, scraping, and content aggregation. While anti-bot systems often block all automation by default, you can be a good citizen of the web by using tools that respect site resources and terms of service.
Stealth Mode enables your automated browser sessions to mimic real user behavior across different sessions and IPs.
- Basic Stealth Mode handles CAPTCHA solving and browser fingerprint customization
- Advanced Stealth Mode uses Browserbase’s custom-built Chromium Browser to avoid detection all together.
This guide shows you how to use these features responsibly.
Basic Stealth Mode
A browser fingerprint is the unique set of characteristics that websites use to identify and track browsers. With Stealth Mode, you can control these identifiers to customize how your automated browsers appear to websites.
Configuring the fingerprint is optional! By default, Browserbase will generate a random fingerprint and viewport for each session.
Fingerprint
Control the browser identity and system properties to simulate different environments:
- browsers: Specify supported browsers [“chrome”, “firefox”, “edge”, “safari”].
- devices: Set the device type [“desktop”, “mobile”].
- locales: Choose browser language settings [“en-US”, “en-GB”, etc.].
- operatingSystems: Simulate different OS environments [“android”, “ios”, “linux”, “macos”, “windows”].
Viewport
Supported Viewport Sizes
Browserbase supports a predefined set of standard viewport sizes to ensure compatibility across different devices and browsers. When creating a session, you must select from the following supported viewport dimensions:
Desktop Viewports
Width | Height | Device |
---|---|---|
1920 | 1080 | Standard Full HD (Desktop) |
1366 | 768 | Widescreen Laptop |
1536 | 864 | High-Resolution Laptop |
1280 | 720 | Small Desktop Monitor |
1024 | 768 | Minimum Supported Desktop Viewport |
Mobile Viewports
Width | Height | Device |
---|---|---|
414 | 896 | iPhone XR, iPhone 11 |
390 | 844 | iPhone 12, iPhone 13, iPhone 14 |
375 | 812 | iPhone X, iPhone XS |
360 | 800 | Standard Android Phone |
320 | 568 | iPhone SE, Small Devices |
Only the viewports listed above are supported. Custom dimensions outside these values are not allowed to maintain performance, compatibility, and rendering accuracy.
For a complete list of available options when creating a session, please refer to our API documentation on creating a session.
Advanced Stealth Mode
Advanced Stealth Mode is only available for Scale Plan customers. Reach out to hello@browserbase.com if you’re interested in learning more, trialing the feature, or upgrading.
While Basic Stealth Mode automatically detects and solves most CAPTCHAs, Advanced Stealth Mode reduces the chances of being flagged as a bot by using a custom version of the Chrome browser, built and maintained by the Browserbase Stealth Team.
With Advanced Stealth Mode, we handle fingerprinting for you so any custom fingerprint configuration will have no effect.
Proxies are still very important for reliable browsing, and it’s recommended to enable them alongside Advanced Stealth Mode. Learn more about our proxy infrastructure and configuration options.
Please note, this feature is currently in beta; if you have any feedback, please reach out to support@browserbase.com.
CAPTCHA Solving
Many websites use CAPTCHAs to distinguish between automated and human interactions, which can interrupt automation workflows. Browserbase provides integrated CAPTCHA solving to handle these challenges automatically, allowing your sessions to continue without manual intervention. CAPTCHA solving is enabled by default for Basic Stealth Mode and Advanced Stealth Mode.
How CAPTCHA Solving Works
- When a CAPTCHA is detected, Browserbase attempts to solve it in the background.
- Solving can take up to 30 seconds, depending on the CAPTCHA type and complexity.
- It’s recommended to enable proxies when using CAPTCHA solving for higher success rates.
- For custom CAPTCHAs, you can provide custom selectors to guide the solution process.
If you’d like to disable captcha solving, you can set solveCaptchas to false in the browserSettings when creating a session.
CAPTCHA Solving Events
Browserbase will emit a console log when a CAPTCHA is detected and being solved. You can listen to these events to wait until solving is complete before continuing with your automation.
Custom CAPTCHA Solving
If you encounter a non-standard, or custom captcha provider, you need to specify the explicit selector for the captcha image and button itself.
For this custom captcha provider, you’ll need to specify two CSS selectors:
The selector for the captcha image element
Right-click on the captcha image and select 'Inspect' then pull the 'id' from the HTML source code of the image
The id in this example is c_turingtestpage_ctl00_maincontent_captcha1_CaptchaImage
The selector for the input field where the solution should be entered
Right-click on the input field and select 'Inspect' then pull the 'id' from the HTML source code of the input field
The id in this example is ctl00_MainContent_txtTuringText
Configure your browser settings with these selectors
Disabling CAPTCHA Solving
CAPTCHA solving typically takes between 5 and 30 seconds.
If you’d like to disable captcha solving, you can set solveCaptchas
to false
in the browserSettings
when creating a session.
Best Practices for Reliable Automation
Follow these best practices to ensure stable, efficient, and responsible automation with Browserbase.
Site Compliance & Ethical Automation
Before automating a website:
- Review the site’s terms of service to ensure compliance.
- Check robots.txt for crawling guidelines when applicable.
- Cache responses to reduce unnecessary requests and improve efficiency.
Request Rate Management
To maintain stability and avoid detection:
- Add delays between requests to mimic human behavior.
- Implement exponential backoff when encountering errors.
- Monitor request frequency and adjust based on site response times.
CAPTCHA Challenges
If you encounter CAPTCHAs:
- Check that proxies are enabled.
- Allow up to 30 seconds for CAPTCHA solving to complete.
- For custom CAPTCHAs, double-check that your selectors are correctly defined.
By following these best practices and troubleshooting steps, you can improve automation reliability, minimize detection risks, and optimize performance with Browserbase.
Need help? Contact support@browserbase.com
Was this page helpful?