All posts

Anti-association browser automation: Setup guide

Anti-association browser automation keeps sessions unlinked: give each workload its own browser context and one exit IP per flow. Learn the Playwright setup.

  • browser automation
  • playwright
  • puppeteer
  • session isolation
  • browser fingerprint
On this page

Anti-association browser automation means no two automated sessions share a signal a site can link: exit IP, fingerprint, cookies and storage, timing, or network layer. You get there by giving each workload its own browser context and one exit per flow, matching timezone and locale to that exit, and storing state yourself. Browserless’s anti-detection guide sets the limit: detection works by correlation, so nothing is guaranteed.

You run per-region QA, price monitoring, SERP checks and agent tasks in parallel with Playwright or Puppeteer. One job gets blocked, then the others fail too, because they share an exit IP, a cookie jar or a request rhythm.

The use cases here are QA, monitoring, research, agents and tests of your own multi-tenant product, not marketplace multi-store management. After reading, you can list the linking signals, isolate state in code, pick sticky or rotating exits, and decide whether you need any of this.

Key Takeaways

What is anti-association browser automation?

Anti-association browser automation keeps a site from linking separate automated sessions to one another. It applies to code-driven sessions, not to people hand-operating accounts.

Illustration for What is anti-association browser automation?

A site links two sessions when they share a value it can read. Browserless describes the failure this way: “Most blocks occur when identity, network, and behavior drift out of alignment over time, even if each individual request appears fine in isolation.” Five signals do the linking:

  1. Exit IP and geography. Sessions behind one exit IP form a group, so a block on one spreads to the rest. The site also compares the exit’s country with the browser’s timezone and locale, so a Paris exit paired with a Los Angeles timezone reads as a mismatch.
  2. Fingerprint. Browser-reported attributes such as screen size, fonts and languages stay stable, so the same values recur across sessions and group them. The navigator.userAgent string is no longer the whole picture: MDN says the User-Agent Client Hints API exposes “browser and platform information via User-Agent response and request headers, and a JavaScript API.”
  3. Cookies and storage. Set-Cookie attributes scope which requests carry a cookie, so a jar shared by two sessions sends identical cookies from both. Every session that reads that jar is linked to the others, and local storage behaves the same way.
  4. Timing and execution path. Identical step order, delays and click cadence across sessions form a pattern of their own. Castle’s bot-detection write-up lists “synthetic input patterns” among the traces bot detection commonly flags.
  5. Network and TLS layer. Handshake fingerprints can group clients, though a browser-driven session presents Chromium’s own handshake, so this signal mostly catches plain HTTP clients.

In anti-association browser automation, each session needs consistency inside itself and separation from every other session. A fingerprint that passes on page one is worth nothing if the cookie jar, local storage and exit IP change by page four.

How do you isolate browser state between automated sessions?

You isolate browser state between automated sessions by giving each workload its own browser context or browser instance, so no two sessions read the same cookie jar, storage or cache. Puppeteer’s BrowserContext reference says each context has “isolated storage (cookies/localStorage/etc.).”

In Playwright, two contexts in one browser can each load their own storageState file, so the two never share a jar.

import { chromium } from "playwright";

const browser = await chromium.launch();

const eu = await browser.newContext({ storageState: "state-eu.json" });
const us = await browser.newContext({ storageState: "state-us.json" });

const euPage = await eu.newPage();
const usPage = await us.newPage();

// ...run each flow, then save its state for the next run
await eu.storageState({ path: "state-eu.json" });
await us.storageState({ path: "state-us.json" });

The usual advice is to clear cookies when you switch accounts. A skipped or partial clear raises no error, so the second login arrives carrying the first one’s cookies. Separate contexts remove the step, because there is no shared jar to forget about.

A hosted browser applies the same rule at the instance level. Wayfern’s API reference says cookies and storage stay live while the socket is open.

To keep two flows apart, mint a separate link token for each and give each its own exit. A session id keeps one residential IP across a flow.

Read cookies and storage out with storageState() before you disconnect, and load them at the start of the next run. The guide to anti-detect browser sessions over CDP covers the connection details.

Should an automated session use a sticky or rotating exit IP?

In anti-association browser automation, a session holds one exit IP for a whole flow. Rotate exits only between independent jobs. Rotating constantly fits stateless page fetches, where nothing carries over from one request to the next. Keeping one IP fits a login or a cart.

The cookie is the reason. Wayfern’s anti-detect browser sessions page puts it this way: “A cookie issued to one IP and replayed from another is an easy signal for a site to read.”

The site sets the cookie in a response to one address. If the next request carrying it arrives from a different address, the site sees one session in two places. Any authenticated scraping job needs a sticky exit for that reason.

