Skip to content

Commit be31d8b

Browse files
committed
chore: roll to 1.62.0-alpha-2026-07-22
Port upstream changes: - microsoft/playwright#41712 - timeout is now a protocol-level metadata field - microsoft/playwright#41380 - Locator.waitForFunction() - microsoft/playwright#41800 - APIResponse.timing() - microsoft/playwright#41433 - scroll option to opt out of autoscroll - microsoft/playwright#41152 - webp screenshot format - microsoft/playwright#41294 - routeFromHAR interceptAPIRequests option - microsoft/playwright#41898 - acknowledge screencast frames after callbacks - microsoft/playwright#41215 - webauthn credentials in storageState (generated) - microsoft/playwright#41518 - driver publishing removed upstream; download script now falls back to the latest Node.js LTS
1 parent 32cf6cd commit be31d8b

31 files changed

Lines changed: 1060 additions & 54 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom
1010

1111
| | Linux | macOS | Windows |
1212
| :--- | :---: | :---: | :---: |
13-
| Chromium <!-- GEN:chromium-version -->149.0.7827.55<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
13+
| Chromium <!-- GEN:chromium-version -->151.0.7922.34<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1414
| WebKit <!-- GEN:webkit-version -->26.5<!-- GEN:stop --> ||||
15-
| Firefox <!-- GEN:firefox-version -->151.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
15+
| Firefox <!-- GEN:firefox-version -->152.0.4<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1616

1717
## Documentation
1818

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<name>Playwright Client Examples</name>
1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<playwright.version>1.61.0</playwright.version>
13+
<playwright.version>1.62.0</playwright.version>
1414
</properties>
1515
<dependencies>
1616
<dependency>

