mirror of
https://github.com/microsoft/playwright-java.git
synced 2025-09-08 21:01:00 +00:00
chore: remove inherited methods from derived interfaces
This commit is contained in:
parent
98eeb5e78b
commit
236d2ae8b6
@ -550,11 +550,13 @@ class NestedClass extends TypeDefinition {
|
|||||||
super(parent, true, jsonElement);
|
super(parent, true, jsonElement);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
||||||
|
if (jsonElement.has("properties")) {
|
||||||
JsonObject properties = jsonElement.get("properties").getAsJsonObject();
|
JsonObject properties = jsonElement.get("properties").getAsJsonObject();
|
||||||
for (Map.Entry<String, JsonElement> m : properties.entrySet()) {
|
for (Map.Entry<String, JsonElement> m : properties.entrySet()) {
|
||||||
fields.add(new Field(this, m.getKey(), m.getValue().getAsJsonObject()));
|
fields.add(new Field(this, m.getKey(), m.getValue().getAsJsonObject()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void writeTo(List<String> output, String offset) {
|
void writeTo(List<String> output, String offset) {
|
||||||
String access = parent.typeScope() instanceof NestedClass ? "public " : "";
|
String access = parent.typeScope() instanceof NestedClass ? "public " : "";
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -38,362 +38,6 @@ public interface ChromiumBrowser {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class NewContextOptions {
|
|
||||||
public enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
|
||||||
public class Geolocation {
|
|
||||||
public double latitude;
|
|
||||||
public double longitude;
|
|
||||||
public double accuracy;
|
|
||||||
|
|
||||||
Geolocation() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Geolocation withLatitude(double latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withLongitude(double longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withAccuracy(double accuracy) {
|
|
||||||
this.accuracy = accuracy;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class HttpCredentials {
|
|
||||||
public String username;
|
|
||||||
public String password;
|
|
||||||
|
|
||||||
HttpCredentials() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpCredentials withUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public HttpCredentials withPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class VideoSize {
|
|
||||||
public int width;
|
|
||||||
public int height;
|
|
||||||
|
|
||||||
VideoSize() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VideoSize withWidth(int width) {
|
|
||||||
this.width = width;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize withHeight(int height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Boolean acceptDownloads;
|
|
||||||
public Boolean ignoreHTTPSErrors;
|
|
||||||
public Boolean bypassCSP;
|
|
||||||
public Page.Viewport viewport;
|
|
||||||
public String userAgent;
|
|
||||||
public Integer deviceScaleFactor;
|
|
||||||
public Boolean isMobile;
|
|
||||||
public Boolean hasTouch;
|
|
||||||
public Boolean javaScriptEnabled;
|
|
||||||
public String timezoneId;
|
|
||||||
public Geolocation geolocation;
|
|
||||||
public String locale;
|
|
||||||
public List<String> permissions;
|
|
||||||
public Map<String, String> extraHTTPHeaders;
|
|
||||||
public Boolean offline;
|
|
||||||
public HttpCredentials httpCredentials;
|
|
||||||
public ColorScheme colorScheme;
|
|
||||||
public Logger logger;
|
|
||||||
public String relativeArtifactsPath;
|
|
||||||
public Boolean recordVideos;
|
|
||||||
public VideoSize videoSize;
|
|
||||||
public Boolean recordTrace;
|
|
||||||
|
|
||||||
public NewContextOptions withAcceptDownloads(Boolean acceptDownloads) {
|
|
||||||
this.acceptDownloads = acceptDownloads;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withIgnoreHTTPSErrors(Boolean ignoreHTTPSErrors) {
|
|
||||||
this.ignoreHTTPSErrors = ignoreHTTPSErrors;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withBypassCSP(Boolean bypassCSP) {
|
|
||||||
this.bypassCSP = bypassCSP;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withViewport(int width, int height) {
|
|
||||||
this.viewport = new Page.Viewport(width, height);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withUserAgent(String userAgent) {
|
|
||||||
this.userAgent = userAgent;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withDeviceScaleFactor(Integer deviceScaleFactor) {
|
|
||||||
this.deviceScaleFactor = deviceScaleFactor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withIsMobile(Boolean isMobile) {
|
|
||||||
this.isMobile = isMobile;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withHasTouch(Boolean hasTouch) {
|
|
||||||
this.hasTouch = hasTouch;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withJavaScriptEnabled(Boolean javaScriptEnabled) {
|
|
||||||
this.javaScriptEnabled = javaScriptEnabled;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withTimezoneId(String timezoneId) {
|
|
||||||
this.timezoneId = timezoneId;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation setGeolocation() {
|
|
||||||
this.geolocation = new Geolocation();
|
|
||||||
return this.geolocation;
|
|
||||||
}
|
|
||||||
public NewContextOptions withLocale(String locale) {
|
|
||||||
this.locale = locale;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withPermissions(List<String> permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withExtraHTTPHeaders(Map<String, String> extraHTTPHeaders) {
|
|
||||||
this.extraHTTPHeaders = extraHTTPHeaders;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withOffline(Boolean offline) {
|
|
||||||
this.offline = offline;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withHttpCredentials(String username, String password) {
|
|
||||||
this.httpCredentials = new HttpCredentials();
|
|
||||||
this.httpCredentials.username = username;
|
|
||||||
this.httpCredentials.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withColorScheme(ColorScheme colorScheme) {
|
|
||||||
this.colorScheme = colorScheme;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withLogger(Logger logger) {
|
|
||||||
this.logger = logger;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRelativeArtifactsPath(String relativeArtifactsPath) {
|
|
||||||
this.relativeArtifactsPath = relativeArtifactsPath;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRecordVideos(Boolean recordVideos) {
|
|
||||||
this.recordVideos = recordVideos;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize setVideoSize() {
|
|
||||||
this.videoSize = new VideoSize();
|
|
||||||
return this.videoSize;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRecordTrace(Boolean recordTrace) {
|
|
||||||
this.recordTrace = recordTrace;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
class NewPageOptions {
|
|
||||||
public enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
|
||||||
public class Geolocation {
|
|
||||||
public double latitude;
|
|
||||||
public double longitude;
|
|
||||||
public double accuracy;
|
|
||||||
|
|
||||||
Geolocation() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Geolocation withLatitude(double latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withLongitude(double longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withAccuracy(double accuracy) {
|
|
||||||
this.accuracy = accuracy;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class HttpCredentials {
|
|
||||||
public String username;
|
|
||||||
public String password;
|
|
||||||
|
|
||||||
HttpCredentials() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpCredentials withUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public HttpCredentials withPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class VideoSize {
|
|
||||||
public int width;
|
|
||||||
public int height;
|
|
||||||
|
|
||||||
VideoSize() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VideoSize withWidth(int width) {
|
|
||||||
this.width = width;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize withHeight(int height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Boolean acceptDownloads;
|
|
||||||
public Boolean ignoreHTTPSErrors;
|
|
||||||
public Boolean bypassCSP;
|
|
||||||
public Page.Viewport viewport;
|
|
||||||
public String userAgent;
|
|
||||||
public Integer deviceScaleFactor;
|
|
||||||
public Boolean isMobile;
|
|
||||||
public Boolean hasTouch;
|
|
||||||
public Boolean javaScriptEnabled;
|
|
||||||
public String timezoneId;
|
|
||||||
public Geolocation geolocation;
|
|
||||||
public String locale;
|
|
||||||
public List<String> permissions;
|
|
||||||
public Map<String, String> extraHTTPHeaders;
|
|
||||||
public Boolean offline;
|
|
||||||
public HttpCredentials httpCredentials;
|
|
||||||
public ColorScheme colorScheme;
|
|
||||||
public Logger logger;
|
|
||||||
public String relativeArtifactsPath;
|
|
||||||
public Boolean recordVideos;
|
|
||||||
public VideoSize videoSize;
|
|
||||||
public Boolean recordTrace;
|
|
||||||
|
|
||||||
public NewPageOptions withAcceptDownloads(Boolean acceptDownloads) {
|
|
||||||
this.acceptDownloads = acceptDownloads;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withIgnoreHTTPSErrors(Boolean ignoreHTTPSErrors) {
|
|
||||||
this.ignoreHTTPSErrors = ignoreHTTPSErrors;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withBypassCSP(Boolean bypassCSP) {
|
|
||||||
this.bypassCSP = bypassCSP;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withViewport(int width, int height) {
|
|
||||||
this.viewport = new Page.Viewport(width, height);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withUserAgent(String userAgent) {
|
|
||||||
this.userAgent = userAgent;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withDeviceScaleFactor(Integer deviceScaleFactor) {
|
|
||||||
this.deviceScaleFactor = deviceScaleFactor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withIsMobile(Boolean isMobile) {
|
|
||||||
this.isMobile = isMobile;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withHasTouch(Boolean hasTouch) {
|
|
||||||
this.hasTouch = hasTouch;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withJavaScriptEnabled(Boolean javaScriptEnabled) {
|
|
||||||
this.javaScriptEnabled = javaScriptEnabled;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withTimezoneId(String timezoneId) {
|
|
||||||
this.timezoneId = timezoneId;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation setGeolocation() {
|
|
||||||
this.geolocation = new Geolocation();
|
|
||||||
return this.geolocation;
|
|
||||||
}
|
|
||||||
public NewPageOptions withLocale(String locale) {
|
|
||||||
this.locale = locale;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withPermissions(List<String> permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withExtraHTTPHeaders(Map<String, String> extraHTTPHeaders) {
|
|
||||||
this.extraHTTPHeaders = extraHTTPHeaders;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withOffline(Boolean offline) {
|
|
||||||
this.offline = offline;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withHttpCredentials(String username, String password) {
|
|
||||||
this.httpCredentials = new HttpCredentials();
|
|
||||||
this.httpCredentials.username = username;
|
|
||||||
this.httpCredentials.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withColorScheme(ColorScheme colorScheme) {
|
|
||||||
this.colorScheme = colorScheme;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withLogger(Logger logger) {
|
|
||||||
this.logger = logger;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRelativeArtifactsPath(String relativeArtifactsPath) {
|
|
||||||
this.relativeArtifactsPath = relativeArtifactsPath;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRecordVideos(Boolean recordVideos) {
|
|
||||||
this.recordVideos = recordVideos;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize setVideoSize() {
|
|
||||||
this.videoSize = new VideoSize();
|
|
||||||
return this.videoSize;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRecordTrace(Boolean recordTrace) {
|
|
||||||
this.recordTrace = recordTrace;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CDPSession newBrowserCDPSession();
|
CDPSession newBrowserCDPSession();
|
||||||
default void startTracing(Page page) {
|
default void startTracing(Page page) {
|
||||||
startTracing(page, null);
|
startTracing(page, null);
|
||||||
@ -403,17 +47,5 @@ public interface ChromiumBrowser {
|
|||||||
}
|
}
|
||||||
void startTracing(Page page, StartTracingOptions options);
|
void startTracing(Page page, StartTracingOptions options);
|
||||||
byte[] stopTracing();
|
byte[] stopTracing();
|
||||||
void close();
|
|
||||||
List<BrowserContext> contexts();
|
|
||||||
boolean isConnected();
|
|
||||||
default BrowserContext newContext() {
|
|
||||||
return newContext(null);
|
|
||||||
}
|
|
||||||
BrowserContext newContext(NewContextOptions options);
|
|
||||||
default Page newPage() {
|
|
||||||
return newPage(null);
|
|
||||||
}
|
|
||||||
Page newPage(NewPageOptions options);
|
|
||||||
String version();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,83 +20,8 @@ import java.util.*;
|
|||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
public interface ChromiumBrowserContext {
|
public interface ChromiumBrowserContext {
|
||||||
class GrantPermissionsOptions {
|
|
||||||
public String origin;
|
|
||||||
|
|
||||||
public GrantPermissionsOptions withOrigin(String origin) {
|
|
||||||
this.origin = origin;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
class Geolocation {
|
|
||||||
public int latitude;
|
|
||||||
public int longitude;
|
|
||||||
public Integer accuracy;
|
|
||||||
|
|
||||||
public Geolocation withLatitude(int latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withLongitude(int longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withAccuracy(Integer accuracy) {
|
|
||||||
this.accuracy = accuracy;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
class HTTPCredentials {
|
|
||||||
public String username;
|
|
||||||
public String password;
|
|
||||||
|
|
||||||
public HTTPCredentials withUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public HTTPCredentials withPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<Page> backgroundPages();
|
List<Page> backgroundPages();
|
||||||
CDPSession newCDPSession(Page page);
|
CDPSession newCDPSession(Page page);
|
||||||
List<Worker> serviceWorkers();
|
List<Worker> serviceWorkers();
|
||||||
void close();
|
|
||||||
void addCookies(List<Object> cookies);
|
|
||||||
default void addInitScript(String script) {
|
|
||||||
addInitScript(script, null);
|
|
||||||
}
|
|
||||||
void addInitScript(String script, Object arg);
|
|
||||||
Browser browser();
|
|
||||||
void clearCookies();
|
|
||||||
void clearPermissions();
|
|
||||||
default List<Object> cookies() {
|
|
||||||
return cookies(null);
|
|
||||||
}
|
|
||||||
List<Object> cookies(String urls);
|
|
||||||
void exposeBinding(String name, String playwrightBinding);
|
|
||||||
void exposeFunction(String name, String playwrightFunction);
|
|
||||||
default void grantPermissions(List<String> permissions) {
|
|
||||||
grantPermissions(permissions, null);
|
|
||||||
}
|
|
||||||
void grantPermissions(List<String> permissions, GrantPermissionsOptions options);
|
|
||||||
Page newPage();
|
|
||||||
List<Page> pages();
|
|
||||||
void route(String url, BiConsumer<Route, Request> handler);
|
|
||||||
void setDefaultNavigationTimeout(int timeout);
|
|
||||||
void setDefaultTimeout(int timeout);
|
|
||||||
void setExtraHTTPHeaders(Map<String, String> headers);
|
|
||||||
void setGeolocation(Geolocation geolocation);
|
|
||||||
void setHTTPCredentials(String username, String password);
|
|
||||||
void setOffline(boolean offline);
|
|
||||||
default void unroute(String url) {
|
|
||||||
unroute(url, null);
|
|
||||||
}
|
|
||||||
void unroute(String url, BiConsumer<Route, Request> handler);
|
|
||||||
default Object waitForEvent(String event) {
|
|
||||||
return waitForEvent(event, null);
|
|
||||||
}
|
|
||||||
Object waitForEvent(String event, String optionsOrPredicate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,18 +443,5 @@ public interface ElementHandle {
|
|||||||
return waitForSelector(selector, null);
|
return waitForSelector(selector, null);
|
||||||
}
|
}
|
||||||
ElementHandle waitForSelector(String selector, WaitForSelectorOptions options);
|
ElementHandle waitForSelector(String selector, WaitForSelectorOptions options);
|
||||||
ElementHandle asElement();
|
|
||||||
void dispose();
|
|
||||||
default Object evaluate(String pageFunction) {
|
|
||||||
return evaluate(pageFunction, null);
|
|
||||||
}
|
|
||||||
Object evaluate(String pageFunction, Object arg);
|
|
||||||
default JSHandle evaluateHandle(String pageFunction) {
|
|
||||||
return evaluateHandle(pageFunction, null);
|
|
||||||
}
|
|
||||||
JSHandle evaluateHandle(String pageFunction, Object arg);
|
|
||||||
Map<String, JSHandle> getProperties();
|
|
||||||
JSHandle getProperty(String propertyName);
|
|
||||||
Object jsonValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,373 +20,5 @@ import java.util.*;
|
|||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
public interface FirefoxBrowser {
|
public interface FirefoxBrowser {
|
||||||
class NewContextOptions {
|
|
||||||
public enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
|
||||||
public class Geolocation {
|
|
||||||
public double latitude;
|
|
||||||
public double longitude;
|
|
||||||
public double accuracy;
|
|
||||||
|
|
||||||
Geolocation() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Geolocation withLatitude(double latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withLongitude(double longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withAccuracy(double accuracy) {
|
|
||||||
this.accuracy = accuracy;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class HttpCredentials {
|
|
||||||
public String username;
|
|
||||||
public String password;
|
|
||||||
|
|
||||||
HttpCredentials() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpCredentials withUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public HttpCredentials withPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class VideoSize {
|
|
||||||
public int width;
|
|
||||||
public int height;
|
|
||||||
|
|
||||||
VideoSize() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VideoSize withWidth(int width) {
|
|
||||||
this.width = width;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize withHeight(int height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Boolean acceptDownloads;
|
|
||||||
public Boolean ignoreHTTPSErrors;
|
|
||||||
public Boolean bypassCSP;
|
|
||||||
public Page.Viewport viewport;
|
|
||||||
public String userAgent;
|
|
||||||
public Integer deviceScaleFactor;
|
|
||||||
public Boolean isMobile;
|
|
||||||
public Boolean hasTouch;
|
|
||||||
public Boolean javaScriptEnabled;
|
|
||||||
public String timezoneId;
|
|
||||||
public Geolocation geolocation;
|
|
||||||
public String locale;
|
|
||||||
public List<String> permissions;
|
|
||||||
public Map<String, String> extraHTTPHeaders;
|
|
||||||
public Boolean offline;
|
|
||||||
public HttpCredentials httpCredentials;
|
|
||||||
public ColorScheme colorScheme;
|
|
||||||
public Logger logger;
|
|
||||||
public String relativeArtifactsPath;
|
|
||||||
public Boolean recordVideos;
|
|
||||||
public VideoSize videoSize;
|
|
||||||
public Boolean recordTrace;
|
|
||||||
|
|
||||||
public NewContextOptions withAcceptDownloads(Boolean acceptDownloads) {
|
|
||||||
this.acceptDownloads = acceptDownloads;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withIgnoreHTTPSErrors(Boolean ignoreHTTPSErrors) {
|
|
||||||
this.ignoreHTTPSErrors = ignoreHTTPSErrors;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withBypassCSP(Boolean bypassCSP) {
|
|
||||||
this.bypassCSP = bypassCSP;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withViewport(int width, int height) {
|
|
||||||
this.viewport = new Page.Viewport(width, height);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withUserAgent(String userAgent) {
|
|
||||||
this.userAgent = userAgent;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withDeviceScaleFactor(Integer deviceScaleFactor) {
|
|
||||||
this.deviceScaleFactor = deviceScaleFactor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withIsMobile(Boolean isMobile) {
|
|
||||||
this.isMobile = isMobile;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withHasTouch(Boolean hasTouch) {
|
|
||||||
this.hasTouch = hasTouch;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withJavaScriptEnabled(Boolean javaScriptEnabled) {
|
|
||||||
this.javaScriptEnabled = javaScriptEnabled;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withTimezoneId(String timezoneId) {
|
|
||||||
this.timezoneId = timezoneId;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation setGeolocation() {
|
|
||||||
this.geolocation = new Geolocation();
|
|
||||||
return this.geolocation;
|
|
||||||
}
|
|
||||||
public NewContextOptions withLocale(String locale) {
|
|
||||||
this.locale = locale;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withPermissions(List<String> permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withExtraHTTPHeaders(Map<String, String> extraHTTPHeaders) {
|
|
||||||
this.extraHTTPHeaders = extraHTTPHeaders;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withOffline(Boolean offline) {
|
|
||||||
this.offline = offline;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withHttpCredentials(String username, String password) {
|
|
||||||
this.httpCredentials = new HttpCredentials();
|
|
||||||
this.httpCredentials.username = username;
|
|
||||||
this.httpCredentials.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withColorScheme(ColorScheme colorScheme) {
|
|
||||||
this.colorScheme = colorScheme;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withLogger(Logger logger) {
|
|
||||||
this.logger = logger;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRelativeArtifactsPath(String relativeArtifactsPath) {
|
|
||||||
this.relativeArtifactsPath = relativeArtifactsPath;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRecordVideos(Boolean recordVideos) {
|
|
||||||
this.recordVideos = recordVideos;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize setVideoSize() {
|
|
||||||
this.videoSize = new VideoSize();
|
|
||||||
return this.videoSize;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRecordTrace(Boolean recordTrace) {
|
|
||||||
this.recordTrace = recordTrace;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
class NewPageOptions {
|
|
||||||
public enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
|
||||||
public class Geolocation {
|
|
||||||
public double latitude;
|
|
||||||
public double longitude;
|
|
||||||
public double accuracy;
|
|
||||||
|
|
||||||
Geolocation() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Geolocation withLatitude(double latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withLongitude(double longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withAccuracy(double accuracy) {
|
|
||||||
this.accuracy = accuracy;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class HttpCredentials {
|
|
||||||
public String username;
|
|
||||||
public String password;
|
|
||||||
|
|
||||||
HttpCredentials() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpCredentials withUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public HttpCredentials withPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class VideoSize {
|
|
||||||
public int width;
|
|
||||||
public int height;
|
|
||||||
|
|
||||||
VideoSize() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VideoSize withWidth(int width) {
|
|
||||||
this.width = width;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize withHeight(int height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Boolean acceptDownloads;
|
|
||||||
public Boolean ignoreHTTPSErrors;
|
|
||||||
public Boolean bypassCSP;
|
|
||||||
public Page.Viewport viewport;
|
|
||||||
public String userAgent;
|
|
||||||
public Integer deviceScaleFactor;
|
|
||||||
public Boolean isMobile;
|
|
||||||
public Boolean hasTouch;
|
|
||||||
public Boolean javaScriptEnabled;
|
|
||||||
public String timezoneId;
|
|
||||||
public Geolocation geolocation;
|
|
||||||
public String locale;
|
|
||||||
public List<String> permissions;
|
|
||||||
public Map<String, String> extraHTTPHeaders;
|
|
||||||
public Boolean offline;
|
|
||||||
public HttpCredentials httpCredentials;
|
|
||||||
public ColorScheme colorScheme;
|
|
||||||
public Logger logger;
|
|
||||||
public String relativeArtifactsPath;
|
|
||||||
public Boolean recordVideos;
|
|
||||||
public VideoSize videoSize;
|
|
||||||
public Boolean recordTrace;
|
|
||||||
|
|
||||||
public NewPageOptions withAcceptDownloads(Boolean acceptDownloads) {
|
|
||||||
this.acceptDownloads = acceptDownloads;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withIgnoreHTTPSErrors(Boolean ignoreHTTPSErrors) {
|
|
||||||
this.ignoreHTTPSErrors = ignoreHTTPSErrors;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withBypassCSP(Boolean bypassCSP) {
|
|
||||||
this.bypassCSP = bypassCSP;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withViewport(int width, int height) {
|
|
||||||
this.viewport = new Page.Viewport(width, height);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withUserAgent(String userAgent) {
|
|
||||||
this.userAgent = userAgent;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withDeviceScaleFactor(Integer deviceScaleFactor) {
|
|
||||||
this.deviceScaleFactor = deviceScaleFactor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withIsMobile(Boolean isMobile) {
|
|
||||||
this.isMobile = isMobile;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withHasTouch(Boolean hasTouch) {
|
|
||||||
this.hasTouch = hasTouch;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withJavaScriptEnabled(Boolean javaScriptEnabled) {
|
|
||||||
this.javaScriptEnabled = javaScriptEnabled;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withTimezoneId(String timezoneId) {
|
|
||||||
this.timezoneId = timezoneId;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation setGeolocation() {
|
|
||||||
this.geolocation = new Geolocation();
|
|
||||||
return this.geolocation;
|
|
||||||
}
|
|
||||||
public NewPageOptions withLocale(String locale) {
|
|
||||||
this.locale = locale;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withPermissions(List<String> permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withExtraHTTPHeaders(Map<String, String> extraHTTPHeaders) {
|
|
||||||
this.extraHTTPHeaders = extraHTTPHeaders;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withOffline(Boolean offline) {
|
|
||||||
this.offline = offline;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withHttpCredentials(String username, String password) {
|
|
||||||
this.httpCredentials = new HttpCredentials();
|
|
||||||
this.httpCredentials.username = username;
|
|
||||||
this.httpCredentials.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withColorScheme(ColorScheme colorScheme) {
|
|
||||||
this.colorScheme = colorScheme;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withLogger(Logger logger) {
|
|
||||||
this.logger = logger;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRelativeArtifactsPath(String relativeArtifactsPath) {
|
|
||||||
this.relativeArtifactsPath = relativeArtifactsPath;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRecordVideos(Boolean recordVideos) {
|
|
||||||
this.recordVideos = recordVideos;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize setVideoSize() {
|
|
||||||
this.videoSize = new VideoSize();
|
|
||||||
return this.videoSize;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRecordTrace(Boolean recordTrace) {
|
|
||||||
this.recordTrace = recordTrace;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void close();
|
|
||||||
List<BrowserContext> contexts();
|
|
||||||
boolean isConnected();
|
|
||||||
default BrowserContext newContext() {
|
|
||||||
return newContext(null);
|
|
||||||
}
|
|
||||||
BrowserContext newContext(NewContextOptions options);
|
|
||||||
default Page newPage() {
|
|
||||||
return newPage(null);
|
|
||||||
}
|
|
||||||
Page newPage(NewPageOptions options);
|
|
||||||
String version();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,373 +20,5 @@ import java.util.*;
|
|||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
public interface WebKitBrowser {
|
public interface WebKitBrowser {
|
||||||
class NewContextOptions {
|
|
||||||
public enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
|
||||||
public class Geolocation {
|
|
||||||
public double latitude;
|
|
||||||
public double longitude;
|
|
||||||
public double accuracy;
|
|
||||||
|
|
||||||
Geolocation() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Geolocation withLatitude(double latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withLongitude(double longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withAccuracy(double accuracy) {
|
|
||||||
this.accuracy = accuracy;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class HttpCredentials {
|
|
||||||
public String username;
|
|
||||||
public String password;
|
|
||||||
|
|
||||||
HttpCredentials() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpCredentials withUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public HttpCredentials withPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class VideoSize {
|
|
||||||
public int width;
|
|
||||||
public int height;
|
|
||||||
|
|
||||||
VideoSize() {
|
|
||||||
}
|
|
||||||
public NewContextOptions done() {
|
|
||||||
return NewContextOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VideoSize withWidth(int width) {
|
|
||||||
this.width = width;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize withHeight(int height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Boolean acceptDownloads;
|
|
||||||
public Boolean ignoreHTTPSErrors;
|
|
||||||
public Boolean bypassCSP;
|
|
||||||
public Page.Viewport viewport;
|
|
||||||
public String userAgent;
|
|
||||||
public Integer deviceScaleFactor;
|
|
||||||
public Boolean isMobile;
|
|
||||||
public Boolean hasTouch;
|
|
||||||
public Boolean javaScriptEnabled;
|
|
||||||
public String timezoneId;
|
|
||||||
public Geolocation geolocation;
|
|
||||||
public String locale;
|
|
||||||
public List<String> permissions;
|
|
||||||
public Map<String, String> extraHTTPHeaders;
|
|
||||||
public Boolean offline;
|
|
||||||
public HttpCredentials httpCredentials;
|
|
||||||
public ColorScheme colorScheme;
|
|
||||||
public Logger logger;
|
|
||||||
public String relativeArtifactsPath;
|
|
||||||
public Boolean recordVideos;
|
|
||||||
public VideoSize videoSize;
|
|
||||||
public Boolean recordTrace;
|
|
||||||
|
|
||||||
public NewContextOptions withAcceptDownloads(Boolean acceptDownloads) {
|
|
||||||
this.acceptDownloads = acceptDownloads;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withIgnoreHTTPSErrors(Boolean ignoreHTTPSErrors) {
|
|
||||||
this.ignoreHTTPSErrors = ignoreHTTPSErrors;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withBypassCSP(Boolean bypassCSP) {
|
|
||||||
this.bypassCSP = bypassCSP;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withViewport(int width, int height) {
|
|
||||||
this.viewport = new Page.Viewport(width, height);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withUserAgent(String userAgent) {
|
|
||||||
this.userAgent = userAgent;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withDeviceScaleFactor(Integer deviceScaleFactor) {
|
|
||||||
this.deviceScaleFactor = deviceScaleFactor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withIsMobile(Boolean isMobile) {
|
|
||||||
this.isMobile = isMobile;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withHasTouch(Boolean hasTouch) {
|
|
||||||
this.hasTouch = hasTouch;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withJavaScriptEnabled(Boolean javaScriptEnabled) {
|
|
||||||
this.javaScriptEnabled = javaScriptEnabled;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withTimezoneId(String timezoneId) {
|
|
||||||
this.timezoneId = timezoneId;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation setGeolocation() {
|
|
||||||
this.geolocation = new Geolocation();
|
|
||||||
return this.geolocation;
|
|
||||||
}
|
|
||||||
public NewContextOptions withLocale(String locale) {
|
|
||||||
this.locale = locale;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withPermissions(List<String> permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withExtraHTTPHeaders(Map<String, String> extraHTTPHeaders) {
|
|
||||||
this.extraHTTPHeaders = extraHTTPHeaders;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withOffline(Boolean offline) {
|
|
||||||
this.offline = offline;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withHttpCredentials(String username, String password) {
|
|
||||||
this.httpCredentials = new HttpCredentials();
|
|
||||||
this.httpCredentials.username = username;
|
|
||||||
this.httpCredentials.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withColorScheme(ColorScheme colorScheme) {
|
|
||||||
this.colorScheme = colorScheme;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withLogger(Logger logger) {
|
|
||||||
this.logger = logger;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRelativeArtifactsPath(String relativeArtifactsPath) {
|
|
||||||
this.relativeArtifactsPath = relativeArtifactsPath;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRecordVideos(Boolean recordVideos) {
|
|
||||||
this.recordVideos = recordVideos;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize setVideoSize() {
|
|
||||||
this.videoSize = new VideoSize();
|
|
||||||
return this.videoSize;
|
|
||||||
}
|
|
||||||
public NewContextOptions withRecordTrace(Boolean recordTrace) {
|
|
||||||
this.recordTrace = recordTrace;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
class NewPageOptions {
|
|
||||||
public enum ColorScheme { DARK, LIGHT, NO_PREFERENCE }
|
|
||||||
public class Geolocation {
|
|
||||||
public double latitude;
|
|
||||||
public double longitude;
|
|
||||||
public double accuracy;
|
|
||||||
|
|
||||||
Geolocation() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Geolocation withLatitude(double latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withLongitude(double longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation withAccuracy(double accuracy) {
|
|
||||||
this.accuracy = accuracy;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class HttpCredentials {
|
|
||||||
public String username;
|
|
||||||
public String password;
|
|
||||||
|
|
||||||
HttpCredentials() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpCredentials withUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public HttpCredentials withPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class VideoSize {
|
|
||||||
public int width;
|
|
||||||
public int height;
|
|
||||||
|
|
||||||
VideoSize() {
|
|
||||||
}
|
|
||||||
public NewPageOptions done() {
|
|
||||||
return NewPageOptions.this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VideoSize withWidth(int width) {
|
|
||||||
this.width = width;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize withHeight(int height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Boolean acceptDownloads;
|
|
||||||
public Boolean ignoreHTTPSErrors;
|
|
||||||
public Boolean bypassCSP;
|
|
||||||
public Page.Viewport viewport;
|
|
||||||
public String userAgent;
|
|
||||||
public Integer deviceScaleFactor;
|
|
||||||
public Boolean isMobile;
|
|
||||||
public Boolean hasTouch;
|
|
||||||
public Boolean javaScriptEnabled;
|
|
||||||
public String timezoneId;
|
|
||||||
public Geolocation geolocation;
|
|
||||||
public String locale;
|
|
||||||
public List<String> permissions;
|
|
||||||
public Map<String, String> extraHTTPHeaders;
|
|
||||||
public Boolean offline;
|
|
||||||
public HttpCredentials httpCredentials;
|
|
||||||
public ColorScheme colorScheme;
|
|
||||||
public Logger logger;
|
|
||||||
public String relativeArtifactsPath;
|
|
||||||
public Boolean recordVideos;
|
|
||||||
public VideoSize videoSize;
|
|
||||||
public Boolean recordTrace;
|
|
||||||
|
|
||||||
public NewPageOptions withAcceptDownloads(Boolean acceptDownloads) {
|
|
||||||
this.acceptDownloads = acceptDownloads;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withIgnoreHTTPSErrors(Boolean ignoreHTTPSErrors) {
|
|
||||||
this.ignoreHTTPSErrors = ignoreHTTPSErrors;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withBypassCSP(Boolean bypassCSP) {
|
|
||||||
this.bypassCSP = bypassCSP;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withViewport(int width, int height) {
|
|
||||||
this.viewport = new Page.Viewport(width, height);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withUserAgent(String userAgent) {
|
|
||||||
this.userAgent = userAgent;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withDeviceScaleFactor(Integer deviceScaleFactor) {
|
|
||||||
this.deviceScaleFactor = deviceScaleFactor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withIsMobile(Boolean isMobile) {
|
|
||||||
this.isMobile = isMobile;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withHasTouch(Boolean hasTouch) {
|
|
||||||
this.hasTouch = hasTouch;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withJavaScriptEnabled(Boolean javaScriptEnabled) {
|
|
||||||
this.javaScriptEnabled = javaScriptEnabled;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withTimezoneId(String timezoneId) {
|
|
||||||
this.timezoneId = timezoneId;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Geolocation setGeolocation() {
|
|
||||||
this.geolocation = new Geolocation();
|
|
||||||
return this.geolocation;
|
|
||||||
}
|
|
||||||
public NewPageOptions withLocale(String locale) {
|
|
||||||
this.locale = locale;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withPermissions(List<String> permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withExtraHTTPHeaders(Map<String, String> extraHTTPHeaders) {
|
|
||||||
this.extraHTTPHeaders = extraHTTPHeaders;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withOffline(Boolean offline) {
|
|
||||||
this.offline = offline;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withHttpCredentials(String username, String password) {
|
|
||||||
this.httpCredentials = new HttpCredentials();
|
|
||||||
this.httpCredentials.username = username;
|
|
||||||
this.httpCredentials.password = password;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withColorScheme(ColorScheme colorScheme) {
|
|
||||||
this.colorScheme = colorScheme;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withLogger(Logger logger) {
|
|
||||||
this.logger = logger;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRelativeArtifactsPath(String relativeArtifactsPath) {
|
|
||||||
this.relativeArtifactsPath = relativeArtifactsPath;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRecordVideos(Boolean recordVideos) {
|
|
||||||
this.recordVideos = recordVideos;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public VideoSize setVideoSize() {
|
|
||||||
this.videoSize = new VideoSize();
|
|
||||||
return this.videoSize;
|
|
||||||
}
|
|
||||||
public NewPageOptions withRecordTrace(Boolean recordTrace) {
|
|
||||||
this.recordTrace = recordTrace;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void close();
|
|
||||||
List<BrowserContext> contexts();
|
|
||||||
boolean isConnected();
|
|
||||||
default BrowserContext newContext() {
|
|
||||||
return newContext(null);
|
|
||||||
}
|
|
||||||
BrowserContext newContext(NewContextOptions options);
|
|
||||||
default Page newPage() {
|
|
||||||
return newPage(null);
|
|
||||||
}
|
|
||||||
Page newPage(NewPageOptions options);
|
|
||||||
String version();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user