Overview

Stealth mode provides developers with a robust suite of tools aimed at facilitating web automation while minimizing the chances of detection by sophisticated anti-bot technologies.

By employing proxies, residential IPs, and fingerprinting techniques, developers can simulate authentic user interactions across multiple sessions and IPs.

This mode is useful for tasks that involve data scraping, automated testing, and content aggregation in environments with strict bot detection mechanisms.

The integrated captcha-solving feature ensures navigation when faced with security challenges. Stealth mode supports a secure and efficient way to manage and execute automated tasks on a wide range of websites.

Browserbase’s custom-built Chromium Browser comes with a set of features enabling you to navigate in Stealth mode.

Features

Proxies & Residential IPs

Each Session gets a new Residential IP. Proxies can be enabled as follows with the enableProxy=true param:

import { chromium } from "playwright-core";

(async () => {
  const browser = await chromium.connectOverCDP(
    `wss://connect.browserbase.com?apiKey=${process.env.BROWSERBASE_API_KEY}&enableProxy=true`,
  );

  // Getting the default context to ensure the sessions are recorded.
  const defaultContext = browser.contexts()[0];
  const page = defaultContext.pages()[0];

  await page.goto("https://browserbase.com/");
  await page.close();
  await browser.close();
})().catch((error) => console.error(error.message));

Fingerprinting

The fingerprint mechanism handles the viewport, user agents, and headers and can be configured when creating a new Session through the API with the fingerprint field:

import { chromium } from "playwright-core";

async function createSession() {
  const response = await fetch(`https://www.browserbase.com/v1/sessions`, {
    method: "POST",
    headers: {
      "x-bb-api-key": `${process.env.BROWSERBASE_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      projectId: process.env.BROWSERBASE_PROJECT_ID,
      browserSettings: {
        // Fingerprint options
        fingerprint: {
          devices: ["mobile"],
          locales: ["en-US"],
          operatingSystems: ["android"],
        },
      },
    }),
  });
  const json = await response.json();
  return json;
}

(async () => {
  const { id } = await createSession();
  const browser = await chromium.connectOverCDP(
    // we connect to a Session created via the API
    `wss://connect.browserbase.com?apiKey=${process.env.BROWSERBASE_API_KEY}&sessionId=${id}`,
  );
  const defaultContext = browser.contexts()[0];
  const page = defaultContext.pages()[0];

  await page.goto("https://www.browserbase.com");

  await page.close();
  await browser.close();
})().catch(console.error);

The fingerprint options are available on the Sessions API endpoint.

When setting operatingSystems to ios or android, ensure the devices array includes "mobile".

When setting operatingSystems to linux, macos, or windows, ensure the devices array includes "desktop".

Available options for operatingSystems: android, ios, linux, macos, windows

Captcha solving

Captchas get automatically detected and solved.

You can detect if a captcha is being solved by listening to the browserbase-solving-started and browserbase-solving-finished events in the console.log of the page;

const google = await page.goto("https://www.google.com/recaptcha/api2/demo");

page.on('console', msg => {
  if (msg.text() == "browserbase-solving-started") {
    console.log("Captcha Solving In Progress");
  } else if (msg.text() == "browserbase-solving-finished") {
    console.log("Captcha Solving Completed");
  }
});

Captcha solving can take up to 30 seconds. Please note, this feature is currently in beta; if you have any feedback, please reach out.

Limitations

We bundle proxies into the browser so you don’t have to. This means that bringing your own proxy vendor is not supported at this time.

Additionally, some high-risk categories are restricted by our proxy vendors and cannot be proxied; this includes:

  • All Apple domains, including iTunes and App stores
  • Entertainment (e.g., Netflix, Playstation)
  • Banking and other financial institutions
  • Some Google domains
  • Streaming
  • Ticketing
  • LinkedIn
  • Mailing