Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk6 min

How to Use Playwright Stealth for Browser Automation

Register the stealth plugin before launching Playwright Chromium, or use the separate Python package. Learn what these tools can—and cannot—do for authorized testing.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For authorized testing of applications you own or have permission to assess, the usual Node.js setup is to register puppeteer-extra-plugin-stealth on the chromium export from playwright-extra before launching the browser. It attempts to reduce some common automation signals; it cannot guarantee that a browser will go undetected.

What “Playwright stealth” means

Playwright itself does not provide a stealth mode. In the commonly documented Node.js combination, playwright-extra wraps Playwright with a plugin interface, and puppeteer-extra-plugin-stealth supplies modifications intended to reduce certain browser automation signals. Registering the plugin changes the browser context in which your automated test runs; it does not make automation indistinguishable from a person.

As an Amazon Associate I earn from qualifying purchases.

The plugin maintainers describe detection as a cat-and-mouse problem and say, “It’s probably impossible to prevent all ways to detect headless chromium.” Historical test results mentioned in the project README are maintainer-reported, not an independent current benchmark or a promise for a particular site. Detector behavior can vary with the site, IP address, and prior activity. Plugin README and limitations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Node.js setup: register the plugin before launch

The sequence matters: call chromium.use(stealth) before chromium.launch(). This compact CommonJS example follows the package README. Replace the example URL with an application you are authorized to test.

Install

npm install playwright-extra puppeteer-extra-plugin-stealth

Install Playwright’s browser binaries if they are not already available in your environment:

npx playwright install chromium

Runnable CommonJS example

const { chromium } = require('playwright-extra')
const stealth = require('puppeteer-extra-plugin-stealth')()

chromium.use(stealth)

;(async () => {
  const browser = await chromium.launch({ headless: true })
  try {
    const page = await browser.newPage()
    await page.goto('https://example.com', { waitUntil: 'domcontentloaded' })
    console.log('Title:', await page.title())
  } finally {
    await browser.close()
  }
})().catch(error => {
  console.error(error)
  process.exitCode = 1
})

For ECMAScript modules, the package README documents importing chromium from playwright-extra and the default StealthPlugin from puppeteer-extra-plugin-stealth, then calling chromium.use(StealthPlugin()) before launch. Consult the playwright-extra README for the current package-specific usage and metadata; do not assume the CommonJS and ESM import forms are interchangeable in every project configuration.

Python is a separate package and API

Python users should not install the Node.js packages and expect the same interface. The separate PyPI package playwright-stealth documents an asynchronous wrapper around async_playwright() using Stealth().use_async(...). Its API is version-sensitive: the linked page documents version 2.0.0, while version 2.0.1 has also appeared in package search results. Check the installed version’s documentation before copying an example.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
from playwright.async_api import async_playwright
from playwright_stealth import Stealth

async def main():
    async with Stealth().use_async(async_playwright()) as p:
        browser = await p.chromium.launch()
        page = await browser.new_page()
        await page.goto("https://example.com")
        print(await page.title())
        await browser.close()

The package page explicitly cautions: “Don’t expect this to bypass anything but the simplest of bot detection methods.” Treat it as a way to adjust some signals in controlled tests, not as a bypass guarantee. playwright-stealth 2.0.0 on PyPI.

Choose browser mode for the test you need

“Chromium” can refer to different browser builds and modes in Playwright, and that choice affects reproducibility. Playwright documents that its default headless Chromium uses a Chromium headless shell. Branded Chrome and Edge channels use a newer headless implementation that is closer to headed mode. For regression tests intended to represent current publicly available browsers, Playwright recommends stable browser channels. These are different test configurations, not stealth guarantees. See Playwright’s browser documentation.

  • Use the default bundled browser when you want a repeatable test against Playwright’s installed Chromium build.
  • Use a branded channel when the test needs to cover Chrome or Edge as distributed to users; specify the channel and keep it consistent across runs.
  • Record headless or headed mode. A result observed in one mode does not establish behavior in the other.

How to evaluate behavior without overclaiming

  1. Use an owned or explicitly authorized target. Prefer a staging environment or a controlled test route over a third-party bot-check site.
  2. Define the expected application outcome. For example, record whether the page loaded, which application response appeared, and whether the test completed—not a broad label such as “undetectable.”
  3. Change one setting at a time. Compare the same test target and test procedure with the plugin enabled and disabled, while holding browser build, mode, and environment steady.
  4. Record the configuration. Include Playwright version, plugin version, browser and channel, headless or headed mode, operating environment, and exact test target.
  5. Repeat controlled runs where appropriate. A result is an observation for that target and configuration, not a claim about other detectors or websites.

Detection can rely on more than browser properties. A 2026 preprint reports a controlled benchmark in which behavioral signals—such as raw pointer-move and wheel-delta streams from physical input devices—were relevant, and an absence signature remained under the paper’s tested trajectory manipulations. That is evidence that behavioral signals can matter in the benchmark, not proof that every site or commercial detector uses them. 2026 preprint on behavioral detection of browser automation.

Troubleshooting

The plugin appears to have no effect

  • Confirm that chromium.use(stealth) runs before chromium.launch(); registering after launch cannot configure that already-running browser.
  • Check that the test launches the chromium export from playwright-extra, rather than a separate Playwright instance that never received the plugin.
  • Verify that the installed package versions and import style match your CommonJS or ESM project setup.
  • Do not infer failure or success solely from one external detector’s result; inspect your own application’s logs and the specific test behavior.

Runs differ between machines or CI jobs

  • Pin and record package versions and browser installation; record the browser channel and headless/headed mode too.
  • Keep the operating environment and test target consistent when comparing runs. Network conditions and IP address can affect site behavior independently of the plugin.
  • Use the same stable browser channel when the test’s purpose is to represent a current Chrome or Edge browser, as appropriate for your test matrix.

Python imports or examples fail

  • Confirm you installed playwright-stealth, not the similarly named Node.js packages.
  • Check the installed version’s PyPI documentation: the linked example is specifically for version 2.0.0, and the API may differ in later releases.
  • Ensure your code uses the documented asynchronous API consistently, including an asynchronous Playwright context and proper browser cleanup.

A bot check or CAPTCHA still appears

That outcome is possible: reducing common automation signals does not guarantee detection will stop, and some relevant signals may be outside the plugin’s scope. For an owned system, use application-specific diagnostics and a controlled test plan rather than trying to generalize from a detector score.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a website screenshot rather than browser automation, ScreenshotNeo offers a screenshot API and MCP server. A single GET request can return an image or PDF:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for the request options and response details. Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Frequently Asked Questions

Does Playwright Stealth work with Firefox or WebKit?

The documented Node.js combination is centered on Playwright’s Chromium export; the cited setup does not establish equivalent support for Firefox or WebKit.

Can a stealth plugin guarantee that a browser will not be detected?

No. The plugin maintainers and the Python package both explicitly describe limits, and results depend on the target and configuration.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.