Skip to main content
rebrowser-playwright and rebrowser-puppeteer are Playwright and Puppeteer with rebrowser-patches applied, which close the automation leaks anti-bot scripts look for in the plain libraries. The API is the same; only the package and the import change. Both connect to a Surfsky browser over the session’s CDP WebSocket URL, like Playwright. Patchright is the other maintained fork. To have a coding agent set this up in your project, give it the setup prompt.
Use human-emulation commands for clicks, typing, and scrolling. Keep rebrowser-playwright for navigation, selectors, waiting, and page content.

Prerequisites

Set your API token and base URL. The browser runs in Surfsky’s cloud, so skip the fork’s browser download step. Proxy, fingerprint, and other start options are in the API reference.

Run an example

The examples use a one-time profile. To reuse a saved login, pass a persistent profile UUID to the session call instead.
Requires Python 3.12 or newer.
Save as surfsky_rebrowser.py:
Run it:
Expected output:
The session scope stops the browser when it exits, including on errors. browser.close() over CDP only disconnects.

rebrowser-puppeteer

For Puppeteer code, the same patches ship as rebrowser-puppeteer-core:
Save as surfsky-rebrowser-puppeteer.mts:
Run it with node surfsky-rebrowser-puppeteer.mts. defaultViewport: null keeps the window size from the profile’s fingerprint.