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
1010
1111| | Linux | macOS | Windows |
1212| :--- | :---: | :---: | :---: |
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 : |
1414| 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 : |
1616
1717Headless execution is supported for all the browsers on all platforms. Check out [ system requirements] ( https://playwright.dev/java/docs/intro#system-requirements ) for details.
1818
Original file line number Diff line number Diff line change 3030 * <p> By default, the routed WebSocket will not connect to the server. This way, you can mock entire communcation over the
3131 * WebSocket. Here is an example that responds to a {@code "request"} with a {@code "response"}.
3232 * <pre>{@code
33- * page.routeWebSocket("/ws", ws -> {
33+ * page.routeWebSocket("wss://example.com /ws", ws -> {
3434 * ws.onMessage(message -> {
3535 * if ("request".equals(message))
3636 * ws.send("response");
4242 * inside the WebSocket route handler, Playwright assumes that WebSocket will be mocked, and opens the WebSocket inside the
4343 * page automatically.
4444 *
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+ *
4559 * <p> <strong>Intercepting</strong>
4660 *
4761 * <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