1
0
mirror of synced 2026-05-22 18:53:15 +00:00

feat: Add support for Chrome DevTools Protocol (CDPSession) (#1329)

Add new methods BrowserContext.newCDPSession and
Browser.newBrowserCDPSession to create a Chrome
DevTools Protocol[1] session for the page and
browser respectively.

Fixes #823
[1] https://chromedevtools.github.io/devtools-protocol/
This commit is contained in:
Raphi
2023-08-11 01:42:57 +02:00
committed by GitHub
parent 463146ab11
commit 4b873ec3ad
10 changed files with 402 additions and 1 deletions
@@ -964,7 +964,7 @@ class Interface extends TypeDefinition {
if (asList("Page", "Frame", "ElementHandle", "Locator", "APIRequest", "Browser", "BrowserContext", "BrowserType", "Route", "Request", "Response", "JSHandle", "ConsoleMessage", "APIResponse", "Playwright").contains(jsonName)) {
output.add("import java.util.*;");
}
if (asList("Page", "Browser", "BrowserContext", "WebSocket", "Worker").contains(jsonName)) {
if (asList("Page", "Browser", "BrowserContext", "WebSocket", "Worker", "CDPSession").contains(jsonName)) {
output.add("import java.util.function.Consumer;");
}
if (asList("Page", "BrowserContext").contains(jsonName)) {
@@ -977,6 +977,9 @@ class Interface extends TypeDefinition {
if (asList("Page", "Frame", "FrameLocator", "Locator", "Browser", "BrowserType", "BrowserContext", "PageAssertions", "LocatorAssertions").contains(jsonName)) {
output.add("import java.util.regex.Pattern;");
}
if ("CDPSession".equals(jsonName)) {
output.add("import com.google.gson.JsonObject;");
}
if ("PlaywrightAssertions".equals(jsonName)) {
output.add("import com.microsoft.playwright.APIResponse;");
output.add("import com.microsoft.playwright.Locator;");