Skip to content
playwrightweb scrapingresidential proxies

Playwright Proxy Setup: The 6 Automation Markers You're Missing

Most stealth guides fix navigator.webdriver and stop. Playwright exposes 5 other automation markers that DataDome and Akamai check. Here's the complete init script with all 6 addressed.

Most Playwright stealth guides fix navigator.webdriver and call it done. In 2026, that addresses 1 of 6 automation markers that DataDome, Akamai, and Queue-it check. Fixing one while leaving five exposed gets you the same block rate as fixing none — because any single failed check is sufficient for detection.

The 6 Automation Markers Playwright Exposes

MarkerHeadless defaultReal Chrome valueDetection impact
navigator.webdrivertrueundefinedImmediate block on most targets
window.chromeMissing / {}{ runtime: {}, loadTimes: fn, ... }Checked by anti-bot systems that expect a Chrome object
navigator.pluginsEmpty array []2–5 plugin objectsChecked by DataDome, Queue-it
WebGL renderer"SwiftShader ANGLE"Real GPU (e.g. "Intel Iris Graphics 6100")Flags Queue-it cross-validation
navigator.languages[] or ["en"]["en-US", "en"]Checked by behavioral ML
permissions.query()Automation behaviorReal browser responseCloudflare checks this

A proxy does not hide these markers. The checks run in the page. Patch them before navigation, then judge the result on your own target. We do not publish a success rate for this script.

Basic Proxy Configuration

python
from playwright.sync_api import sync_playwright

# Rotating. A new browser connection can take a new address.
proxy_rotating = {
    'server': 'http://eu.proxylabs.app:8080',
    'username': 'your-username',
    'password': 'your-password'
}

# Sticky for 60 minutes. Order is country, region, city, -ttl-, -session-.
# 600, 1800, 3600 and 7200 are 10, 30, 60 and 120 minutes.
# The ttl is a lifetime from the start. Reusing the session id does not restart it.
proxy_sticky = {
    'server': 'http://eu.proxylabs.app:8080',
    'username': 'your-username-country-gb-ttl-3600-session-abc123',
    'password': 'your-password'
}

# United States city. Americas traffic uses us.proxylabs.app. Use the city slug from the dashboard.
proxy_geo = {
    'server': 'http://us.proxylabs.app:8080',
    'username': 'your-username-country-us-region-ny-city-newyork',
    'password': 'your-password'
}

The Complete Anti-Detection Init Script

This addresses all 6 markers. Run it via context.add_init_script() before any page navigation.

javascript
// All 6 Playwright automation markers — paste into add_init_script()
Object.defineProperty(navigator, 'webdriver', { get: () => undefined });

// window.chrome — missing in headless, present in real Chrome
window.chrome = {
  runtime: {},
  loadTimes: function() {},
  csi: function() {},
  app: {}
};

// navigator.plugins — empty array is an instant bot signal
Object.defineProperty(navigator, 'plugins', {
  get: () => [
    { name: 'PDF Viewer', filename: 'internal-pdf-viewer', description: 'Portable Document Format' },
    { name: 'Chrome PDF Viewer', filename: 'internal-pdf-viewer', description: 'Portable Document Format' },
    { name: 'Chromium PDF Viewer', filename: 'internal-pdf-viewer', description: 'Portable Document Format' },
  ],
});

// WebGL — SwiftShader is the headless GPU renderer, immediately detectable
(function() {
  const origGetContext = HTMLCanvasElement.prototype.getContext;
  HTMLCanvasElement.prototype.getContext = function(...args) {
    const ctx = origGetContext.apply(this, args);
    if (args[0] === 'webgl' || args[0] === 'experimental-webgl') {
      const origGetParam = ctx.getParameter.bind(ctx);
      ctx.getParameter = function(param) {
        if (param === 37445) return 'Intel Inc.';                        // UNMASKED_VENDOR_WEBGL
        if (param === 37446) return 'Intel(R) Iris(TM) Graphics 6100';  // UNMASKED_RENDERER_WEBGL
        return origGetParam(param);
      };
    }
    return ctx;
  };
})();

// navigator.languages — empty or ["en"] in headless
Object.defineProperty(navigator, 'languages', { get: () => ['en-US', 'en'] });

// permissions.query — real browser responds differently than automation
const origQuery = window.navigator.permissions.query;
window.navigator.permissions.query = (params) =>
  params.name === 'notifications'
    ? Promise.resolve({ state: Notification.permission })
    : origQuery(params);

Full Anti-Detection Browser Setup

python
from playwright.sync_api import sync_playwright