playwright/src/main/java/com/microsoft/playwright/APIResponse.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ public interface APIResponse {
8787
* @since v1.16
8888
*/
8989
String text();
90+
/**
91+
* Returns resource timing information for given response. For redirected requests, returns the information for the last
92+
* request in the redirect chain. When the response is served <a
93+
* href="https://playwright.dev/java/docs/mock#replaying-from-har">from the HAR file</a>, timing information is not
94+
* available and all the values are -1. Find more information at <a
95+
* href="https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming">Resource Timing API</a>.
96+
*
97+
* @since v1.62
98+
*/
99+
Timing timing();
90100
/**
91101
* Contains the URL of the response.
92102
*

playwright/src/main/java/com/microsoft/playwright/BrowserContext.java

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,13 @@ public RouteOptions setTimes(int times) {
363363
}
364364
}
365365
class RouteFromHAROptions {
366+
/**
367+
* If set to {@code true}, requests made via {@code APIRequestContext} (such as {@link
368+
* com.microsoft.playwright.BrowserContext#request BrowserContext.request()} or {@link
369+
* com.microsoft.playwright.Page#request Page.request()}) are also served from the HAR file. By default these requests are
370+
* sent to the network, matching the behavior prior to v1.62. Defaults to {@code false} for backward compatibility.
371+
*/
372+
public Boolean interceptAPIRequests;
366373
/**
367374
* <ul>
368375
* <li> If set to 'abort' any request not found in the HAR file will be aborted.</li>
@@ -394,6 +401,16 @@ class RouteFromHAROptions {
394401
*/
395402
public Object url;
396403

404+
/**
405+
* If set to {@code true}, requests made via {@code APIRequestContext} (such as {@link
406+
* com.microsoft.playwright.BrowserContext#request BrowserContext.request()} or {@link
407+
* com.microsoft.playwright.Page#request Page.request()}) are also served from the HAR file. By default these requests are
408+
* sent to the network, matching the behavior prior to v1.62. Defaults to {@code false} for backward compatibility.
409+
*/
410+
public RouteFromHAROptions setInterceptAPIRequests(boolean interceptAPIRequests) {
411+
this.interceptAPIRequests = interceptAPIRequests;
412+
return this;
413+
}
397414
/**
398415
* <ul>
399416
* <li> If set to 'abort' any request not found in the HAR file will be aborted.</li>
@@ -449,6 +466,16 @@ public RouteFromHAROptions setUrl(Pattern url) {
449466
}
450467
}
451468
class StorageStateOptions {
469+
/**
470+
* Set to {@code true} to include the context's virtual WebAuthn {@link com.microsoft.playwright.BrowserContext#credentials
471+
* BrowserContext.credentials()} (passkeys) in the storage state snapshot. The captured credentials carry their private
472+
* keys, so they can be re-seeded into a later context via the {@code storageState} option or {@link
473+
* com.microsoft.playwright.BrowserContext#setStorageState BrowserContext.setStorageState()}. Note that restoring the
474+
* storage state that contains credentials will automatically install the virtual WebAuthn authenticator (see {@link
475+
* com.microsoft.playwright.Credentials#install Credentials.install()}), and prevent all real authenticators from working
476+
* in this context.
477+
*/
478+
public Boolean credentials;
452479
/**
453480
* Set to {@code true} to include <a href="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a> in
454481
* the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase
@@ -461,6 +488,19 @@ class StorageStateOptions {
461488
*/
462489
public Path path;
463490

491+
/**
492+
* Set to {@code true} to include the context's virtual WebAuthn {@link com.microsoft.playwright.BrowserContext#credentials
493+
* BrowserContext.credentials()} (passkeys) in the storage state snapshot. The captured credentials carry their private
494+
* keys, so they can be re-seeded into a later context via the {@code storageState} option or {@link
495+
* com.microsoft.playwright.BrowserContext#setStorageState BrowserContext.setStorageState()}. Note that restoring the
496+
* storage state that contains credentials will automatically install the virtual WebAuthn authenticator (see {@link
497+
* com.microsoft.playwright.Credentials#install Credentials.install()}), and prevent all real authenticators from working
498+
* in this context.
499+
*/
500+
public StorageStateOptions setCredentials(boolean credentials) {
501+
this.credentials = credentials;
502+
return this;
503+
}
464504
/**
465505
* Set to {@code true} to include <a href="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a> in
466506
* the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase
@@ -1469,21 +1509,26 @@ default void routeFromHAR(Path har) {
14691509
*/
14701510
void setOffline(boolean offline);
14711511
/**
1472-
* Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot.
1512+
* Returns storage state for this browser context, contains current cookies, local storage snapshot, IndexedDB snapshot and
1513+
* virtual WebAuthn credentials.
14731514
*
14741515
* @since v1.8
14751516
*/
14761517
default String storageState() {
14771518
return storageState(null);
14781519
}
14791520
/**
1480-
* Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB snapshot.
1521+
* Returns storage state for this browser context, contains current cookies, local storage snapshot, IndexedDB snapshot and
1522+
* virtual WebAuthn credentials.
14811523
*
14821524
* @since v1.8
14831525
*/
14841526
String storageState(StorageStateOptions options);
14851527
/**
1486-
* Clears the existing cookies, local storage and IndexedDB entries for all origins and sets the new storage state.
1528+
* Clears the existing cookies, local storage, IndexedDB entries and virtual WebAuthn credentials, and sets the new storage
1529+
* state. When the storage state contains credentials, the virtual WebAuthn authenticator is installed (equivalent to
1530+
* {@link com.microsoft.playwright.Credentials#install Credentials.install()}), preventing all real authenticators from
1531+
* working in this context.
14871532
*
14881533
* <p> <strong>Usage</strong>
14891534
* <pre>{@code

playwright/src/main/java/com/microsoft/playwright/BrowserType.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,9 @@ default Browser connect(String endpoint) {
13141314
* advanced functionality, you probably want to use {@link com.microsoft.playwright.BrowserType#connect
13151315
* BrowserType.connect()}.
13161316
*
1317+
* <p> <strong>NOTE:</strong> Playwright maintains a curated list of arguments for launching the browser. If you launch the browser without Playwright
1318+
* and do not pass the exact same arguments, some of Playwright functionality may be broken upon connecting to the browser.
1319+
*
13171320
* <p> <strong>Usage</strong>
13181321
* <pre>{@code
13191322
* Browser browser = playwright.chromium().connectOverCDP("http://localhost:9222");
@@ -1340,6 +1343,9 @@ default Browser connectOverCDP(String endpointURL) {
13401343
* advanced functionality, you probably want to use {@link com.microsoft.playwright.BrowserType#connect
13411344
* BrowserType.connect()}.
13421345
*
1346+
* <p> <strong>NOTE:</strong> Playwright maintains a curated list of arguments for launching the browser. If you launch the browser without Playwright
1347+
* and do not pass the exact same arguments, some of Playwright functionality may be broken upon connecting to the browser.
1348+
*
13431349
* <p> <strong>Usage</strong>
13441350
* <pre>{@code
13451351
* Browser browser = playwright.chromium().connectOverCDP("http://localhost:9222");

playwright/src/main/java/com/microsoft/playwright/Credentials.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* passkeys and answer {@code navigator.credentials.create()} / {@code navigator.credentials.get()} ceremonies in the page,
2525
* without a real authenticator or hardware security key.
2626
*
27-
* <p> There are two common ways to use it:
27+
* <p> There are three common ways to use it:
2828
*
2929
* <p> <strong>Usage: seed a known credential</strong>
3030
* <pre>{@code
@@ -43,7 +43,7 @@
4343
* // The page's navigator.credentials.get() is answered with the seeded passkey.
4444
* }</pre>
4545
*
46-
* <p> <strong>Usage: capture a passkey, then reuse it</strong>
46+
* <p> <strong>Usage: capture a credential, then reuse it</strong>
4747
* <pre>{@code
4848
* // setup test: let the app register a passkey, then save it.
4949
* BrowserContext context = browser.newContext();
@@ -75,6 +75,11 @@
7575
* // navigator.credentials.get() resolves the captured passkey — already signed in.
7676
* }</pre>
7777
*
78+
* <p> <strong>Usage: save credentials in the storage state, restore later</strong>
79+
*
80+
* <p> See <a href="https://playwright.dev/java/docs/auth">authentication guide</a> for examples of using saving and resotring
81+
* the storage state.
82+
*
7883
* <p> <strong>Defaults</strong>
7984
*/
8085
public interface Credentials {

0 commit comments

Comments
 (0)