@@ -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
0 commit comments