diff --git a/README.md b/README.md index af58b7c91..7141dbd75 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 131.0.6778.33 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 132.0.6834.57 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 18.2 | ✅ | ✅ | ✅ | -| Firefox 132.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 134.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | Headless execution is supported for all the browsers on all platforms. Check out [system requirements](https://playwright.dev/java/docs/intro#system-requirements) for details. diff --git a/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java index 2860249fd..3b32211ed 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Browser.java +++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java @@ -1225,10 +1225,10 @@ public StartTracingOptions setScreenshots(boolean screenshots) { *
In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the * browser server. * - *
NOTE: This is similar to force quitting the browser. Therefore, you should call {@link - * com.microsoft.playwright.BrowserContext#close BrowserContext.close()} on any {@code BrowserContext}'s you explicitly - * created earlier with {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} **before** calling {@link - * com.microsoft.playwright.Browser#close Browser.close()}. + *
NOTE: This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close events, call + * {@link com.microsoft.playwright.BrowserContext#close BrowserContext.close()} on any {@code BrowserContext} instances you + * explicitly created earlier using {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} **before** + * calling {@link com.microsoft.playwright.Browser#close Browser.close()}. * *
The {@code Browser} object itself is considered to be disposed and cannot be used anymore. * @@ -1244,10 +1244,10 @@ default void close() { *
In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the * browser server. * - *
NOTE: This is similar to force quitting the browser. Therefore, you should call {@link - * com.microsoft.playwright.BrowserContext#close BrowserContext.close()} on any {@code BrowserContext}'s you explicitly - * created earlier with {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} **before** calling {@link - * com.microsoft.playwright.Browser#close Browser.close()}. + *
NOTE: This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close events, call + * {@link com.microsoft.playwright.BrowserContext#close BrowserContext.close()} on any {@code BrowserContext} instances you + * explicitly created earlier using {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} **before** + * calling {@link com.microsoft.playwright.Browser#close Browser.close()}. * *
The {@code Browser} object itself is considered to be disposed and cannot be used anymore. * diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java index b0e7c9c9b..d0ef27190 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java @@ -834,10 +834,14 @@ default void exposeBinding(String name, BindingCallback callback) { * Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if * specified. * - * @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values: + * @param permissions A list of permissions to grant. + * + *
NOTE: Supported permissions differ between browsers, and even between different versions of the same browser. Any permission + * may stop working after an update. + * + *
Here are some permissions that may be supported by some browsers: *
NOTE: Supported permissions differ between browsers, and even between different versions of the same browser. Any permission + * may stop working after an update. + * + *
Here are some permissions that may be supported by some browsers: *
Use "chromium" to opt in to new headless + * mode. + * + *
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to
+ * use branded Google Chrome and
+ * Microsoft Edge.
*/
public Object channel;
/**
@@ -265,18 +270,28 @@ public LaunchOptions setArgs(List Use "chromium" to opt in to new headless
+ * mode.
+ *
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to
+ * use branded Google Chrome and
+ * Microsoft Edge.
*/
public LaunchOptions setChannel(BrowserChannel channel) {
this.channel = channel;
return this;
}
/**
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
- * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge.
+ * Browser distribution channel.
+ *
+ * Use "chromium" to opt in to new headless
+ * mode.
+ *
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to
+ * use branded Google Chrome and
+ * Microsoft Edge.
*/
public LaunchOptions setChannel(String channel) {
this.channel = channel;
@@ -446,9 +461,14 @@ class LaunchPersistentContextOptions {
*/
public Boolean bypassCSP;
/**
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
- * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge.
+ * Browser distribution channel.
+ *
+ * Use "chromium" to opt in to new headless
+ * mode.
+ *
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to
+ * use branded Google Chrome and
+ * Microsoft Edge.
*/
public Object channel;
/**
@@ -734,18 +754,28 @@ public LaunchPersistentContextOptions setBypassCSP(boolean bypassCSP) {
}
@Deprecated
/**
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
- * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge.
+ * Browser distribution channel.
+ *
+ * Use "chromium" to opt in to new headless
+ * mode.
+ *
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to
+ * use branded Google Chrome and
+ * Microsoft Edge.
*/
public LaunchPersistentContextOptions setChannel(BrowserChannel channel) {
this.channel = channel;
return this;
}
/**
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
- * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge.
+ * Browser distribution channel.
+ *
+ * Use "chromium" to opt in to new headless
+ * mode.
+ *
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to
+ * use branded Google Chrome and
+ * Microsoft Edge.
*/
public LaunchPersistentContextOptions setChannel(String channel) {
this.channel = channel;
diff --git a/playwright/src/main/java/com/microsoft/playwright/Clock.java b/playwright/src/main/java/com/microsoft/playwright/Clock.java
index 52c64d34e..bab0a7f65 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Clock.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Clock.java
@@ -174,6 +174,19 @@ default void install() {
* page.clock().pauseAt("2020-02-02");
* }
*
+ * For best results, install the clock before navigating the page and set it to a time slightly before the intended test
+ * time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the
+ * page has fully loaded, you can safely use {@link com.microsoft.playwright.Clock#pauseAt Clock.pauseAt()} to pause the
+ * clock.
+ * For best results, install the clock before navigating the page and set it to a time slightly before the intended test
+ * time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the
+ * page has fully loaded, you can safely use {@link com.microsoft.playwright.Clock#pauseAt Clock.pauseAt()} to pause the
+ * clock.
+ * For best results, install the clock before navigating the page and set it to a time slightly before the intended test
+ * time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the
+ * page has fully loaded, you can safely use {@link com.microsoft.playwright.Clock#pauseAt Clock.pauseAt()} to pause the
+ * clock.
+ * You can also specify {@code JSHandle} as the property value if you want live objects to be passed into the event:
* You can also specify {@code JSHandle} as the property value if you want live objects to be passed into the event:
* You can also specify {@code JSHandle} as the property value if you want live objects to be passed into the event:
* {@code
+ * // Initialize clock with some time before the test time and let the page load
+ * // naturally. `Date.now` will progress as the timers fire.
+ * SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss");
+ * page.clock().install(new Clock.InstallOptions().setTime(format.parse("2024-12-10T08:00:00")));
+ * page.navigate("http://localhost:3333");
+ * page.clock().pauseAt(format.parse("2024-12-10T10:00:00"));
+ * }
+ *
* @param time Time to pause at.
* @since v1.45
*/
@@ -194,6 +207,19 @@ default void install() {
* page.clock().pauseAt("2020-02-02");
* }
*
+ * {@code
+ * // Initialize clock with some time before the test time and let the page load
+ * // naturally. `Date.now` will progress as the timers fire.
+ * SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss");
+ * page.clock().install(new Clock.InstallOptions().setTime(format.parse("2024-12-10T08:00:00")));
+ * page.navigate("http://localhost:3333");
+ * page.clock().pauseAt(format.parse("2024-12-10T10:00:00"));
+ * }
+ *
* @param time Time to pause at.
* @since v1.45
*/
@@ -214,6 +240,19 @@ default void install() {
* page.clock().pauseAt("2020-02-02");
* }
*
+ * {@code
+ * // Initialize clock with some time before the test time and let the page load
+ * // naturally. `Date.now` will progress as the timers fire.
+ * SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss");
+ * page.clock().install(new Clock.InstallOptions().setTime(format.parse("2024-12-10T08:00:00")));
+ * page.navigate("http://localhost:3333");
+ * page.clock().pauseAt(format.parse("2024-12-10T10:00:00"));
+ * }
+ *
* @param time Time to pause at.
* @since v1.45
*/
diff --git a/playwright/src/main/java/com/microsoft/playwright/Locator.java b/playwright/src/main/java/com/microsoft/playwright/Locator.java
index ad16fbf1f..7173b0432 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Locator.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Locator.java
@@ -2630,7 +2630,6 @@ default void dblclick() {
*
* {@code
- * // Note you can only create DataTransfer in Chromium and Firefox
* JSHandle dataTransfer = page.evaluateHandle("() => new DataTransfer()");
* Map{@code
- * // Note you can only create DataTransfer in Chromium and Firefox
* JSHandle dataTransfer = page.evaluateHandle("() => new DataTransfer()");
* Map{@code
- * // Note you can only create DataTransfer in Chromium and Firefox
* JSHandle dataTransfer = page.evaluateHandle("() => new DataTransfer()");
* Map