openclaw - 💡(How to fix) Fix Support Patchright as a drop-in browser backend (stealth mode) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#52190Fetched 2026-04-08 01:14:29
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1

Fix Action

Fix / Workaround

Problem

OpenClaw's browser tool uses playwright-core internally, which gets detected and blocked by Cloudflare and other bot-detection systems. Users who need to browse protected sites (SumUp, OpenAI dashboard, banking, etc.) currently have to use custom scripts with Patchright or Camoufox outside the built-in browser tool.

Proposal

Add a config option to use Patchright (patchright-core) as a drop-in replacement for playwright-core. Patchright is a fork that patches automation detection signals out of the CDP protocol layer — same API surface, same Chromium binary, just undetectable.

Something like:

{
  browser: {
    backend: "patchright",  // "playwright" (default) | "patchright"
  }
}

Code Example

{
  browser: {
    backend: "patchright",  // "playwright" (default) | "patchright"
  }
}
RAW_BUFFERClick to expand / collapse

Feature Request

Problem

OpenClaw's browser tool uses playwright-core internally, which gets detected and blocked by Cloudflare and other bot-detection systems. Users who need to browse protected sites (SumUp, OpenAI dashboard, banking, etc.) currently have to use custom scripts with Patchright or Camoufox outside the built-in browser tool.

Proposal

Add a config option to use Patchright (patchright-core) as a drop-in replacement for playwright-core. Patchright is a fork that patches automation detection signals out of the CDP protocol layer — same API surface, same Chromium binary, just undetectable.

Something like:

{
  browser: {
    backend: "patchright",  // "playwright" (default) | "patchright"
  }
}

Why this works cleanly

  • patchright-core exports are identical to playwright-core (chromium, devices, selectors, errors, etc.)
  • Both currently ship version 1.58.2
  • Same Chromium binary — the stealth is in the Node library, not the browser executable
  • It's literally import { chromium } from "patchright-core" instead of import { chromium } from "playwright-core"

Current workarounds

  • Custom Node scripts using Patchright + Xvfb (works but outside the browser tool)
  • Camoufox skill (Firefox-based, different engine)
  • Symlink hack replacing playwright-core in node_modules (breaks on updates)

Environment

  • OpenClaw on Linux VPS (Hetzner)
  • Xvfb on :99 for headless display
  • Patchright 1.58.2 already installed alongside OpenClaw

extent analysis

Fix Plan

To add a config option for using Patchright as a drop-in replacement for playwright-core, follow these steps:

  • Update the configuration to include a browser.backend option:
{
  "browser": {
    "backend": "patchright" // or "playwright" for default
  }
}
  • Modify the import statement in your browser tool code to use the selected backend:
const config = require('./config.json');
const backend = config.browser.backend;

let chromium;
if (backend === 'playwright') {
  const { chromium: pwChromium } = require('playwright-core');
  chromium = pwChromium;
} else if (backend === 'patchright') {
  const { chromium: prChromium } = require('patchright-core');
  chromium = prChromium;
} else {
  throw new Error(`Invalid browser backend: ${backend}`);
}
  • Use the chromium variable to launch the browser:
const browser = await chromium.launch({
  headless: true,
  args: ['--display=:99'],
});

Verification

To verify that the fix worked, launch the browser tool with the patchright backend and test browsing on a site that previously blocked playwright-core.

Extra Tips

  • Ensure that patchright-core is installed alongside OpenClaw by running npm install patchright-core or yarn add patchright-core.
  • Keep the versions of playwright-core and patchright-core in sync to avoid compatibility issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING