Scrapeless Wiki

What Is playwright-stealth? – Definition and How It Works

Informational P2 what is playwright stealth
Overlaps a live page. A published page already targets this keyword: https://www.scrapeless.com/en/blog/playwright-stealth. Publishing both risks cannibalisation β€” decide before this goes live.

Learn what playwright-stealth patches, why in-page property rewriting has a ceiling, and when a patched build or driver is the better choice.

playwright-stealth is a port of the Puppeteer stealth plugin to Playwright. It injects scripts into every page before the site's own code runs, rewriting the properties that most obviously mark an automated browser.

1. What It Patches

The evasions cover the well-known automation tells: navigator.webdriver, an empty or implausible plugins and mimeTypes list, missing language values, window.chrome absence, permission query results that disagree with the notification state, and WebGL vendor and renderer strings that report a software renderer.

Each is small. Collectively they move a browser from obviously automated to superficially ordinary, which is enough for sites whose checks stop at reading a handful of properties.

2. Why the Approach Has a Ceiling

Rewriting a property in the page leaves the rewrite visible.

A native property and a redefined one differ in ways a script can inspect: the function's toString() output, its property descriptor, its position on the prototype chain, and whether it was defined before or after other page state. Detection code that examines how a value was produced rather than what it is will see the patch.

There is a second, harder limit. Some evidence is not a property at all. When an automation library enables the CDP Runtime domain, page behaviour changes in ways no injected script can undo, because there is nothing to redefine. A stealth plugin cannot reach that class of tell by construction.

3. Where It Still Makes Sense

The practical case for a stealth plugin is cost. It is a dependency and two lines of setup, it works with an existing Playwright suite, and against light detection it is sufficient.

from playwright.sync_api import sync_playwright
from playwright_stealth import stealth_sync

with sync_playwright() as p:
    page = p.chromium.launch(headless=True).new_page()
    stealth_sync(page)
    page.goto("https://example.com")

Reach for it first, measure against your targets, and escalate only if the measurement says to.

4. What to Escalate To

If a plugin is not enough, the next steps address the classes it cannot:

  • A patched driver (Patchright, Rebrowser) removes library evidence such as the Runtime domain behaviour.
  • A patched browser build (Camoufox and similar) produces fingerprint values natively rather than rewriting them.
  • Egress and pacing address what neither touches: IP reputation, request rate, and navigation pattern.

5. Summary

playwright-stealth injects in-page patches for the common automation tells. It is cheap, quick to adopt, and adequate against light checks, but its method is visible to anything inspecting how a property was defined, and it cannot address library-level evidence at all. Treat it as the first rung, not the destination.