File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
playwright/src/main/java/com/microsoft/playwright Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom
10
10
11
11
| | Linux | macOS | Windows |
12
12
| :--- | :---: | :---: | :---: |
13
- | Chromium <!-- GEN:chromium-version --> 130.0.6723.19 <!-- GEN:stop --> | :white_check_mark : | :white_check_mark : | :white_check_mark : |
13
+ | Chromium <!-- GEN:chromium-version --> 130.0.6723.31 <!-- GEN:stop --> | :white_check_mark : | :white_check_mark : | :white_check_mark : |
14
14
| WebKit <!-- GEN:webkit-version --> 18.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
15
- | Firefox <!-- GEN:firefox-version --> 130 .0<!-- GEN:stop --> | :white_check_mark : | :white_check_mark : | :white_check_mark : |
15
+ | Firefox <!-- GEN:firefox-version --> 131 .0<!-- GEN:stop --> | :white_check_mark : | :white_check_mark : | :white_check_mark : |
16
16
17
17
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.
18
18
Original file line number Diff line number Diff line change 30
30
* <p> By default, the routed WebSocket will not connect to the server. This way, you can mock entire communcation over the
31
31
* WebSocket. Here is an example that responds to a {@code "request"} with a {@code "response"}.
32
32
* <pre>{@code
33
- * page.routeWebSocket("/ws", ws -> {
33
+ * page.routeWebSocket("wss://example.com /ws", ws -> {
34
34
* ws.onMessage(message -> {
35
35
* if ("request".equals(message))
36
36
* ws.send("response");
42
42
* inside the WebSocket route handler, Playwright assumes that WebSocket will be mocked, and opens the WebSocket inside the
43
43
* page automatically.
44
44
*
45
+ * <p> Here is another example that handles JSON messages:
46
+ * <pre>{@code
47
+ * page.routeWebSocket("wss://example.com/ws", ws -> {
48
+ * ws.onMessage(message -> {
49
+ * JsonObject json = new JsonParser().parse(message).getAsJsonObject();
50
+ * if ("question".equals(json.get("request").getAsString())) {
51
+ * Map<String, String> result = new HashMap();
52
+ * result.put("response", "answer");
53
+ * ws.send(gson.toJson(result));
54
+ * }
55
+ * });
56
+ * });
57
+ * }</pre>
58
+ *
45
59
* <p> <strong>Intercepting</strong>
46
60
*
47
61
* <p> Alternatively, you may want to connect to the actual server, but intercept messages in-between and modify or block them.
Original file line number Diff line number Diff line change 1
- 1.48.0-beta-1727692967000
1
+ 1.48.1
You can’t perform that action at this time.
0 commit comments