🚀 playwright-community/playwright-go - Release Notes

v0.5001.0 (2025-02-13)

## What's Changed
* chore: roll to playwright v1.50.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/529


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4902.0...v0.5001.0

v0.4902.0 (2025-01-24)

## What's Changed
* feat: add only-shell option to run options for install chromium headless by @carsonmeyer-wk in https://github.com/playwright-community/playwright-go/pull/518


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4901.0...v0.4902.0

v0.4901.0 (2024-12-10)

## What's Changed
* chore: update jekyll and ruby to solve security alerts by @canstand in https://github.com/playwright-community/playwright-go/pull/506
* chore: roll to Playwright v1.49.0 by @canstand in https://github.com/playwright-community/playwright-go/pull/513
* feat: Add logger override option, use `slog` and capture driver as logs by @GuyGoldenberg in https://github.com/playwright-community/playwright-go/pull/497
* chore: roll to Playwright v1.49.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/515


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4802.0...v0.4901.0

v0.4802.0 (2024-11-12)

## What's Changed
* chore: require go v1.22 by @canstand in https://github.com/playwright-community/playwright-go/pull/489
* fix: Panics caused by BoundingBox API returning nil by @GuyGoldenberg in https://github.com/playwright-community/playwright-go/pull/498
* chore: roll to Playwright v1.48.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/500
* feat: add WebSocket routing by @canstand in https://github.com/playwright-community/playwright-go/pull/503
* feat: remove hardcoded subdirectories to RunOptions.DriverDirectory by @canstand in https://github.com/playwright-community/playwright-go/pull/501