INIT_SCRIPT = """
Object.defineProperty(navigator, 'webdriver', { get: () => undefined });
window.chrome = { runtime: {}, loadTimes: function() {}, csi: function() {}, app: {} };
Object.defineProperty(navigator, 'plugins', {
  get: () => [
    { name: 'PDF Viewer', filename: 'internal-pdf-viewer' },
    { name: 'Chrome PDF Viewer', filename: 'internal-pdf-viewer' },
  ],
});
(function() {
  const orig = HTMLCanvasElement.prototype.getContext;
  HTMLCanvasElement.prototype.getContext = function(...a) {
    const ctx = orig.apply(this, a);
    if (a[0]==='webgl'||a[0]==='experimental-webgl') {
      const g = ctx.getParameter.bind(ctx);
      ctx.getParameter = p => p===37445?'Intel Inc.':p===37446?'Intel(R) Iris(TM) Graphics 6100':g(p);
    }
    return ctx;
  };
})();
Object.defineProperty(navigator, 'languages', { get: () => ['en-US', 'en'] });
"""

def proxy_settings(country=None, session_id=None, minutes=60):
    ttl = {10: 600, 30: 1800, 60: 3600, 120: 7200}[minutes]
    username = 'your-username'
    code = None
    if country:
        code = 'gb' if str(country).lower() == 'uk' else str(country).lower()
        username += f'-country-{code}'
    if session_id:
        username += f'-ttl-{ttl}-session-{session_id}'
    # us, ca, mx, br, ar, co, cl, pe → us.proxylabs.app. Every other code → eu.
    americas = {'us', 'ca', 'mx', 'br', 'ar', 'co', 'cl', 'pe'}
    host = 'us.proxylabs.app' if code in americas else 'eu.proxylabs.app'
    return {
        'server': f'http://{host}:8080',
        'username': username,
        'password': 'your-password',
    }


with sync_playwright() as p:
    browser = p.chromium.launch(
        headless=True,
        proxy=proxy_settings(country='us', session_id='abc123', minutes=60),
        args=['--disable-blink-features=AutomationControlled'],
    )
    context = browser.new_context(
        viewport={'width': 1920, 'height': 1080},
        user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
        locale='en-US',
        timezone_id='America/New_York',
    )
    context.add_init_script(INIT_SCRIPT)
    page = context.new_page()
    page.goto('https://example.com')
    browser.close()

Verifying the Setup

Before running at scale, confirm all 6 markers are correctly patched:

python
with sync_playwright() as p:
    browser = p.chromium.launch(headless=True, proxy=proxy_settings())
    context = browser.new_context()
    context.add_init_script(INIT_SCRIPT)
    page = context.new_page()
    page.goto('https://httpbin.org/ip')
    results = page.evaluate("""() => ({
        webdriver: navigator.webdriver,
        chrome: typeof window.chrome,
        pluginCount: navigator.plugins.length,
        languages: navigator.languages,
        webglVendor: (() => {
            const c = document.createElement('canvas');
            const g = c.getContext('webgl');
            const ext = g.getExtension('WEBGL_debug_renderer_info');
            return ext ? g.getParameter(ext.UNMASKED_VENDOR_WEBGL) : 'no ext';
        })()
    })""")
    print(results)
    browser.close()
# webdriver is undefined, chrome is an object, plugins and languages are set,
# and the WebGL vendor is the value the init script returns.

headless=True vs headless=False

For most scraping targets, headless=True with the full init script works. For Queue-it specifically, headless=True is still detectable via timing analysis of JS execution — headless Chromium runs certain JS operations measurably faster than headed Chromium. Queue-it's timing signals (Layer 7 of the detection stack) catch this.

For Queue-it and high-security ticketing: headless=False with a virtual display (Xvfb on Linux, or a headed session on a cloud VM with a display). For everything else: headless=True + the init script above is sufficient.

Useful guide? Share it with your team.

Share
← Back to all articlesBack to top ↑
All articles ↗
puppeteer

Puppeteer Proxy Setup: Headless Chrome with Rotating IPs

Configure Puppeteer with rotating residential proxies. Covers proxy authentication, page-level rotation, session persistence, and stealth plugins.

6 min read
selenium

Selenium Proxy Setup: Complete Guide for Python & Java

Configure rotating residential proxies in Selenium for Python and Java. Covers authentication, geo-targeting, session persistence, and anti-detection patterns.

6 min read
amazon

How to Scrape Amazon Prices in 2026 (Without Getting Blocked)

A working guide to scraping Amazon product prices with residential proxies. Covers their anti-bot stack, request patterns, and code examples in Python.

6 min read