Skip to content

Releases: status403com/patchright-go

v0.2.0

Choose a tag to compare

@desperatee desperatee released this 08 Jul 00:32

patchright-go v0.2.0

What's new

Configurable driver version

You can now pin a specific patchright driver version via RunOptions.Version instead of always using the library's built-in default:

pw, err := patchright.Run(&patchright.RunOptions{
    Version: "1.60.0",
})

When Version is not set, the built-in default is used (current behavior, unchanged).

Credits

v0.1.0

Choose a tag to compare

@desperatee desperatee released this 02 Jul 01:30

patchright-go v0.1.0

Idempotent setup, configurable paths, and documentation improvements.

What's new

Idempotent Run()

Run() now auto-installs the driver and browsers if they're missing — no separate install step required. Calling Run() multiple times is safe; it only downloads what's needed.

BrowsersPath option

New BrowsersPath field on RunOptions lets you control where browsers are downloaded without setting env vars:

pw, err := patchright.Run(&patchright.RunOptions{
    BrowsersPath: patchright.String("/custom/browsers"),
})

CWD-local driver default

The default driver directory changed from the system cache to <cwd>/bin/patchright-driver, keeping project dependencies self-contained.

Use your own Chrome

You can point to an existing Chrome installation instead of downloading one:

browser, err := pw.Chromium.Launch(patchright.BrowserTypeLaunchOptions{
    ExecutablePath: patchright.String("/usr/bin/google-chrome"),
    Headless:       patchright.Bool(false),
})

Other changes

  • Added comprehensive feature tests and wired into CI
  • Added CONTRIBUTING.md, issue templates, and PR template
  • Improved README with architecture overview, memory benchmarks, and troubleshooting guide
  • Added unofficial community port disclaimer

Credits

v0.0.1: initial release

Choose a tag to compare

@desperatee desperatee released this 01 Jul 00:15

patchright-go v0.0.1

Port of playwright-go v0.6100.0 made to work with the Patchright driver. Thin Go client wrapping the Node.js Patchright server over stdio pipes. Early version — has not been tested in a production environment yet.

Based on playwright-go v0.6100.0 (which bundles Playwright v1.61.1), tracking Patchright v1.61.1.

Features

  • All evaluate methods use isolatedContext by default (avoids Runtime.enable CDP leak)
  • Init script injection via patchrightInitScript route interception
  • NewStealthPage / NewStealthContext: automatic HeadlessChrome → Chrome UA patching
  • PatchHeadlessUA() helper for manual UA transformation
  • Per-browser UA cache (sync.Once, no global contention at scale)
  • All config via RunOptions struct fields (env vars optional)
  • Concurrency-safe for 50+ simultaneous browser instances

Anti-detection

Patchright patches the Playwright driver to evade bot detection:

  • navigator.webdriver returns false
  • No Runtime.enable or Console.enable CDP leaks
  • --disable-blink-features=AutomationControlled flag applied
  • Closed Shadow DOM support

Important: Prefer headful mode (Headless: false) over headless. Anti-bot solutions like PerimeterX can still detect headless browsers via deep fingerprinting even with Patchright patches.

Quick start

import patchright "github.com/status403com/patchright-go"

pw, _ := patchright.Run()
defer pw.Stop()

browser, _ := pw.Chromium.Launch(patchright.BrowserTypeLaunchOptions{
    Headless: patchright.Bool(false),
})
defer browser.Close()

page, _ := browser.NewStealthPage()
page.Goto("https://example.com")

Credits