In anti-association browser automation, geography has to agree with itself too. A browser that reports a Chicago timezone and an en-US locale but exits in Germany contradicts its own signals.

On Wayfern, you set the exit with parameters on the /ws URL:

  • country, region and city pick a residential exit by location. isp narrows it to one provider.
  • session is a sticky id. Reuse the same value and you keep one residential IP across the flow.
  • With no location parameters, the exit is the default datacenter exit.
const browser = await chromium.connectOverCDP(
  "wss://api.wayfern.com/ws?token=LINK_TOKEN&country=DE&city=Berlin&session=cart-run-7",
);

Set the timezone and locale in your Playwright context to match the exit you chose. Locations are checked against a live catalog, and the same sessions page says “an unknown location is refused with close code 4007 instead of falling back to the wrong place.”

A typo in city therefore fails loudly and never exits from another country. If you already hold proxies, proxy=own|residential|none picks the proxy mode for each connection.

Which automation signals give away a Playwright or Puppeteer session?

A Playwright or Puppeteer session gives itself away through navigator.webdriver, headless markers, observable CDP calls and the traces JavaScript patches leave behind. Anti-association browser automation has to close these leaks first.

CriterionUnpatched Playwright or PuppeteerJavaScript patchingIdentity inside the browser build
Where the change livesNoneScript run in each pageThe browser binary
What a page can readnavigator.webdriver setOverridden gettersValues the browser reports itself
Stack-trace leaksNone addedPossibleNone from page scripts
Who maintains itNobodyYou, per Chromium releaseThe browser vendor

The MDN page for navigator.webdriver says the property “indicates whether the user agent is controlled by automation.” A page can read it with one line, so it is the first signal any script checks.

Headless mode is a second signal that anti-association browser automation has to handle. Chrome’s headless documentation says the old headless implementation now ships separately as chrome-headless-shell, while Puppeteer’s headless-modes guide describes the new headless mode as its default.

Castle’s write-up on anti-detect frameworks lists “headless browser markers” and “inconsistencies in JavaScript APIs” among the traces detection systems flag.

CDP itself can be observable. Castle describes a probe built on that: with Runtime enabled, serializing an Error object makes the client read its stack, and a page script can detect that read.

Attaching over CDP can therefore be visible even when no flag is set. Patching with evaluateOnNewDocument or Proxy wrappers has limits for a similar reason: the patch runs in the page’s own JavaScript world, and a wrapped function can show up in a stack trace.

TLS fingerprinting works differently for browser-driven sessions. A browser driven by Playwright or Puppeteer sends requests through Chromium’s own network stack, so its handshake is Chrome’s. Mismatches mainly hit non-browser HTTP clients, such as a Python script presenting a library’s handshake under a Chrome user agent.

FoxIO’s JA4 hashes a sorted extension list.

Best for:

  • Unpatched tools: internal testing where being identified as automation costs you nothing.
  • JavaScript patching: a short-lived script against a tolerant target.
  • Identity in the build: long-running flows where page-level leaks matter.

How do you set up anti-association browser automation with Playwright?

Setting up anti-association browser automation with Playwright takes six steps: one link token per workload, a sticky exit, a real window size, the default context, explicit handling of refused locations, and your own save and restore of state. Playwright’s connectOverCDP() documentation says: “The default browser context is accessible via browser.contexts().”

  1. Mint a link token per workload in your project’s Browser links, for example one for price monitoring and one for per-region QA.
  2. Connect with a location and a sticky session. Opening the socket starts the session.
  3. Set width and height on the URL. The real window is resized, so nothing is emulated and no script runs in your pages.
  4. Work in browser.contexts()[0] and skip newContext(), because the identity lives in the default context.
  5. Treat a refused location as a config error, since retrying the same code won’t help.
  6. Save and restore state yourself: call context.storageState() at the end of a run and load it at the start of the next.
import { chromium } from "playwright";
import fs from "node:fs";

const STATE = "state-us-ca.json";
const url = `wss://api.wayfern.com/ws?token=${process.env.LINK_TOKEN_QA}`
  + "&country=US&region=CA&session=run42&width=1366&height=768";

let browser;
try {
  browser = await chromium.connectOverCDP(url, { timeout: 120_000 });
} catch (err) {
  // An unknown country or region is refused (close code 4007), not
  // replaced with another exit. Fix the code; don't retry it.
  throw new Error(`Connect refused or failed: ${err.message}`);
}

const context = browser.contexts()[0];
if (fs.existsSync(STATE)) {
  const saved = JSON.parse(fs.readFileSync(STATE, "utf8"));
  await context.addCookies(saved.cookies);
}

const page = await context.newPage();
await page.goto("https://example.com/login");
// ... the flow ...

fs.writeFileSync(STATE, JSON.stringify(await context.storageState()));
await browser.close();

