Skip to content

Commit ab443d1

Browse files
authored
chore: roll 1.48 beta driver (#1681)
1 parent 186aede commit ab443d1

37 files changed

+1344
-196
lines changed

README.md

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

1111
| | Linux | macOS | Windows |
1212
| :--- | :---: | :---: | :---: |
13-
| Chromium <!-- GEN:chromium-version -->129.0.6668.29<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
13+
| Chromium <!-- GEN:chromium-version -->130.0.6723.19<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1414
| WebKit <!-- GEN:webkit-version -->18.0<!-- GEN:stop --> ||||
1515
| Firefox <!-- GEN:firefox-version -->130.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1616

playwright/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
<groupId>org.junit.jupiter</groupId>
6262
<artifactId>junit-jupiter-engine</artifactId>
6363
</dependency>
64+
<dependency>
65+
<groupId>org.junit.jupiter</groupId>
66+
<artifactId>junit-jupiter-params</artifactId>
67+
</dependency>
6468
<dependency>
6569
<groupId>org.opentest4j</groupId>
6670
<artifactId>opentest4j</artifactId>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class NewContextOptions {
5151
* {@code pfx}). Optionally, {@code passphrase} property should be provided if the certificate is encrypted. The {@code
5252
* origin} property should be provided with an exact match to the request origin that the certificate is valid for.
5353
*
54-
* <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
55-
*
5654
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
5755
* replacing {@code localhost} with {@code local.playwright}.
5856
*/
@@ -126,8 +124,6 @@ public NewContextOptions setBaseURL(String baseURL) {
126124
* {@code pfx}). Optionally, {@code passphrase} property should be provided if the certificate is encrypted. The {@code
127125
* origin} property should be provided with an exact match to the request origin that the certificate is valid for.
128126
*
129-
* <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
130-
*
131127
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
132128
* replacing {@code localhost} with {@code local.playwright}.
133129
*/

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ default void dispose() {
129129
* }</pre>
130130
*
131131
* <p> The common way to send file(s) in the body of a request is to upload them as form fields with {@code
132-
* multipart/form-data} encoding. Use {@code FormData} to construct request body and pass it to the request as {@code
133-
* multipart} parameter:
132+
* multipart/form-data} encoding, by specifiying the {@code multipart} parameter:
134133
* <pre>{@code
135134
* // Pass file path to the form data constructor:
136135
* Path file = Paths.get("team.csv");
@@ -167,8 +166,7 @@ default APIResponse fetch(String urlOrRequest) {
167166
* }</pre>
168167
*
169168
* <p> The common way to send file(s) in the body of a request is to upload them as form fields with {@code
170-
* multipart/form-data} encoding. Use {@code FormData} to construct request body and pass it to the request as {@code
171-
* multipart} parameter:
169+
* multipart/form-data} encoding, by specifiying the {@code multipart} parameter:
172170
* <pre>{@code
173171
* // Pass file path to the form data constructor:
174172
* Path file = Paths.get("team.csv");
@@ -204,8 +202,7 @@ default APIResponse fetch(String urlOrRequest) {
204202
* }</pre>
205203
*
206204
* <p> The common way to send file(s) in the body of a request is to upload them as form fields with {@code
207-
* multipart/form-data} encoding. Use {@code FormData} to construct request body and pass it to the request as {@code
208-
* multipart} parameter:
205+
* multipart/form-data} encoding, by specifiying the {@code multipart} parameter:
209206
* <pre>{@code
210207
* // Pass file path to the form data constructor:
211208
* Path file = Paths.get("team.csv");
@@ -242,8 +239,7 @@ default APIResponse fetch(Request urlOrRequest) {
242239
* }</pre>
243240
*
244241
* <p> The common way to send file(s) in the body of a request is to upload them as form fields with {@code
245-
* multipart/form-data} encoding. Use {@code FormData} to construct request body and pass it to the request as {@code
246-
* multipart} parameter:
242+
* multipart/form-data} encoding, by specifiying the {@code multipart} parameter:
247243
* <pre>{@code
248244
* // Pass file path to the form data constructor:
249245
* Path file = Paths.get("team.csv");

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ class NewContextOptions {
106106
* {@code pfx}). Optionally, {@code passphrase} property should be provided if the certificate is encrypted. The {@code
107107
* origin} property should be provided with an exact match to the request origin that the certificate is valid for.
108108
*
109-
* <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
110-
*
111109
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
112110
* replacing {@code localhost} with {@code local.playwright}.
113111
*/
@@ -317,8 +315,6 @@ public NewContextOptions setBypassCSP(boolean bypassCSP) {
317315
* {@code pfx}). Optionally, {@code passphrase} property should be provided if the certificate is encrypted. The {@code
318316
* origin} property should be provided with an exact match to the request origin that the certificate is valid for.
319317
*
320-
* <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
321-
*
322318
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
323319
* replacing {@code localhost} with {@code local.playwright}.
324320
*/
@@ -659,8 +655,6 @@ class NewPageOptions {
659655
* {@code pfx}). Optionally, {@code passphrase} property should be provided if the certificate is encrypted. The {@code
660656
* origin} property should be provided with an exact match to the request origin that the certificate is valid for.
661657
*
662-
* <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
663-
*
664658
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
665659
* replacing {@code localhost} with {@code local.playwright}.
666660
*/
@@ -870,8 +864,6 @@ public NewPageOptions setBypassCSP(boolean bypassCSP) {
870864
* {@code pfx}). Optionally, {@code passphrase} property should be provided if the certificate is encrypted. The {@code
871865
* origin} property should be provided with an exact match to the request origin that the certificate is valid for.
872866
*
873-
* <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
874-
*
875867
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
876868
* replacing {@code localhost} with {@code local.playwright}.
877869
*/

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

Lines changed: 89 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ default void grantPermissions(List<String> permissions) {
927927
*
928928
* <p> <strong>NOTE:</strong> {@link com.microsoft.playwright.BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by
929929
* Service Worker. See <a href="https://github.com/microsoft/playwright/issues/1090">this</a> issue. We recommend disabling
930-
* Service Workers when using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}.
930+
* Service Workers when using request interception by setting {@code serviceWorkers} to {@code "block"}.
931931
*
932932
* <p> <strong>Usage</strong>
933933
*
@@ -983,7 +983,7 @@ default void route(String url, Consumer<Route> handler) {
983983
*
984984
* <p> <strong>NOTE:</strong> {@link com.microsoft.playwright.BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by
985985
* Service Worker. See <a href="https://github.com/microsoft/playwright/issues/1090">this</a> issue. We recommend disabling
986-
* Service Workers when using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}.
986+
* Service Workers when using request interception by setting {@code serviceWorkers} to {@code "block"}.
987987
*
988988
* <p> <strong>Usage</strong>
989989
*
@@ -1037,7 +1037,7 @@ default void route(String url, Consumer<Route> handler) {
10371037
*
10381038
* <p> <strong>NOTE:</strong> {@link com.microsoft.playwright.BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by
10391039
* Service Worker. See <a href="https://github.com/microsoft/playwright/issues/1090">this</a> issue. We recommend disabling
1040-
* Service Workers when using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}.
1040+
* Service Workers when using request interception by setting {@code serviceWorkers} to {@code "block"}.
10411041
*
10421042
* <p> <strong>Usage</strong>
10431043
*
@@ -1093,7 +1093,7 @@ default void route(Pattern url, Consumer<Route> handler) {
10931093
*
10941094
* <p> <strong>NOTE:</strong> {@link com.microsoft.playwright.BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by
10951095
* Service Worker. See <a href="https://github.com/microsoft/playwright/issues/1090">this</a> issue. We recommend disabling
1096-
* Service Workers when using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}.
1096+
* Service Workers when using request interception by setting {@code serviceWorkers} to {@code "block"}.
10971097
*
10981098
* <p> <strong>Usage</strong>
10991099
*
@@ -1147,7 +1147,7 @@ default void route(Pattern url, Consumer<Route> handler) {
11471147
*
11481148
* <p> <strong>NOTE:</strong> {@link com.microsoft.playwright.BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by
11491149
* Service Worker. See <a href="https://github.com/microsoft/playwright/issues/1090">this</a> issue. We recommend disabling
1150-
* Service Workers when using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}.
1150+
* Service Workers when using request interception by setting {@code serviceWorkers} to {@code "block"}.
11511151
*
11521152
* <p> <strong>Usage</strong>
11531153
*
@@ -1203,7 +1203,7 @@ default void route(Predicate<String> url, Consumer<Route> handler) {
12031203
*
12041204
* <p> <strong>NOTE:</strong> {@link com.microsoft.playwright.BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by
12051205
* Service Worker. See <a href="https://github.com/microsoft/playwright/issues/1090">this</a> issue. We recommend disabling
1206-
* Service Workers when using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}.
1206+
* Service Workers when using request interception by setting {@code serviceWorkers} to {@code "block"}.
12071207
*
12081208
* <p> <strong>Usage</strong>
12091209
*
@@ -1257,7 +1257,7 @@ default void route(Predicate<String> url, Consumer<Route> handler) {
12571257
*
12581258
* <p> Playwright will not serve requests intercepted by Service Worker from the HAR file. See <a
12591259
* href="https://github.com/microsoft/playwright/issues/1090">this</a> issue. We recommend disabling Service Workers when
1260-
* using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}.
1260+
* using request interception by setting {@code serviceWorkers} to {@code "block"}.
12611261
*
12621262
* @param har Path to a <a href="http://www.softwareishard.com/blog/har-12-spec">HAR</a> file with prerecorded network data. If {@code
12631263
* path} is a relative path, then it is resolved relative to the current working directory.
@@ -1272,13 +1272,94 @@ default void routeFromHAR(Path har) {
12721272
*
12731273
* <p> Playwright will not serve requests intercepted by Service Worker from the HAR file. See <a
12741274
* href="https://github.com/microsoft/playwright/issues/1090">this</a> issue. We recommend disabling Service Workers when
1275-
* using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}.
1275+
* using request interception by setting {@code serviceWorkers} to {@code "block"}.
12761276
*
12771277
* @param har Path to a <a href="http://www.softwareishard.com/blog/har-12-spec">HAR</a> file with prerecorded network data. If {@code
12781278
* path} is a relative path, then it is resolved relative to the current working directory.
12791279
* @since v1.23
12801280
*/
12811281
void routeFromHAR(Path har, RouteFromHAROptions options);
1282+
/**
1283+
* This method allows to modify websocket connections that are made by any page in the browser context.
1284+
*
1285+
* <p> Note that only {@code WebSocket}s created after this method was called will be routed. It is recommended to call this
1286+
* method before creating any pages.
1287+
*
1288+
* <p> <strong>Usage</strong>
1289+
*
1290+
* <p> Below is an example of a simple handler that blocks some websocket messages. See {@code WebSocketRoute} for more details
1291+
* and examples.
1292+
* <pre>{@code
1293+
* context.routeWebSocket("/ws", ws -> {
1294+
* ws.routeSend(message -> {
1295+
* if ("to-be-blocked".equals(message))
1296+
* return;
1297+
* ws.send(message);
1298+
* });
1299+
* ws.connect();
1300+
* });
1301+
* }</pre>
1302+
*
1303+
* @param url Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the {@code
1304+
* baseURL} context option.
1305+
* @param handler Handler function to route the WebSocket.
1306+
* @since v1.48
1307+
*/
1308+
void routeWebSocket(String url, Consumer<WebSocketRoute> handler);
1309+
/**
1310+
* This method allows to modify websocket connections that are made by any page in the browser context.
1311+
*
1312+
* <p> Note that only {@code WebSocket}s created after this method was called will be routed. It is recommended to call this
1313+
* method before creating any pages.
1314+
*
1315+
* <p> <strong>Usage</strong>
1316+
*
1317+
* <p> Below is an example of a simple handler that blocks some websocket messages. See {@code WebSocketRoute} for more details
1318+
* and examples.
1319+
* <pre>{@code
1320+
* context.routeWebSocket("/ws", ws -> {
1321+
* ws.routeSend(message -> {
1322+
* if ("to-be-blocked".equals(message))
1323+
* return;
1324+
* ws.send(message);
1325+
* });
1326+
* ws.connect();
1327+
* });
1328+
* }</pre>
1329+
*
1330+
* @param url Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the {@code
1331+
* baseURL} context option.
1332+
* @param handler Handler function to route the WebSocket.
1333+
* @since v1.48
1334+
*/
1335+
void routeWebSocket(Pattern url, Consumer<WebSocketRoute> handler);
1336+
/**
1337+
* This method allows to modify websocket connections that are made by any page in the browser context.
1338+
*
1339+
* <p> Note that only {@code WebSocket}s created after this method was called will be routed. It is recommended to call this
1340+
* method before creating any pages.
1341+
*
1342+
* <p> <strong>Usage</strong>
1343+
*
1344+
* <p> Below is an example of a simple handler that blocks some websocket messages. See {@code WebSocketRoute} for more details
1345+
* and examples.
1346+
* <pre>{@code
1347+
* context.routeWebSocket("/ws", ws -> {
1348+
* ws.routeSend(message -> {
1349+
* if ("to-be-blocked".equals(message))
1350+
* return;
1351+
* ws.send(message);
1352+
* });
1353+
* ws.connect();
1354+
* });
1355+
* }</pre>
1356+
*
1357+
* @param url Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the {@code
1358+
* baseURL} context option.
1359+
* @param handler Handler function to route the WebSocket.
1360+
* @since v1.48
1361+
*/
1362+
void routeWebSocket(Predicate<String> url, Consumer<WebSocketRoute> handler);
12821363
/**
12831364
* This setting will change the default maximum navigation time for the following methods and related shortcuts:
12841365
* <ul>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ class LaunchPersistentContextOptions {
465465
* {@code pfx}). Optionally, {@code passphrase} property should be provided if the certificate is encrypted. The {@code
466466
* origin} property should be provided with an exact match to the request origin that the certificate is valid for.
467467
*
468-
* <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
469-
*
470468
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
471469
* replacing {@code localhost} with {@code local.playwright}.
472470
*/
@@ -768,8 +766,6 @@ public LaunchPersistentContextOptions setChromiumSandbox(boolean chromiumSandbox
768766
* {@code pfx}). Optionally, {@code passphrase} property should be provided if the certificate is encrypted. The {@code
769767
* origin} property should be provided with an exact match to the request origin that the certificate is valid for.
770768
*
771-
* <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
772-
*
773769
* <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
774770
* replacing {@code localhost} with {@code local.playwright}.
775771
*/

0 commit comments

Comments
 (0)