- Plan — open an issue or discuss the change before writing code
- Code — implement on a feature branch
- Test — all existing tests must pass, add tests for new functionality
- Review — check for bugs, concurrency issues, and memory efficiency
- PR — create a pull request against
main
git clone https://github.com/status403com/patchright-go.git
cd patchright-go
go build ./...
go run ./cmd/patchright install chromium# Unit tests only
go test -short ./...
# Full suite including integration tests (requires installed browser)
go test ./... -timeout 120s
# With race detector
go test -race ./...- Follow standard Go conventions (
gofmt,go vet) - Keep functions under 50 lines, files under 800 lines
- Handle all errors explicitly
- Use
sync.Once,atomic.Bool, or mutexes for shared state — never bare bools - Prefer immutable patterns where possible
- Bug fixes with test cases
- Performance improvements (especially for high-throughput scenarios)
- Anti-detection improvements
- Documentation updates
- New examples
generated-*.gofiles are auto-generated from the Playwright protocol — modify the generator, not the output (except for Patchright-specific additions clearly marked with comments)- Don't add Firefox or WebKit support — Patchright is Chromium-only
- Update
patchrightCliVersioninrun.go - Check if
nodeVersionneeds updating - Run
scripts/generate-api.shif the protocol changed - Run all tests
- Test
NewStealthPageagainst a protected site
By contributing, you agree that your contributions will be licensed under Apache-2.0.