Playwright’s BrowserContext docs describe storageState() as returning a snapshot of “current cookies and local storage”. Replaying local storage means visiting each origin and writing the saved entries before the flow, which addCookies() alone doesn’t do.

Two tokens with session=run42 and session=run43 get separate residential exits, and reconnecting with run42 asks to keep the first exit across a flow. Puppeteer’s puppeteer.connect() takes the same URL as browserWSEndpoint.

The honest catch is persistence: the hosted browser keeps no named profiles for you, so saving and restoring state is your job.

If hand-managing identities is the job, the anti-detect sessions use case helps you decide whether a hosted browser fits.

Do you need anti-association browser automation tooling, and which kind?

You need anti-association browser automation when several workloads, tenants or regions run in parallel and must stay unlinked. The right kind of tooling depends on whether a person or your code runs the browsers.

CriterionDesktop profile managerProgrammable hosted browserNo tooling
Who drives itA person in an appYour code over CDPYour code, plain Playwright
Long-lived named profilesYesNo, save state in your own codeOnly what you write
Per-vector fingerprint switchesYesNoNo
Fits whenHand-managing many identitiesParallel workloads that must stay unlinkedOne low-volume workload

Desktop profile managers give each identity its own profile. MasBrowser’s anti-association page says its tool “separates cookies, local data, proxy settings, and browser fingerprint configurations by browser profile.”

Multilogin-style tools fit when hand-managing many identities is the job. The anti-detect browsers buyer’s guide covers that split in detail.

Wayfern is the second kind, and it has limits. Its own comparison with Multilogin says: “Wayfern has no customer-facing persistent profiles at all. No named profiles, no cookie import or export, no per-vector fingerprint switches.”

You probably do not need anti-association tooling when:

  • You fetch low-volume public pages from a single workload.
  • You follow robots.txt, which RFC 9309 specifies as a method “for service owners to control how content served by their services may be accessed.”
  • You follow the site’s terms.

You probably do need it when:

  • Several workloads, tenants or regions run in parallel and must stay unlinked.
  • One flow holds a login across many steps.
  • You test your own multi-tenant product.

No tool guarantees an outcome. MasBrowser’s page says “Outcomes still depend on platform rules, account behavior, network quality, and operating practices.”

We build for lawful use: public-data collection, per-region QA, price and SERP monitoring, research and agents. Fraud, account abuse and collection that ignores a site’s terms or the law are out of scope.

Frequently asked questions

Do I need anti-association for every scraper?

No. If you collect public pages at low volume from one workload and follow robots.txt and the site’s terms, one clean session is usually enough. You need anti-association measures when several workloads, tenants or regions run in parallel and must stay unlinked, or when a single flow holds a login. RFC 9309 defines the Robots Exclusion Protocol behind robots.txt.

Does Playwright use a different TLS fingerprint than Chrome?

No. Playwright and Puppeteer drive Chromium, which makes its own TLS handshake, so the fingerprint comes from the browser build. JA3, a method for fingerprinting SSL/TLS clients, and its successor JA4 matter mostly for plain HTTP clients that don’t run a browser.

Does Wayfern keep my cookies between runs?

No. Save cookies and storage in your own code before you disconnect, and restore them next run. A sticky session id holds one residential exit during a flow.

Can I use this for multi-account marketplace work?

Only where the marketplace’s own terms allow it. Per-region QA, price monitoring, research, agents and testing your own multi-tenant product are the intended uses. If a marketplace forbids multiple accounts, separating them technically makes it account abuse, and we don’t support that.

Next steps for anti-association browser automation

Start today by listing which of the five linking signals your current jobs share, then move each workload into its own browser context so no two jobs read the same cookie jar.

This week:

  • Add a sticky session id to every login flow, so one residential IP holds for the whole flow.
  • Match timezone and locale to the exit country.
  • Save storageState at the end of each run and restore it at the start.

Later, choose a profile manager if a person ends up hand-managing many identities, and a hosted browser if code operates them.

To start anti-association browser automation on a real flow, connect Playwright to a Wayfern link token with connectOverCDP() and run one flow.

Test anti-association browser automation on one flow before you scale.

Sources

Anti-Detection Techniques: 2026 Comprehensive Guide · JA3 - A method for profiling SSL/TLS clients · From Puppeteer stealth to Nodriver: How anti-detect… · Wayfern API reference · User-Agent Client Hints API - MDN · BrowserContext | Puppeteer · Anti-Detect Browser Sessions over CDP | Wayfern · MasBrowser anti-association. Every other source is linked where the article cites it.

See us more often in Google

One click marks Wayfern as a preferred source in Google, so our posts can show up more often in your Top Stories, AI Mode and AI Overviews.