## BREAKING CHANGE
* When specifying the playwright driver directory via `RunOptions.DriverDirectory` or the `PLAYWRIGHT_DRIVER_PATH` environment variable, you need to point directly to the directory of the corresponding version. The previously hard-coded `ms-playwright-go/x.xx.x` subdirectory is now only applies to the default cache directory. (close https://github.com/playwright-community/playwright-go/issues/496)
* require go v1.22

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4702.0...v0.4802.0

v0.4702.0 (2024-09-23)

## What's Changed
* chore: roll to Playwright v1.47.2 by @canstand in https://github.com/playwright-community/playwright-go/pull/488


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4701.0...v0.4702.0

v0.4701.0 (2024-09-19)

## What's Changed
* chore: roll to Playwright v1.47.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/487
* feat: use `PLAYWRIGHT_DRIVER_PATH` environment variable as driver cache directory by @GuyGoldenberg in https://github.com/playwright-community/playwright-go/pull/485

## New Contributors
* @GuyGoldenberg made their first contribution in https://github.com/playwright-community/playwright-go/pull/485

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4700.0...v0.4701.0

v0.4700.0 (2024-09-07)

## What's Changed
* chore: roll to Playwright v1.47.0 by @canstand in https://github.com/playwright-community/playwright-go/pull/480

## What's New
Playwright now allows to supply client-side certificates, so that server can verify them, as specified by TLS Client Authentication.
See [`tests/browser_context_client_certificates_test.go`](https://github.com/playwright-community/playwright-go/blob/main/tests/browser_context_client_certificates_test.go)


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4501.1...v0.4700.0

v0.4501.1 (2024-07-16)

## What's Changed
* fix: data races in some situations by @canstand in https://github.com/playwright-community/playwright-go/pull/476


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4501.0...v0.4501.1

v0.4501.0 (2024-07-10)

## What's Changed
* chore: roll to Playwright v1.45.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/472
* fix: harOpen error if no har in zip file by @canstand in https://github.com/playwright-community/playwright-go/pull/473
* chore: simplify bindingCall error stack and refac some tests by @canstand in https://github.com/playwright-community/playwright-go/pull/474

## What's New
- Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04.
- Follow upstream to support the new Clock API. See [the clock guide](https://playwright.dev/docs/clock) for reference.
- `Locator.SetInputFiles()` now supports uploading a directory for `` elements.
- For other miscellaneous changes, see the [upstream project release notes](https://github.com/microsoft/playwright/releases/tag/v1.45.0)

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4401.1...v0.4501.0

v0.4401.1 (2024-06-18)

## What's Changed
* Use PLAYWRIGHT_NODEJS_PATH in `getNodeExecutable` by @carsonmeyer-wk in https://github.com/playwright-community/playwright-go/pull/468

## New Contributors
* @carsonmeyer-wk made their first contribution in https://github.com/playwright-community/playwright-go/pull/468

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4401.0...v0.4401.1

v0.4401.0 (2024-06-08)

## What's Changed
* chore: roll to Playwright v1.44.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/465


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4400.1...v0.4401.0

v0.4400.1 (2024-06-08)

## What's Changed
* fix: rename ISSUE_TEMPLATE files by @walkersumida in https://github.com/playwright-community/playwright-go/pull/463

## New Contributors
* @walkersumida made their first contribution in https://github.com/playwright-community/playwright-go/pull/463

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4400.0...v0.4400.1

v0.4400.0 (2024-06-07)

## What's Changed
* fix: comments and behavior inconsistent by @canstand in https://github.com/playwright-community/playwright-go/pull/446
* test: check secure cookies (close #430) by @canstand in https://github.com/playwright-community/playwright-go/pull/447
* chore: roll to Playwright v1.43.0 by @canstand in https://github.com/playwright-community/playwright-go/pull/449
* chore: roll to Playwright v1.44.0 by @canstand in https://github.com/playwright-community/playwright-go/pull/454


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4201.1...v0.4400.0

v0.4201.1 (2024-03-21)

## What's Changed
* refactor(test): helper_test.go as a useful example by @canstand in https://github.com/playwright-community/playwright-go/pull/410
* feat: RunOptions can specifying output/error streams (close #226) by @canstand in https://github.com/playwright-community/playwright-go/pull/426
* docs: add Dockerfile example by @canstand in https://github.com/playwright-community/playwright-go/pull/424
* refac(test): cleanup and add `AssertToBeGolden` for **visual comparison** by @canstand in https://github.com/playwright-community/playwright-go/pull/429
* fix: correctly handle failed navigation by @canstand in https://github.com/playwright-community/playwright-go/pull/428


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4201.0...v0.4201.1

v0.4201.0 (2024-03-04)

## What's Changed
* chore: roll to playwright v1.42.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/423

New method [page.AddLocatorHandler()](https://playwright.dev/docs/api/class-page#page-add-locator-handler) registers a callback that will be invoked when specified element becomes visible and may block Playwright actions. The callback can get rid of the overlay.

## Announcements
* ⚠️ Ubuntu 18 is not supported anymore (by [upstream](https://github.com/microsoft/playwright/releases/tag/v1.42.0)).


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4102.0...v0.4201.0

v0.4102.0 (2024-02-29)

## What's Changed
* feat: StorageState can convert to OptionalStorageState (close #414) by @canstand in https://github.com/playwright-community/playwright-go/pull/418
* fix: correct download url for beta driver (close #421) by @canstand in https://github.com/playwright-community/playwright-go/pull/422


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4101.1...v0.4102.0

v0.4101.1 (2024-01-29)

## What's Changed
* fix: Evaluate args not serialized correctly by @canstand and @reginaldl  in https://github.com/playwright-community/playwright-go/pull/412


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4101.0...v0.4101.1

v0.4101.0 (2024-01-24)

## What's Changed
* Refactor using the new stdlib and generics, and add several tests by @canstand in https://github.com/playwright-community/playwright-go/pull/404
* Roll to Playwright v1.41.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/407
  * New method `Page.UnrouteAll()` removes all routes registered by `Page.Route()` and `Page.RouteFromHAR()`. Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
  * New method `BrowserContext.UnrouteAll()` removes all routes registered by `BrowserContext.Route()` and `BrowserContext.RouteFromHAR()`. Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
  * New option style in `Page.Screenshot()` and `Locator.Screenshot()` to add custom CSS to the page before taking a screenshot.
* chore: use golangci-lint and gofumpt by @canstand in https://github.com/playwright-community/playwright-go/pull/408


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.4001.0...v0.4101.0

v0.4001.0 (2023-12-19)

## What's Changed
* chore: roll to Playwright  v1.40.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/394
  * `SetInputFiles` now supports both file paths and InputFile objects, files can be one of: string, []string, InputFile, []InputFile
* refactor(transport): handle transport error, no more log.Fatal by @canstand in https://github.com/playwright-community/playwright-go/pull/395

## BREAKING CHANGE
- `ErrPlaywright` wraps all Playwright errors
- `ErrTimeout` wraps all timeout errors and replaces `TimeoutError`

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.3900.1...v0.4000.0

v0.3900.1 (2023-11-04)

## What's Changed
* chore: support download driver from mirrors by @canstand in https://github.com/playwright-community/playwright-go/pull/387
* fix: prevent misuse of transformOptions (fix #388)  by @canstand in https://github.com/playwright-community/playwright-go/pull/389


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.3900.0...v0.3900.1

v0.3900.0 (2023-10-31)

## What's Changed
* chore: roll to Playwright v1.39.0 by @canstand in https://github.com/playwright-community/playwright-go/pull/381
* fix: selector option.HasNotText by @hongcha98 in https://github.com/playwright-community/playwright-go/pull/382
* feat: env PLAYWRIGHT_DOWNLOAD_HOST also used to download driver by @canstand in https://github.com/playwright-community/playwright-go/pull/384


**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.3800.1...v0.3900.0

v0.3800.1 (2023-10-26)

## What's Changed
* fix: panic when screenshot with locator mask by @canstand in https://github.com/playwright-community/playwright-go/pull/380
* feat: hide process window under Windows by @hongcha98 in https://github.com/playwright-community/playwright-go/pull/377

## New Contributors
* @hongcha98 made their first contribution in https://github.com/playwright-community/playwright-go/pull/377

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.3800.0...v0.3800.1

v0.3800.0 (2023-10-12)

## What's Changed
* Roll to Playwright v1.38.1 by @canstand in https://github.com/playwright-community/playwright-go/pull/373
* Add `PlaywrightDriver.Uninstall` for users who cannot use cli params

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.3700.0...v0.3800.0

v0.3700.0 (2023-08-30)

This version is on pair driver-wise with the Playwright 1.37 version.

## BREAKING CHANGE: 
Due to the rewrite of the go code generation scripts, it brings a lot of changes. 
Note the following 4 types:

1. Links and **Deprecated** tags in Go doc comments now work.
   - May cause many **Deprecated** lint errors, please update the call or use `//nolint:staticcheck` to ignore.
1. Added event interface methods. For example `WebSocket.OnFrameReceived()` etc. 
    ```go
    // before
    websocket.On("framereceived", ...)
    // after
    websocket.OnFrameReceived(...)
    ```
1. The signatures of some interface methods have changed, for example:
   - Unified optional parameter naming. For example, previously all `Click` used `PageClickOptions`, now
      ```go
      Locator.Click(options ...LocatorClickOptions)
      Page.Click(selector string, options ...PageClickOptions)
      Frame.Click(selector string, options ...FrameClickOptions)
      ```
   - Some parameters are generated as new types or names, e.g. `Page.AddInitScript(script Script)`
1. Removed several methods that were not documented upstream. These methods can be safely converted to other existing methods.  For example
   - `Page.ExpectedDialog` can use `Page.OnDialog` instead.
   - All `xxxAssertions.NotTo...`, use `.Not().xxx` pls.
   - `WebSocket.On("framesent", ...)`, use `WebSocket.OnFrameSent(...)`.

## New Contributors
* @Sacrond made their first contribution in https://github.com/playwright-community/playwright-go/pull/361

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.3500.0...v0.3700.0

v0.3500.0 (2023-06-29)

This version is on pair driver-wise with the Playwright 1.35 version.

The release would not have been possible without @canstand, thanks a ton to him! 💯 

### Breaking change:

Locators now return no error anymore.

```go
// before
l, err := page.Locator("body")
assertNil(t, err)
d, err := l.Locator("div")
assertNil(t, err)
// ...

// after
_, err := page.Locator("body").Locator("div").And("p").TextContent()
assertNil(t, err)
```

v0.2000.1 (2022-04-27)

## What's Changed
* feat: add locator functionality (#238) by @masaushi in https://github.com/playwright-community/playwright-go/pull/267
* chore: add support for noViewport by @mxschmitt in https://github.com/playwright-community/playwright-go/pull/258
* chore: rework parallel crawling example by @mxschmitt in https://github.com/playwright-community/playwright-go/pull/261
* Add platform "mac-arm64" and "linux-arm64" by @zengxs in https://github.com/playwright-community/playwright-go/pull/264
* chore: add IgnoreDefaultArgs by @zengxs in https://github.com/playwright-community/playwright-go/pull/265
* chore: fix flaky network tests by @mxschmitt in https://github.com/playwright-community/playwright-go/pull/260

## New Contributors / Special thanks

* @zengxs made their first contribution in https://github.com/playwright-community/playwright-go/pull/264
* @masaushi made their first contribution in https://github.com/playwright-community/playwright-go/pull/267

Thank you to both of you who invested time and effort into the project! 💯 

**Full Changelog**: https://github.com/playwright-community/playwright-go/compare/v0.2000.0...v0.2000.1

v0.2000.0 (2022-03-12)

This version is on pair drive-wise with the upcoming Playwright 1.20 version.

### Breaking change:

You need to either install the driver+browsers via CLI or via the API. It does not happen automatically anymore.

Via the CLI:

```bash
go run github.com/playwright-community/playwright-go/cmd/playwright install
# Or
go install github.com/playwright-community/playwright-go/cmd/playwright
playwright install --with-deps
```

Or via the API: 

```go
err := playwright.Install()
```

Version 0.1400.0 (2021-08-27)

This version is on pair with version 1.14 of Playwright.

(The previous release was no Godoc compliant and the proxy did not pick it up)

Version 0.1400 (2021-08-26)

This version is on pair with version 1.14 of Playwright.

Version 0.1100.0 (2021-03-28)

- feat(install): allow to install and skip certain browser (#113)
- docs: update link to Playwright API (#114)
- fix(ElementHandle): don't panic when QuerySelector not exists (#112)