@@ -497,6 +497,12 @@ class LaunchPersistentContextOptions {
497497 * "light"}.
498498 */
499499 public Optional <ColorScheme > colorScheme ;
500+ /**
501+ * Emulates {@code "prefers-contrast"} media feature, supported values are {@code "no-preference"}, {@code "more"}. See
502+ * {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets
503+ * emulation to system defaults. Defaults to {@code "no-preference"}.
504+ */
505+ public Optional <Contrast > contrast ;
500506 /**
501507 * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. Learn more about <a
502508 * href="https://playwright.dev/java/docs/emulation#devices">emulating devices with device scale factor</a>.
@@ -816,6 +822,15 @@ public LaunchPersistentContextOptions setColorScheme(ColorScheme colorScheme) {
816822 this .colorScheme = Optional .ofNullable (colorScheme );
817823 return this ;
818824 }
825+ /**
826+ * Emulates {@code "prefers-contrast"} media feature, supported values are {@code "no-preference"}, {@code "more"}. See
827+ * {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets
828+ * emulation to system defaults. Defaults to {@code "no-preference"}.
829+ */
830+ public LaunchPersistentContextOptions setContrast (Contrast contrast ) {
831+ this .contrast = Optional .ofNullable (contrast );
832+ return this ;
833+ }
819834 /**
820835 * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. Learn more about <a
821836 * href="https://playwright.dev/java/docs/emulation#devices">emulating devices with device scale factor</a>.
@@ -1197,22 +1212,24 @@ public LaunchPersistentContextOptions setViewportSize(ViewportSize viewportSize)
11971212 }
11981213 }
11991214 /**
1200- * This method attaches Playwright to an existing browser instance. When connecting to another browser launched via {@code
1201- * BrowserType.launchServer} in Node.js, the major and minor version needs to match the client version (1.2.3 → is
1202- * compatible with 1.2.x).
1215+ * This method attaches Playwright to an existing browser instance created via {@code BrowserType.launchServer} in Node.js.
1216+ *
1217+ * <p> <strong>NOTE:</strong> The major and minor version of the Playwright instance that connects needs to match the version of Playwright that
1218+ * launches the browser (1.2.3 → is compatible with 1.2.x).
12031219 *
1204- * @param wsEndpoint A browser websocket endpoint to connect to.
1220+ * @param wsEndpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via {@code BrowserServer.wsEndpoint} .
12051221 * @since v1.8
12061222 */
12071223 default Browser connect (String wsEndpoint ) {
12081224 return connect (wsEndpoint , null );
12091225 }
12101226 /**
1211- * This method attaches Playwright to an existing browser instance. When connecting to another browser launched via {@code
1212- * BrowserType.launchServer} in Node.js, the major and minor version needs to match the client version (1.2.3 → is
1213- * compatible with 1.2.x).
1227+ * This method attaches Playwright to an existing browser instance created via {@code BrowserType.launchServer} in Node.js.
12141228 *
1215- * @param wsEndpoint A browser websocket endpoint to connect to.
1229+ * <p> <strong>NOTE:</strong> The major and minor version of the Playwright instance that connects needs to match the version of Playwright that
1230+ * launches the browser (1.2.3 → is compatible with 1.2.x).
1231+ *
1232+ * @param wsEndpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via {@code BrowserServer.wsEndpoint}.
12161233 * @since v1.8
12171234 */
12181235 Browser connect (String wsEndpoint , ConnectOptions options );
@@ -1223,6 +1240,11 @@ default Browser connect(String wsEndpoint) {
12231240 *
12241241 * <p> <strong>NOTE:</strong> Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
12251242 *
1243+ * <p> <strong>NOTE:</strong> This connection is significantly lower fidelity than the Playwright protocol connection via {@link
1244+ * com.microsoft.playwright.BrowserType#connect BrowserType.connect()}. If you are experiencing issues or attempting to use
1245+ * advanced functionality, you probably want to use {@link com.microsoft.playwright.BrowserType#connect
1246+ * BrowserType.connect()}.
1247+ *
12261248 * <p> <strong>Usage</strong>
12271249 * <pre>{@code
12281250 * Browser browser = playwright.chromium().connectOverCDP("http://localhost:9222");
@@ -1244,6 +1266,11 @@ default Browser connectOverCDP(String endpointURL) {
12441266 *
12451267 * <p> <strong>NOTE:</strong> Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
12461268 *
1269+ * <p> <strong>NOTE:</strong> This connection is significantly lower fidelity than the Playwright protocol connection via {@link
1270+ * com.microsoft.playwright.BrowserType#connect BrowserType.connect()}. If you are experiencing issues or attempting to use
1271+ * advanced functionality, you probably want to use {@link com.microsoft.playwright.BrowserType#connect
1272+ * BrowserType.connect()}.
1273+ *
12471274 * <p> <strong>Usage</strong>
12481275 * <pre>{@code
12491276 * Browser browser = playwright.chromium().connectOverCDP("http://localhost:9222");
0 commit comments