001package Torello.Browser; 002 003import java.util.*; 004import javax.json.*; 005import javax.json.stream.*; 006import java.io.*; 007 008import java.lang.reflect.Method; 009import java.lang.reflect.Parameter; 010import java.util.function.Function; 011 012import Torello.Java.Additional.*; 013import Torello.Java.JSON.*; 014 015import static Torello.Java.JSON.JFlag.*; 016 017import Torello.Java.StrCmpr; 018import Torello.JavaDoc.StaticFunctional; 019import Torello.JavaDoc.JDHeaderBackgroundImg; 020import Torello.JavaDoc.Excuse; 021 022/** 023 * <SPAN CLASS=COPIEDJDK><B>Actions and events related to the inspected page belong to the page domain.</B></SPAN> 024 * 025 * <EMBED CLASS='external-html' DATA-FILE-ID=CODE_GEN_NOTE> 026 */ 027@StaticFunctional(Excused={"counter"}, Excuses={Excuse.CONFIGURATION}) 028@JDHeaderBackgroundImg(EmbedTagFileID="WOOD_PLANK_NOTE") 029public class Page 030{ 031 // ******************************************************************************************** 032 // ******************************************************************************************** 033 // Class Header Stuff 034 // ******************************************************************************************** 035 // ******************************************************************************************** 036 037 038 // No Pubic Constructors 039 private Page () { } 040 041 // These two Vector's are used by all the "Methods" exported by this class. java.lang.reflect 042 // is used to generate the JSON String's. It saves thousands of lines of Auto-Generated Code. 043 private static final Map<String, Vector<String>> parameterNames = new HashMap<>(); 044 private static final Map<String, Vector<Class<?>>> parameterTypes = new HashMap<>(); 045 046 // Some Methods do not take any parameters - for instance all the "enable()" and "disable()" 047 // I simply could not get ride of RAW-TYPES and UNCHECKED warnings... so there are now, 048 // offically, two empty-vectors. One for String's, and the other for Classes. 049 050 private static final Vector<String> EMPTY_VEC_STR = new Vector<>(); 051 private static final Vector<Class<?>> EMPTY_VEC_CLASS = new Vector<>(); 052 053 static 054 { 055 for (Method m : Page.class.getMethods()) 056 { 057 // This doesn't work! The parameter names are all "arg0" ... "argN" 058 // It works for java.lang.reflect.Field, BUT NOT java.lang.reflect.Parameter! 059 // 060 // Vector<String> parameterNamesList = new Vector<>(); -- NOPE! 061 062 Vector<Class<?>> parameterTypesList = new Vector<>(); 063 064 for (Parameter p : m.getParameters()) parameterTypesList.add(p.getType()); 065 066 parameterTypes.put( 067 m.getName(), 068 (parameterTypesList.size() > 0) ? parameterTypesList : EMPTY_VEC_CLASS 069 ); 070 } 071 } 072 073 static 074 { 075 Vector<String> v = null; 076 077 v = new Vector<String>(1); 078 parameterNames.put("addScriptToEvaluateOnLoad", v); 079 Collections.addAll(v, new String[] 080 { "scriptSource", }); 081 082 v = new Vector<String>(3); 083 parameterNames.put("addScriptToEvaluateOnNewDocument", v); 084 Collections.addAll(v, new String[] 085 { "source", "worldName", "includeCommandLineAPI", }); 086 087 parameterNames.put("bringToFront", EMPTY_VEC_STR); 088 089 v = new Vector<String>(5); 090 parameterNames.put("captureScreenshot", v); 091 Collections.addAll(v, new String[] 092 { "format", "quality", "clip", "fromSurface", "captureBeyondViewport", }); 093 094 v = new Vector<String>(1); 095 parameterNames.put("captureSnapshot", v); 096 Collections.addAll(v, new String[] 097 { "format", }); 098 099 parameterNames.put("clearDeviceMetricsOverride", EMPTY_VEC_STR); 100 101 parameterNames.put("clearDeviceOrientationOverride", EMPTY_VEC_STR); 102 103 parameterNames.put("clearGeolocationOverride", EMPTY_VEC_STR); 104 105 v = new Vector<String>(3); 106 parameterNames.put("createIsolatedWorld", v); 107 Collections.addAll(v, new String[] 108 { "frameId", "worldName", "grantUniveralAccess", }); 109 110 v = new Vector<String>(2); 111 parameterNames.put("deleteCookie", v); 112 Collections.addAll(v, new String[] 113 { "cookieName", "url", }); 114 115 parameterNames.put("disable", EMPTY_VEC_STR); 116 117 parameterNames.put("enable", EMPTY_VEC_STR); 118 119 parameterNames.put("getAppManifest", EMPTY_VEC_STR); 120 121 parameterNames.put("getInstallabilityErrors", EMPTY_VEC_STR); 122 123 parameterNames.put("getManifestIcons", EMPTY_VEC_STR); 124 125 parameterNames.put("getAppId", EMPTY_VEC_STR); 126 127 parameterNames.put("getCookies", EMPTY_VEC_STR); 128 129 parameterNames.put("getFrameTree", EMPTY_VEC_STR); 130 131 parameterNames.put("getLayoutMetrics", EMPTY_VEC_STR); 132 133 parameterNames.put("getNavigationHistory", EMPTY_VEC_STR); 134 135 parameterNames.put("resetNavigationHistory", EMPTY_VEC_STR); 136 137 v = new Vector<String>(2); 138 parameterNames.put("getResourceContent", v); 139 Collections.addAll(v, new String[] 140 { "frameId", "url", }); 141 142 parameterNames.put("getResourceTree", EMPTY_VEC_STR); 143 144 v = new Vector<String>(2); 145 parameterNames.put("handleJavaScriptDialog", v); 146 Collections.addAll(v, new String[] 147 { "accept", "promptText", }); 148 149 v = new Vector<String>(5); 150 parameterNames.put("navigate", v); 151 Collections.addAll(v, new String[] 152 { "url", "referrer", "transitionType", "frameId", "referrerPolicy", }); 153 154 v = new Vector<String>(1); 155 parameterNames.put("navigateToHistoryEntry", v); 156 Collections.addAll(v, new String[] 157 { "entryId", }); 158 159 v = new Vector<String>(16); 160 parameterNames.put("printToPDF", v); 161 Collections.addAll(v, new String[] 162 { "landscape", "displayHeaderFooter", "printBackground", "scale", "paperWidth", "paperHeight", "marginTop", "marginBottom", "marginLeft", "marginRight", "pageRanges", "ignoreInvalidPageRanges", "headerTemplate", "footerTemplate", "preferCSSPageSize", "transferMode", }); 163 164 v = new Vector<String>(2); 165 parameterNames.put("reload", v); 166 Collections.addAll(v, new String[] 167 { "ignoreCache", "scriptToEvaluateOnLoad", }); 168 169 v = new Vector<String>(1); 170 parameterNames.put("removeScriptToEvaluateOnLoad", v); 171 Collections.addAll(v, new String[] 172 { "identifier", }); 173 174 v = new Vector<String>(1); 175 parameterNames.put("removeScriptToEvaluateOnNewDocument", v); 176 Collections.addAll(v, new String[] 177 { "identifier", }); 178 179 v = new Vector<String>(1); 180 parameterNames.put("screencastFrameAck", v); 181 Collections.addAll(v, new String[] 182 { "sessionId", }); 183 184 v = new Vector<String>(5); 185 parameterNames.put("searchInResource", v); 186 Collections.addAll(v, new String[] 187 { "frameId", "url", "query", "caseSensitive", "isRegex", }); 188 189 v = new Vector<String>(1); 190 parameterNames.put("setAdBlockingEnabled", v); 191 Collections.addAll(v, new String[] 192 { "enabled", }); 193 194 v = new Vector<String>(1); 195 parameterNames.put("setBypassCSP", v); 196 Collections.addAll(v, new String[] 197 { "enabled", }); 198 199 v = new Vector<String>(1); 200 parameterNames.put("getPermissionsPolicyState", v); 201 Collections.addAll(v, new String[] 202 { "frameId", }); 203 204 v = new Vector<String>(1); 205 parameterNames.put("getOriginTrials", v); 206 Collections.addAll(v, new String[] 207 { "frameId", }); 208 209 v = new Vector<String>(12); 210 parameterNames.put("setDeviceMetricsOverride", v); 211 Collections.addAll(v, new String[] 212 { "width", "height", "deviceScaleFactor", "mobile", "scale", "screenWidth", "screenHeight", "positionX", "positionY", "dontSetVisibleSize", "screenOrientation", "viewport", }); 213 214 v = new Vector<String>(3); 215 parameterNames.put("setDeviceOrientationOverride", v); 216 Collections.addAll(v, new String[] 217 { "alpha", "beta", "gamma", }); 218 219 v = new Vector<String>(1); 220 parameterNames.put("setFontFamilies", v); 221 Collections.addAll(v, new String[] 222 { "fontFamilies", }); 223 224 v = new Vector<String>(1); 225 parameterNames.put("setFontSizes", v); 226 Collections.addAll(v, new String[] 227 { "fontSizes", }); 228 229 v = new Vector<String>(2); 230 parameterNames.put("setDocumentContent", v); 231 Collections.addAll(v, new String[] 232 { "frameId", "html", }); 233 234 v = new Vector<String>(2); 235 parameterNames.put("setDownloadBehavior", v); 236 Collections.addAll(v, new String[] 237 { "behavior", "downloadPath", }); 238 239 v = new Vector<String>(3); 240 parameterNames.put("setGeolocationOverride", v); 241 Collections.addAll(v, new String[] 242 { "latitude", "longitude", "accuracy", }); 243 244 v = new Vector<String>(1); 245 parameterNames.put("setLifecycleEventsEnabled", v); 246 Collections.addAll(v, new String[] 247 { "enabled", }); 248 249 v = new Vector<String>(2); 250 parameterNames.put("setTouchEmulationEnabled", v); 251 Collections.addAll(v, new String[] 252 { "enabled", "configuration", }); 253 254 v = new Vector<String>(5); 255 parameterNames.put("startScreencast", v); 256 Collections.addAll(v, new String[] 257 { "format", "quality", "maxWidth", "maxHeight", "everyNthFrame", }); 258 259 parameterNames.put("stopLoading", EMPTY_VEC_STR); 260 261 parameterNames.put("crash", EMPTY_VEC_STR); 262 263 parameterNames.put("close", EMPTY_VEC_STR); 264 265 v = new Vector<String>(1); 266 parameterNames.put("setWebLifecycleState", v); 267 Collections.addAll(v, new String[] 268 { "state", }); 269 270 parameterNames.put("stopScreencast", EMPTY_VEC_STR); 271 272 v = new Vector<String>(1); 273 parameterNames.put("produceCompilationCache", v); 274 Collections.addAll(v, new String[] 275 { "scripts", }); 276 277 v = new Vector<String>(2); 278 parameterNames.put("addCompilationCache", v); 279 Collections.addAll(v, new String[] 280 { "url", "data", }); 281 282 parameterNames.put("clearCompilationCache", EMPTY_VEC_STR); 283 284 v = new Vector<String>(2); 285 parameterNames.put("generateTestReport", v); 286 Collections.addAll(v, new String[] 287 { "message", "group", }); 288 289 parameterNames.put("waitForDebugger", EMPTY_VEC_STR); 290 291 v = new Vector<String>(1); 292 parameterNames.put("setInterceptFileChooserDialog", v); 293 Collections.addAll(v, new String[] 294 { "enabled", }); 295 } 296 297 298 // ******************************************************************************************** 299 // ******************************************************************************************** 300 // Types - Static Inner Classes 301 // ******************************************************************************************** 302 // ******************************************************************************************** 303 304 // public static class FrameId => String 305 306 // public static class ScriptIdentifier => String 307 308 /** 309 * Indicates whether a frame has been identified as an ad. 310 * <BR /> 311 * <BR /><B>EXPERIMENTAL</B> 312 */ 313 public static final String[] AdFrameType = 314 { "none", "child", "root", }; 315 316 /** 317 * <CODE>[No Description Provided by Google]</CODE> 318 * <BR /> 319 * <BR /><B>EXPERIMENTAL</B> 320 */ 321 public static final String[] AdFrameExplanation = 322 { "ParentIsAd", "CreatedByAdScript", "MatchedBlockingRule", }; 323 324 /** 325 * Indicates whether the frame is a secure context and why it is the case. 326 * <BR /> 327 * <BR /><B>EXPERIMENTAL</B> 328 */ 329 public static final String[] SecureContextType = 330 { "Secure", "SecureLocalhost", "InsecureScheme", "InsecureAncestor", }; 331 332 /** 333 * Indicates whether the frame is cross-origin isolated and why it is the case. 334 * <BR /> 335 * <BR /><B>EXPERIMENTAL</B> 336 */ 337 public static final String[] CrossOriginIsolatedContextType = 338 { "Isolated", "NotIsolated", "NotIsolatedFeatureDisabled", }; 339 340 /** 341 * <CODE>[No Description Provided by Google]</CODE> 342 * <BR /> 343 * <BR /><B>EXPERIMENTAL</B> 344 */ 345 public static final String[] GatedAPIFeatures = 346 { 347 "SharedArrayBuffers", "SharedArrayBuffersTransferAllowed", "PerformanceMeasureMemory", 348 "PerformanceProfile", 349 }; 350 351 /** 352 * All Permissions Policy features. This enum should match the one defined 353 * in third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5. 354 * <BR /> 355 * <BR /><B>EXPERIMENTAL</B> 356 */ 357 public static final String[] PermissionsPolicyFeature = 358 { 359 "accelerometer", "ambient-light-sensor", "attribution-reporting", "autoplay", "camera", 360 "ch-dpr", "ch-device-memory", "ch-downlink", "ch-ect", "ch-prefers-color-scheme", "ch-rtt", 361 "ch-ua", "ch-ua-arch", "ch-ua-bitness", "ch-ua-platform", "ch-ua-model", "ch-ua-mobile", 362 "ch-ua-full-version", "ch-ua-platform-version", "ch-ua-reduced", "ch-viewport-height", 363 "ch-viewport-width", "ch-width", "clipboard-read", "clipboard-write", 364 "cross-origin-isolated", "direct-sockets", "display-capture", "document-domain", 365 "encrypted-media", "execution-while-out-of-viewport", "execution-while-not-rendered", 366 "focus-without-user-activation", "fullscreen", "frobulate", "gamepad", "geolocation", 367 "gyroscope", "hid", "idle-detection", "interest-cohort", "keyboard-map", "magnetometer", 368 "microphone", "midi", "otp-credentials", "payment", "picture-in-picture", 369 "publickey-credentials-get", "screen-wake-lock", "serial", "shared-autofill", 370 "storage-access-api", "sync-xhr", "trust-token-redemption", "usb", "vertical-scroll", 371 "web-share", "window-placement", "xr-spatial-tracking", 372 }; 373 374 /** 375 * Reason for a permissions policy feature to be disabled. 376 * <BR /> 377 * <BR /><B>EXPERIMENTAL</B> 378 */ 379 public static final String[] PermissionsPolicyBlockReason = 380 { "Header", "IframeAttribute", }; 381 382 /** 383 * Origin Trial(https://www.chromium.org/blink/origin-trials) support. 384 * Status for an Origin Trial token. 385 * <BR /> 386 * <BR /><B>EXPERIMENTAL</B> 387 */ 388 public static final String[] OriginTrialTokenStatus = 389 { 390 "Success", "NotSupported", "Insecure", "Expired", "WrongOrigin", "InvalidSignature", 391 "Malformed", "WrongVersion", "FeatureDisabled", "TokenDisabled", "FeatureDisabledForUser", 392 "UnknownTrial", 393 }; 394 395 /** 396 * Status for an Origin Trial. 397 * <BR /> 398 * <BR /><B>EXPERIMENTAL</B> 399 */ 400 public static final String[] OriginTrialStatus = 401 { "Enabled", "ValidTokenNotProvided", "OSNotSupported", "TrialNotAllowed", }; 402 403 /** 404 * <CODE>[No Description Provided by Google]</CODE> 405 * <BR /> 406 * <BR /><B>EXPERIMENTAL</B> 407 */ 408 public static final String[] OriginTrialUsageRestriction = 409 { "None", "Subset", }; 410 411 /** Transition type. */ 412 public static final String[] TransitionType = 413 { 414 "link", "typed", "address_bar", "auto_bookmark", "auto_subframe", "manual_subframe", 415 "generated", "auto_toplevel", "form_submit", "reload", "keyword", "keyword_generated", 416 "other", 417 }; 418 419 /** Javascript dialog type. */ 420 public static final String[] DialogType = 421 { "alert", "confirm", "prompt", "beforeunload", }; 422 423 /** 424 * <CODE>[No Description Provided by Google]</CODE> 425 * <BR /> 426 * <BR /><B>EXPERIMENTAL</B> 427 */ 428 public static final String[] ClientNavigationReason = 429 { 430 "formSubmissionGet", "formSubmissionPost", "httpHeaderRefresh", "scriptInitiated", 431 "metaTagRefresh", "pageBlockInterstitial", "reload", "anchorClick", 432 }; 433 434 /** 435 * <CODE>[No Description Provided by Google]</CODE> 436 * <BR /> 437 * <BR /><B>EXPERIMENTAL</B> 438 */ 439 public static final String[] ClientNavigationDisposition = 440 { "currentTab", "newTab", "newWindow", "download", }; 441 442 /** 443 * The referring-policy used for the navigation. 444 * <BR /> 445 * <BR /><B>EXPERIMENTAL</B> 446 */ 447 public static final String[] ReferrerPolicy = 448 { 449 "noReferrer", "noReferrerWhenDowngrade", "origin", "originWhenCrossOrigin", "sameOrigin", 450 "strictOrigin", "strictOriginWhenCrossOrigin", "unsafeUrl", 451 }; 452 453 /** 454 * The type of a frameNavigated event. 455 * <BR /> 456 * <BR /><B>EXPERIMENTAL</B> 457 */ 458 public static final String[] NavigationType = 459 { "Navigation", "BackForwardCacheRestore", }; 460 461 /** 462 * List of not restored reasons for back-forward cache. 463 * <BR /> 464 * <BR /><B>EXPERIMENTAL</B> 465 */ 466 public static final String[] BackForwardCacheNotRestoredReason = 467 { 468 "NotMainFrame", "BackForwardCacheDisabled", "RelatedActiveContentsExist", 469 "HTTPStatusNotOK", "SchemeNotHTTPOrHTTPS", "Loading", "WasGrantedMediaAccess", 470 "DisableForRenderFrameHostCalled", "DomainNotAllowed", "HTTPMethodNotGET", 471 "SubframeIsNavigating", "Timeout", "CacheLimit", "JavaScriptExecution", 472 "RendererProcessKilled", "RendererProcessCrashed", "GrantedMediaStreamAccess", 473 "SchedulerTrackedFeatureUsed", "ConflictingBrowsingInstance", "CacheFlushed", 474 "ServiceWorkerVersionActivation", "SessionRestored", "ServiceWorkerPostMessage", 475 "EnteredBackForwardCacheBeforeServiceWorkerHostAdded", "RenderFrameHostReused_SameSite", 476 "RenderFrameHostReused_CrossSite", "ServiceWorkerClaim", "IgnoreEventAndEvict", 477 "HaveInnerContents", "TimeoutPuttingInCache", "BackForwardCacheDisabledByLowMemory", 478 "BackForwardCacheDisabledByCommandLine", "NetworkRequestDatapipeDrainedAsBytesConsumer", 479 "NetworkRequestRedirected", "NetworkRequestTimeout", "NetworkExceedsBufferLimit", 480 "NavigationCancelledWhileRestoring", "NotMostRecentNavigationEntry", 481 "BackForwardCacheDisabledForPrerender", "UserAgentOverrideDiffers", "ForegroundCacheLimit", 482 "BrowsingInstanceNotSwapped", "BackForwardCacheDisabledForDelegate", 483 "OptInUnloadHeaderNotPresent", "UnloadHandlerExistsInMainFrame", 484 "UnloadHandlerExistsInSubFrame", "ServiceWorkerUnregistration", "CacheControlNoStore", 485 "CacheControlNoStoreCookieModified", "CacheControlNoStoreHTTPOnlyCookieModified", 486 "NoResponseHead", "Unknown", "ActivationNavigationsDisallowedForBug1234857", "WebSocket", 487 "WebTransport", "WebRTC", "MainResourceHasCacheControlNoStore", 488 "MainResourceHasCacheControlNoCache", "SubresourceHasCacheControlNoStore", 489 "SubresourceHasCacheControlNoCache", "ContainsPlugins", "DocumentLoaded", 490 "DedicatedWorkerOrWorklet", "OutstandingNetworkRequestOthers", 491 "OutstandingIndexedDBTransaction", "RequestedNotificationsPermission", 492 "RequestedMIDIPermission", "RequestedAudioCapturePermission", 493 "RequestedVideoCapturePermission", "RequestedBackForwardCacheBlockedSensors", 494 "RequestedBackgroundWorkPermission", "BroadcastChannel", "IndexedDBConnection", "WebXR", 495 "SharedWorker", "WebLocks", "WebHID", "WebShare", "RequestedStorageAccessGrant", "WebNfc", 496 "OutstandingNetworkRequestFetch", "OutstandingNetworkRequestXHR", "AppBanner", "Printing", 497 "WebDatabase", "PictureInPicture", "Portal", "SpeechRecognizer", "IdleManager", 498 "PaymentManager", "SpeechSynthesis", "KeyboardLock", "WebOTPService", 499 "OutstandingNetworkRequestDirectSocket", "InjectedJavascript", "InjectedStyleSheet", 500 "Dummy", "ContentSecurityHandler", "ContentWebAuthenticationAPI", "ContentFileChooser", 501 "ContentSerial", "ContentFileSystemAccess", "ContentMediaDevicesDispatcherHost", 502 "ContentWebBluetooth", "ContentWebUSB", "ContentMediaSession", 503 "ContentMediaSessionService", "EmbedderPopupBlockerTabHelper", 504 "EmbedderSafeBrowsingTriggeredPopupBlocker", "EmbedderSafeBrowsingThreatDetails", 505 "EmbedderAppBannerManager", "EmbedderDomDistillerViewerSource", 506 "EmbedderDomDistillerSelfDeletingRequestDelegate", "EmbedderOomInterventionTabHelper", 507 "EmbedderOfflinePage", "EmbedderChromePasswordManagerClientBindCredentialManager", 508 "EmbedderPermissionRequestManager", "EmbedderModalDialog", "EmbedderExtensions", 509 "EmbedderExtensionMessaging", "EmbedderExtensionMessagingForOpenPort", 510 "EmbedderExtensionSentMessageToCachedFrame", 511 }; 512 513 /** 514 * Types of not restored reasons for back-forward cache. 515 * <BR /> 516 * <BR /><B>EXPERIMENTAL</B> 517 */ 518 public static final String[] BackForwardCacheNotRestoredReasonType = 519 { "SupportPending", "PageSupportNeeded", "Circumstantial", }; 520 521 /** 522 * Indicates whether a frame has been identified as an ad and why. 523 * <BR /> 524 * <BR /><B>EXPERIMENTAL</B> 525 */ 526 public static class AdFrameStatus 527 extends BaseType 528 implements java.io.Serializable 529 { 530 /** For Object Serialization. java.io.Serializable */ 531 protected static final long serialVersionUID = 1; 532 533 public boolean[] optionals() 534 { return new boolean[] { false, true, }; } 535 536 /** <CODE>[No Description Provided by Google]</CODE> */ 537 public final String adFrameType; 538 539 /** 540 * <CODE>[No Description Provided by Google]</CODE> 541 * <BR /> 542 * <BR /><B>OPTIONAL</B> 543 */ 544 public final String[] explanations; 545 546 /** 547 * Constructor 548 * 549 * @param adFrameType - 550 * 551 * @param explanations - 552 * <BR /><B>OPTIONAL</B> 553 */ 554 public AdFrameStatus(String adFrameType, String[] explanations) 555 { 556 // Exception-Check(s) to ensure that if any parameters which are not declared as 557 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 558 559 if (adFrameType == null) THROWS.throwNPE("adFrameType"); 560 561 // Exception-Check(s) to ensure that if any parameters which must adhere to a 562 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 563 564 THROWS.checkIAE("adFrameType", adFrameType, "Page.AdFrameType", Page.AdFrameType); 565 566 this.adFrameType = adFrameType; 567 this.explanations = explanations; 568 } 569 570 /** 571 * JSON Object Constructor 572 * @param jo A Json-Object having data about an instance of {@code 'AdFrameStatus'}. 573 */ 574 public AdFrameStatus (JsonObject jo) 575 { 576 this.adFrameType = ReadJSON.getString(jo, "adFrameType", false, true); 577 this.explanations = (jo.getJsonArray("explanations") == null) 578 ? null 579 : RJArrIntoStream.strArr(jo.getJsonArray("explanations"), null, 0).toArray(String[]::new); 580 581 } 582 583 584 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 585 public boolean equals(Object other) 586 { 587 if (this == other) return true; 588 if (other == null) return false; 589 if (other.getClass() != this.getClass()) return false; 590 591 AdFrameStatus o = (AdFrameStatus) other; 592 593 return 594 Objects.equals(this.adFrameType, o.adFrameType) 595 && Arrays.deepEquals(this.explanations, o.explanations); 596 } 597 598 /** Generates a Hash-Code for {@code 'this'} instance */ 599 public int hashCode() 600 { 601 return 602 Objects.hashCode(this.adFrameType) 603 + Arrays.deepHashCode(this.explanations); 604 } 605 } 606 607 /** 608 * <CODE>[No Description Provided by Google]</CODE> 609 * <BR /> 610 * <BR /><B>EXPERIMENTAL</B> 611 */ 612 public static class PermissionsPolicyBlockLocator 613 extends BaseType 614 implements java.io.Serializable 615 { 616 /** For Object Serialization. java.io.Serializable */ 617 protected static final long serialVersionUID = 1; 618 619 public boolean[] optionals() 620 { return new boolean[] { false, false, }; } 621 622 /** <CODE>[No Description Provided by Google]</CODE> */ 623 public final String frameId; 624 625 /** <CODE>[No Description Provided by Google]</CODE> */ 626 public final String blockReason; 627 628 /** 629 * Constructor 630 * 631 * @param frameId - 632 * 633 * @param blockReason - 634 */ 635 public PermissionsPolicyBlockLocator(String frameId, String blockReason) 636 { 637 // Exception-Check(s) to ensure that if any parameters which are not declared as 638 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 639 640 if (frameId == null) THROWS.throwNPE("frameId"); 641 if (blockReason == null) THROWS.throwNPE("blockReason"); 642 643 // Exception-Check(s) to ensure that if any parameters which must adhere to a 644 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 645 646 THROWS.checkIAE("blockReason", blockReason, "Page.PermissionsPolicyBlockReason", Page.PermissionsPolicyBlockReason); 647 648 this.frameId = frameId; 649 this.blockReason = blockReason; 650 } 651 652 /** 653 * JSON Object Constructor 654 * @param jo A Json-Object having data about an instance of {@code 'PermissionsPolicyBlockLocator'}. 655 */ 656 public PermissionsPolicyBlockLocator (JsonObject jo) 657 { 658 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 659 this.blockReason = ReadJSON.getString(jo, "blockReason", false, true); 660 } 661 662 663 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 664 public boolean equals(Object other) 665 { 666 if (this == other) return true; 667 if (other == null) return false; 668 if (other.getClass() != this.getClass()) return false; 669 670 PermissionsPolicyBlockLocator o = (PermissionsPolicyBlockLocator) other; 671 672 return 673 Objects.equals(this.frameId, o.frameId) 674 && Objects.equals(this.blockReason, o.blockReason); 675 } 676 677 /** Generates a Hash-Code for {@code 'this'} instance */ 678 public int hashCode() 679 { 680 return 681 Objects.hashCode(this.frameId) 682 + Objects.hashCode(this.blockReason); 683 } 684 } 685 686 /** 687 * <CODE>[No Description Provided by Google]</CODE> 688 * <BR /> 689 * <BR /><B>EXPERIMENTAL</B> 690 */ 691 public static class PermissionsPolicyFeatureState 692 extends BaseType 693 implements java.io.Serializable 694 { 695 /** For Object Serialization. java.io.Serializable */ 696 protected static final long serialVersionUID = 1; 697 698 public boolean[] optionals() 699 { return new boolean[] { false, false, true, }; } 700 701 /** <CODE>[No Description Provided by Google]</CODE> */ 702 public final String feature; 703 704 /** <CODE>[No Description Provided by Google]</CODE> */ 705 public final boolean allowed; 706 707 /** 708 * <CODE>[No Description Provided by Google]</CODE> 709 * <BR /> 710 * <BR /><B>OPTIONAL</B> 711 */ 712 public final Page.PermissionsPolicyBlockLocator locator; 713 714 /** 715 * Constructor 716 * 717 * @param feature - 718 * 719 * @param allowed - 720 * 721 * @param locator - 722 * <BR /><B>OPTIONAL</B> 723 */ 724 public PermissionsPolicyFeatureState 725 (String feature, boolean allowed, Page.PermissionsPolicyBlockLocator locator) 726 { 727 // Exception-Check(s) to ensure that if any parameters which are not declared as 728 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 729 730 if (feature == null) THROWS.throwNPE("feature"); 731 732 // Exception-Check(s) to ensure that if any parameters which must adhere to a 733 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 734 735 THROWS.checkIAE("feature", feature, "Page.PermissionsPolicyFeature", Page.PermissionsPolicyFeature); 736 737 this.feature = feature; 738 this.allowed = allowed; 739 this.locator = locator; 740 } 741 742 /** 743 * JSON Object Constructor 744 * @param jo A Json-Object having data about an instance of {@code 'PermissionsPolicyFeatureState'}. 745 */ 746 public PermissionsPolicyFeatureState (JsonObject jo) 747 { 748 this.feature = ReadJSON.getString(jo, "feature", false, true); 749 this.allowed = ReadPrimJSON.getBoolean(jo, "allowed"); 750 this.locator = ReadJSON.getObject(jo, "locator", Page.PermissionsPolicyBlockLocator.class, true, false); 751 } 752 753 754 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 755 public boolean equals(Object other) 756 { 757 if (this == other) return true; 758 if (other == null) return false; 759 if (other.getClass() != this.getClass()) return false; 760 761 PermissionsPolicyFeatureState o = (PermissionsPolicyFeatureState) other; 762 763 return 764 Objects.equals(this.feature, o.feature) 765 && (this.allowed == o.allowed) 766 && Objects.equals(this.locator, o.locator); 767 } 768 769 /** Generates a Hash-Code for {@code 'this'} instance */ 770 public int hashCode() 771 { 772 return 773 Objects.hashCode(this.feature) 774 + (this.allowed ? 1 : 0) 775 + this.locator.hashCode(); 776 } 777 } 778 779 /** 780 * <CODE>[No Description Provided by Google]</CODE> 781 * <BR /> 782 * <BR /><B>EXPERIMENTAL</B> 783 */ 784 public static class OriginTrialToken 785 extends BaseType 786 implements java.io.Serializable 787 { 788 /** For Object Serialization. java.io.Serializable */ 789 protected static final long serialVersionUID = 1; 790 791 public boolean[] optionals() 792 { return new boolean[] { false, false, false, false, false, false, }; } 793 794 /** <CODE>[No Description Provided by Google]</CODE> */ 795 public final String origin; 796 797 /** <CODE>[No Description Provided by Google]</CODE> */ 798 public final boolean matchSubDomains; 799 800 /** <CODE>[No Description Provided by Google]</CODE> */ 801 public final String trialName; 802 803 /** <CODE>[No Description Provided by Google]</CODE> */ 804 public final Number expiryTime; 805 806 /** <CODE>[No Description Provided by Google]</CODE> */ 807 public final boolean isThirdParty; 808 809 /** <CODE>[No Description Provided by Google]</CODE> */ 810 public final String usageRestriction; 811 812 /** 813 * Constructor 814 * 815 * @param origin - 816 * 817 * @param matchSubDomains - 818 * 819 * @param trialName - 820 * 821 * @param expiryTime - 822 * 823 * @param isThirdParty - 824 * 825 * @param usageRestriction - 826 */ 827 public OriginTrialToken( 828 String origin, boolean matchSubDomains, String trialName, Number expiryTime, 829 boolean isThirdParty, String usageRestriction 830 ) 831 { 832 // Exception-Check(s) to ensure that if any parameters which are not declared as 833 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 834 835 if (origin == null) THROWS.throwNPE("origin"); 836 if (trialName == null) THROWS.throwNPE("trialName"); 837 if (expiryTime == null) THROWS.throwNPE("expiryTime"); 838 if (usageRestriction == null) THROWS.throwNPE("usageRestriction"); 839 840 // Exception-Check(s) to ensure that if any parameters which must adhere to a 841 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 842 843 THROWS.checkIAE("usageRestriction", usageRestriction, "Page.OriginTrialUsageRestriction", Page.OriginTrialUsageRestriction); 844 845 this.origin = origin; 846 this.matchSubDomains = matchSubDomains; 847 this.trialName = trialName; 848 this.expiryTime = expiryTime; 849 this.isThirdParty = isThirdParty; 850 this.usageRestriction = usageRestriction; 851 } 852 853 /** 854 * JSON Object Constructor 855 * @param jo A Json-Object having data about an instance of {@code 'OriginTrialToken'}. 856 */ 857 public OriginTrialToken (JsonObject jo) 858 { 859 this.origin = ReadJSON.getString(jo, "origin", false, true); 860 this.matchSubDomains = ReadPrimJSON.getBoolean(jo, "matchSubDomains"); 861 this.trialName = ReadJSON.getString(jo, "trialName", false, true); 862 this.expiryTime = ReadNumberJSON.get(jo, "expiryTime", false, true); 863 this.isThirdParty = ReadPrimJSON.getBoolean(jo, "isThirdParty"); 864 this.usageRestriction = ReadJSON.getString(jo, "usageRestriction", false, true); 865 } 866 867 868 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 869 public boolean equals(Object other) 870 { 871 if (this == other) return true; 872 if (other == null) return false; 873 if (other.getClass() != this.getClass()) return false; 874 875 OriginTrialToken o = (OriginTrialToken) other; 876 877 return 878 Objects.equals(this.origin, o.origin) 879 && (this.matchSubDomains == o.matchSubDomains) 880 && Objects.equals(this.trialName, o.trialName) 881 && Objects.equals(this.expiryTime, o.expiryTime) 882 && (this.isThirdParty == o.isThirdParty) 883 && Objects.equals(this.usageRestriction, o.usageRestriction); 884 } 885 886 /** Generates a Hash-Code for {@code 'this'} instance */ 887 public int hashCode() 888 { 889 return 890 Objects.hashCode(this.origin) 891 + (this.matchSubDomains ? 1 : 0) 892 + Objects.hashCode(this.trialName) 893 + Objects.hashCode(this.expiryTime) 894 + (this.isThirdParty ? 1 : 0) 895 + Objects.hashCode(this.usageRestriction); 896 } 897 } 898 899 /** 900 * <CODE>[No Description Provided by Google]</CODE> 901 * <BR /> 902 * <BR /><B>EXPERIMENTAL</B> 903 */ 904 public static class OriginTrialTokenWithStatus 905 extends BaseType 906 implements java.io.Serializable 907 { 908 /** For Object Serialization. java.io.Serializable */ 909 protected static final long serialVersionUID = 1; 910 911 public boolean[] optionals() 912 { return new boolean[] { false, true, false, }; } 913 914 /** <CODE>[No Description Provided by Google]</CODE> */ 915 public final String rawTokenText; 916 917 /** 918 * <CODE>parsedToken</CODE> is present only when the token is extractable and 919 * parsable. 920 * <BR /> 921 * <BR /><B>OPTIONAL</B> 922 */ 923 public final Page.OriginTrialToken parsedToken; 924 925 /** <CODE>[No Description Provided by Google]</CODE> */ 926 public final String status; 927 928 /** 929 * Constructor 930 * 931 * @param rawTokenText - 932 * 933 * @param parsedToken 934 * <CODE>parsedToken</CODE> is present only when the token is extractable and 935 * parsable. 936 * <BR /><B>OPTIONAL</B> 937 * 938 * @param status - 939 */ 940 public OriginTrialTokenWithStatus 941 (String rawTokenText, Page.OriginTrialToken parsedToken, String status) 942 { 943 // Exception-Check(s) to ensure that if any parameters which are not declared as 944 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 945 946 if (rawTokenText == null) THROWS.throwNPE("rawTokenText"); 947 if (status == null) THROWS.throwNPE("status"); 948 949 // Exception-Check(s) to ensure that if any parameters which must adhere to a 950 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 951 952 THROWS.checkIAE("status", status, "Page.OriginTrialTokenStatus", Page.OriginTrialTokenStatus); 953 954 this.rawTokenText = rawTokenText; 955 this.parsedToken = parsedToken; 956 this.status = status; 957 } 958 959 /** 960 * JSON Object Constructor 961 * @param jo A Json-Object having data about an instance of {@code 'OriginTrialTokenWithStatus'}. 962 */ 963 public OriginTrialTokenWithStatus (JsonObject jo) 964 { 965 this.rawTokenText = ReadJSON.getString(jo, "rawTokenText", false, true); 966 this.parsedToken = ReadJSON.getObject(jo, "parsedToken", Page.OriginTrialToken.class, true, false); 967 this.status = ReadJSON.getString(jo, "status", false, true); 968 } 969 970 971 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 972 public boolean equals(Object other) 973 { 974 if (this == other) return true; 975 if (other == null) return false; 976 if (other.getClass() != this.getClass()) return false; 977 978 OriginTrialTokenWithStatus o = (OriginTrialTokenWithStatus) other; 979 980 return 981 Objects.equals(this.rawTokenText, o.rawTokenText) 982 && Objects.equals(this.parsedToken, o.parsedToken) 983 && Objects.equals(this.status, o.status); 984 } 985 986 /** Generates a Hash-Code for {@code 'this'} instance */ 987 public int hashCode() 988 { 989 return 990 Objects.hashCode(this.rawTokenText) 991 + this.parsedToken.hashCode() 992 + Objects.hashCode(this.status); 993 } 994 } 995 996 /** 997 * <CODE>[No Description Provided by Google]</CODE> 998 * <BR /> 999 * <BR /><B>EXPERIMENTAL</B> 1000 */ 1001 public static class OriginTrial 1002 extends BaseType 1003 implements java.io.Serializable 1004 { 1005 /** For Object Serialization. java.io.Serializable */ 1006 protected static final long serialVersionUID = 1; 1007 1008 public boolean[] optionals() 1009 { return new boolean[] { false, false, false, }; } 1010 1011 /** <CODE>[No Description Provided by Google]</CODE> */ 1012 public final String trialName; 1013 1014 /** <CODE>[No Description Provided by Google]</CODE> */ 1015 public final String status; 1016 1017 /** <CODE>[No Description Provided by Google]</CODE> */ 1018 public final Page.OriginTrialTokenWithStatus[] tokensWithStatus; 1019 1020 /** 1021 * Constructor 1022 * 1023 * @param trialName - 1024 * 1025 * @param status - 1026 * 1027 * @param tokensWithStatus - 1028 */ 1029 public OriginTrial 1030 (String trialName, String status, Page.OriginTrialTokenWithStatus[] tokensWithStatus) 1031 { 1032 // Exception-Check(s) to ensure that if any parameters which are not declared as 1033 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1034 1035 if (trialName == null) THROWS.throwNPE("trialName"); 1036 if (status == null) THROWS.throwNPE("status"); 1037 if (tokensWithStatus == null) THROWS.throwNPE("tokensWithStatus"); 1038 1039 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1040 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1041 1042 THROWS.checkIAE("status", status, "Page.OriginTrialStatus", Page.OriginTrialStatus); 1043 1044 this.trialName = trialName; 1045 this.status = status; 1046 this.tokensWithStatus = tokensWithStatus; 1047 } 1048 1049 /** 1050 * JSON Object Constructor 1051 * @param jo A Json-Object having data about an instance of {@code 'OriginTrial'}. 1052 */ 1053 public OriginTrial (JsonObject jo) 1054 { 1055 this.trialName = ReadJSON.getString(jo, "trialName", false, true); 1056 this.status = ReadJSON.getString(jo, "status", false, true); 1057 this.tokensWithStatus = (jo.getJsonArray("tokensWithStatus") == null) 1058 ? null 1059 : RJArrIntoStream.objArr(jo.getJsonArray("tokensWithStatus"), null, 0, Page.OriginTrialTokenWithStatus.class).toArray(Page.OriginTrialTokenWithStatus[]::new); 1060 1061 } 1062 1063 1064 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1065 public boolean equals(Object other) 1066 { 1067 if (this == other) return true; 1068 if (other == null) return false; 1069 if (other.getClass() != this.getClass()) return false; 1070 1071 OriginTrial o = (OriginTrial) other; 1072 1073 return 1074 Objects.equals(this.trialName, o.trialName) 1075 && Objects.equals(this.status, o.status) 1076 && Arrays.deepEquals(this.tokensWithStatus, o.tokensWithStatus); 1077 } 1078 1079 /** Generates a Hash-Code for {@code 'this'} instance */ 1080 public int hashCode() 1081 { 1082 return 1083 Objects.hashCode(this.trialName) 1084 + Objects.hashCode(this.status) 1085 + Arrays.deepHashCode(this.tokensWithStatus); 1086 } 1087 } 1088 1089 /** Information about the Frame on the page. */ 1090 public static class Frame 1091 extends BaseType 1092 implements java.io.Serializable 1093 { 1094 /** For Object Serialization. java.io.Serializable */ 1095 protected static final long serialVersionUID = 1; 1096 1097 public boolean[] optionals() 1098 { return new boolean[] { false, true, false, true, false, true, false, false, false, true, true, false, false, false, }; } 1099 1100 /** Frame unique identifier. */ 1101 public final String id; 1102 1103 /** 1104 * Parent frame identifier. 1105 * <BR /> 1106 * <BR /><B>OPTIONAL</B> 1107 */ 1108 public final String parentId; 1109 1110 /** Identifier of the loader associated with this frame. */ 1111 public final String loaderId; 1112 1113 /** 1114 * Frame's name as specified in the tag. 1115 * <BR /> 1116 * <BR /><B>OPTIONAL</B> 1117 */ 1118 public final String name; 1119 1120 /** Frame document's URL without fragment. */ 1121 public final String url; 1122 1123 /** 1124 * Frame document's URL fragment including the '#'. 1125 * <BR /> 1126 * <BR /><B>OPTIONAL</B> 1127 * <BR /><B>EXPERIMENTAL</B> 1128 */ 1129 public final String urlFragment; 1130 1131 /** 1132 * Frame document's registered domain, taking the public suffixes list into account. 1133 * Extracted from the Frame's url. 1134 * Example URLs: http://www.google.com/file.html -> "google.com" 1135 * http://a.b.co.uk/file.html -> "b.co.uk" 1136 * <BR /> 1137 * <BR /><B>EXPERIMENTAL</B> 1138 */ 1139 public final String domainAndRegistry; 1140 1141 /** Frame document's security origin. */ 1142 public final String securityOrigin; 1143 1144 /** Frame document's mimeType as determined by the browser. */ 1145 public final String mimeType; 1146 1147 /** 1148 * If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment. 1149 * <BR /> 1150 * <BR /><B>OPTIONAL</B> 1151 * <BR /><B>EXPERIMENTAL</B> 1152 */ 1153 public final String unreachableUrl; 1154 1155 /** 1156 * Indicates whether this frame was tagged as an ad and why. 1157 * <BR /> 1158 * <BR /><B>OPTIONAL</B> 1159 * <BR /><B>EXPERIMENTAL</B> 1160 */ 1161 public final Page.AdFrameStatus adFrameStatus; 1162 1163 /** 1164 * Indicates whether the main document is a secure context and explains why that is the case. 1165 * <BR /> 1166 * <BR /><B>EXPERIMENTAL</B> 1167 */ 1168 public final String secureContextType; 1169 1170 /** 1171 * Indicates whether this is a cross origin isolated context. 1172 * <BR /> 1173 * <BR /><B>EXPERIMENTAL</B> 1174 */ 1175 public final String crossOriginIsolatedContextType; 1176 1177 /** 1178 * Indicated which gated APIs / features are available. 1179 * <BR /> 1180 * <BR /><B>EXPERIMENTAL</B> 1181 */ 1182 public final String[] gatedAPIFeatures; 1183 1184 /** 1185 * Constructor 1186 * 1187 * @param id Frame unique identifier. 1188 * 1189 * @param parentId Parent frame identifier. 1190 * <BR /><B>OPTIONAL</B> 1191 * 1192 * @param loaderId Identifier of the loader associated with this frame. 1193 * 1194 * @param name Frame's name as specified in the tag. 1195 * <BR /><B>OPTIONAL</B> 1196 * 1197 * @param url Frame document's URL without fragment. 1198 * 1199 * @param urlFragment Frame document's URL fragment including the '#'. 1200 * <BR /><B>OPTIONAL</B> 1201 * <BR /><B>EXPERIMENTAL</B> 1202 * 1203 * @param domainAndRegistry 1204 * Frame document's registered domain, taking the public suffixes list into account. 1205 * Extracted from the Frame's url. 1206 * Example URLs: http://www.google.com/file.html -> "google.com" 1207 * http://a.b.co.uk/file.html -> "b.co.uk" 1208 * <BR /><B>EXPERIMENTAL</B> 1209 * 1210 * @param securityOrigin Frame document's security origin. 1211 * 1212 * @param mimeType Frame document's mimeType as determined by the browser. 1213 * 1214 * @param unreachableUrl If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment. 1215 * <BR /><B>OPTIONAL</B> 1216 * <BR /><B>EXPERIMENTAL</B> 1217 * 1218 * @param adFrameStatus Indicates whether this frame was tagged as an ad and why. 1219 * <BR /><B>OPTIONAL</B> 1220 * <BR /><B>EXPERIMENTAL</B> 1221 * 1222 * @param secureContextType Indicates whether the main document is a secure context and explains why that is the case. 1223 * <BR /><B>EXPERIMENTAL</B> 1224 * 1225 * @param crossOriginIsolatedContextType Indicates whether this is a cross origin isolated context. 1226 * <BR /><B>EXPERIMENTAL</B> 1227 * 1228 * @param gatedAPIFeatures Indicated which gated APIs / features are available. 1229 * <BR /><B>EXPERIMENTAL</B> 1230 */ 1231 public Frame( 1232 String id, String parentId, String loaderId, String name, String url, 1233 String urlFragment, String domainAndRegistry, String securityOrigin, 1234 String mimeType, String unreachableUrl, Page.AdFrameStatus adFrameStatus, 1235 String secureContextType, String crossOriginIsolatedContextType, 1236 String[] gatedAPIFeatures 1237 ) 1238 { 1239 // Exception-Check(s) to ensure that if any parameters which are not declared as 1240 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1241 1242 if (id == null) THROWS.throwNPE("id"); 1243 if (loaderId == null) THROWS.throwNPE("loaderId"); 1244 if (url == null) THROWS.throwNPE("url"); 1245 if (domainAndRegistry == null) THROWS.throwNPE("domainAndRegistry"); 1246 if (securityOrigin == null) THROWS.throwNPE("securityOrigin"); 1247 if (mimeType == null) THROWS.throwNPE("mimeType"); 1248 if (secureContextType == null) THROWS.throwNPE("secureContextType"); 1249 if (crossOriginIsolatedContextType == null) THROWS.throwNPE("crossOriginIsolatedContextType"); 1250 if (gatedAPIFeatures == null) THROWS.throwNPE("gatedAPIFeatures"); 1251 1252 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1253 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1254 1255 THROWS.checkIAE("secureContextType", secureContextType, "Page.SecureContextType", Page.SecureContextType); 1256 THROWS.checkIAE("crossOriginIsolatedContextType", crossOriginIsolatedContextType, "Page.CrossOriginIsolatedContextType", Page.CrossOriginIsolatedContextType); 1257 1258 this.id = id; 1259 this.parentId = parentId; 1260 this.loaderId = loaderId; 1261 this.name = name; 1262 this.url = url; 1263 this.urlFragment = urlFragment; 1264 this.domainAndRegistry = domainAndRegistry; 1265 this.securityOrigin = securityOrigin; 1266 this.mimeType = mimeType; 1267 this.unreachableUrl = unreachableUrl; 1268 this.adFrameStatus = adFrameStatus; 1269 this.secureContextType = secureContextType; 1270 this.crossOriginIsolatedContextType = crossOriginIsolatedContextType; 1271 this.gatedAPIFeatures = gatedAPIFeatures; 1272 } 1273 1274 /** 1275 * JSON Object Constructor 1276 * @param jo A Json-Object having data about an instance of {@code 'Frame'}. 1277 */ 1278 public Frame (JsonObject jo) 1279 { 1280 this.id = ReadJSON.getString(jo, "id", false, true); 1281 this.parentId = ReadJSON.getString(jo, "parentId", true, false); 1282 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 1283 this.name = ReadJSON.getString(jo, "name", true, false); 1284 this.url = ReadJSON.getString(jo, "url", false, true); 1285 this.urlFragment = ReadJSON.getString(jo, "urlFragment", true, false); 1286 this.domainAndRegistry = ReadJSON.getString(jo, "domainAndRegistry", false, true); 1287 this.securityOrigin = ReadJSON.getString(jo, "securityOrigin", false, true); 1288 this.mimeType = ReadJSON.getString(jo, "mimeType", false, true); 1289 this.unreachableUrl = ReadJSON.getString(jo, "unreachableUrl", true, false); 1290 this.adFrameStatus = ReadJSON.getObject(jo, "adFrameStatus", Page.AdFrameStatus.class, true, false); 1291 this.secureContextType = ReadJSON.getString(jo, "secureContextType", false, true); 1292 this.crossOriginIsolatedContextType = ReadJSON.getString(jo, "crossOriginIsolatedContextType", false, true); 1293 this.gatedAPIFeatures = (jo.getJsonArray("gatedAPIFeatures") == null) 1294 ? null 1295 : RJArrIntoStream.strArr(jo.getJsonArray("gatedAPIFeatures"), null, 0).toArray(String[]::new); 1296 1297 } 1298 1299 1300 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1301 public boolean equals(Object other) 1302 { 1303 if (this == other) return true; 1304 if (other == null) return false; 1305 if (other.getClass() != this.getClass()) return false; 1306 1307 Frame o = (Frame) other; 1308 1309 return 1310 Objects.equals(this.id, o.id) 1311 && Objects.equals(this.parentId, o.parentId) 1312 && Objects.equals(this.loaderId, o.loaderId) 1313 && Objects.equals(this.name, o.name) 1314 && Objects.equals(this.url, o.url) 1315 && Objects.equals(this.urlFragment, o.urlFragment) 1316 && Objects.equals(this.domainAndRegistry, o.domainAndRegistry) 1317 && Objects.equals(this.securityOrigin, o.securityOrigin) 1318 && Objects.equals(this.mimeType, o.mimeType) 1319 && Objects.equals(this.unreachableUrl, o.unreachableUrl) 1320 && Objects.equals(this.adFrameStatus, o.adFrameStatus) 1321 && Objects.equals(this.secureContextType, o.secureContextType) 1322 && Objects.equals(this.crossOriginIsolatedContextType, o.crossOriginIsolatedContextType) 1323 && Arrays.deepEquals(this.gatedAPIFeatures, o.gatedAPIFeatures); 1324 } 1325 1326 /** Generates a Hash-Code for {@code 'this'} instance */ 1327 public int hashCode() 1328 { 1329 return 1330 Objects.hashCode(this.id) 1331 + Objects.hashCode(this.parentId) 1332 + Objects.hashCode(this.loaderId) 1333 + Objects.hashCode(this.name) 1334 + Objects.hashCode(this.url) 1335 + Objects.hashCode(this.urlFragment) 1336 + Objects.hashCode(this.domainAndRegistry) 1337 + Objects.hashCode(this.securityOrigin) 1338 + Objects.hashCode(this.mimeType) 1339 + Objects.hashCode(this.unreachableUrl) 1340 + this.adFrameStatus.hashCode() 1341 + Objects.hashCode(this.secureContextType) 1342 + Objects.hashCode(this.crossOriginIsolatedContextType) 1343 + Arrays.deepHashCode(this.gatedAPIFeatures); 1344 } 1345 } 1346 1347 /** 1348 * Information about the Resource on the page. 1349 * <BR /> 1350 * <BR /><B>EXPERIMENTAL</B> 1351 */ 1352 public static class FrameResource 1353 extends BaseType 1354 implements java.io.Serializable 1355 { 1356 /** For Object Serialization. java.io.Serializable */ 1357 protected static final long serialVersionUID = 1; 1358 1359 public boolean[] optionals() 1360 { return new boolean[] { false, false, false, true, true, true, true, }; } 1361 1362 /** Resource URL. */ 1363 public final String url; 1364 1365 /** Type of this resource. */ 1366 public final String type; 1367 1368 /** Resource mimeType as determined by the browser. */ 1369 public final String mimeType; 1370 1371 /** 1372 * last-modified timestamp as reported by server. 1373 * <BR /> 1374 * <BR /><B>OPTIONAL</B> 1375 */ 1376 public final Number lastModified; 1377 1378 /** 1379 * Resource content size. 1380 * <BR /> 1381 * <BR /><B>OPTIONAL</B> 1382 */ 1383 public final Number contentSize; 1384 1385 /** 1386 * True if the resource failed to load. 1387 * <BR /> 1388 * <BR /><B>OPTIONAL</B> 1389 */ 1390 public final Boolean failed; 1391 1392 /** 1393 * True if the resource was canceled during loading. 1394 * <BR /> 1395 * <BR /><B>OPTIONAL</B> 1396 */ 1397 public final Boolean canceled; 1398 1399 /** 1400 * Constructor 1401 * 1402 * @param url Resource URL. 1403 * 1404 * @param type Type of this resource. 1405 * 1406 * @param mimeType Resource mimeType as determined by the browser. 1407 * 1408 * @param lastModified last-modified timestamp as reported by server. 1409 * <BR /><B>OPTIONAL</B> 1410 * 1411 * @param contentSize Resource content size. 1412 * <BR /><B>OPTIONAL</B> 1413 * 1414 * @param failed True if the resource failed to load. 1415 * <BR /><B>OPTIONAL</B> 1416 * 1417 * @param canceled True if the resource was canceled during loading. 1418 * <BR /><B>OPTIONAL</B> 1419 */ 1420 public FrameResource( 1421 String url, String type, String mimeType, Number lastModified, Number contentSize, 1422 Boolean failed, Boolean canceled 1423 ) 1424 { 1425 // Exception-Check(s) to ensure that if any parameters which are not declared as 1426 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1427 1428 if (url == null) THROWS.throwNPE("url"); 1429 if (type == null) THROWS.throwNPE("type"); 1430 if (mimeType == null) THROWS.throwNPE("mimeType"); 1431 1432 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1433 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1434 1435 THROWS.checkIAE("type", type, "Network.ResourceType", Network.ResourceType); 1436 1437 this.url = url; 1438 this.type = type; 1439 this.mimeType = mimeType; 1440 this.lastModified = lastModified; 1441 this.contentSize = contentSize; 1442 this.failed = failed; 1443 this.canceled = canceled; 1444 } 1445 1446 /** 1447 * JSON Object Constructor 1448 * @param jo A Json-Object having data about an instance of {@code 'FrameResource'}. 1449 */ 1450 public FrameResource (JsonObject jo) 1451 { 1452 this.url = ReadJSON.getString(jo, "url", false, true); 1453 this.type = ReadJSON.getString(jo, "type", false, true); 1454 this.mimeType = ReadJSON.getString(jo, "mimeType", false, true); 1455 this.lastModified = ReadNumberJSON.get(jo, "lastModified", true, false); 1456 this.contentSize = ReadNumberJSON.get(jo, "contentSize", true, false); 1457 this.failed = ReadBoxedJSON.getBoolean(jo, "failed", true); 1458 this.canceled = ReadBoxedJSON.getBoolean(jo, "canceled", true); 1459 } 1460 1461 1462 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1463 public boolean equals(Object other) 1464 { 1465 if (this == other) return true; 1466 if (other == null) return false; 1467 if (other.getClass() != this.getClass()) return false; 1468 1469 FrameResource o = (FrameResource) other; 1470 1471 return 1472 Objects.equals(this.url, o.url) 1473 && Objects.equals(this.type, o.type) 1474 && Objects.equals(this.mimeType, o.mimeType) 1475 && Objects.equals(this.lastModified, o.lastModified) 1476 && Objects.equals(this.contentSize, o.contentSize) 1477 && Objects.equals(this.failed, o.failed) 1478 && Objects.equals(this.canceled, o.canceled); 1479 } 1480 1481 /** Generates a Hash-Code for {@code 'this'} instance */ 1482 public int hashCode() 1483 { 1484 return 1485 Objects.hashCode(this.url) 1486 + Objects.hashCode(this.type) 1487 + Objects.hashCode(this.mimeType) 1488 + Objects.hashCode(this.lastModified) 1489 + Objects.hashCode(this.contentSize) 1490 + Objects.hashCode(this.failed) 1491 + Objects.hashCode(this.canceled); 1492 } 1493 } 1494 1495 /** 1496 * Information about the Frame hierarchy along with their cached resources. 1497 * <BR /> 1498 * <BR /><B>EXPERIMENTAL</B> 1499 */ 1500 public static class FrameResourceTree 1501 extends BaseType 1502 implements java.io.Serializable 1503 { 1504 /** For Object Serialization. java.io.Serializable */ 1505 protected static final long serialVersionUID = 1; 1506 1507 public boolean[] optionals() 1508 { return new boolean[] { false, true, false, }; } 1509 1510 /** Frame information for this tree item. */ 1511 public final Page.Frame frame; 1512 1513 /** 1514 * Child frames. 1515 * <BR /> 1516 * <BR /><B>OPTIONAL</B> 1517 */ 1518 public final Page.FrameResourceTree[] childFrames; 1519 1520 /** Information about frame resources. */ 1521 public final Page.FrameResource[] resources; 1522 1523 /** 1524 * Constructor 1525 * 1526 * @param frame Frame information for this tree item. 1527 * 1528 * @param childFrames Child frames. 1529 * <BR /><B>OPTIONAL</B> 1530 * 1531 * @param resources Information about frame resources. 1532 */ 1533 public FrameResourceTree 1534 (Page.Frame frame, Page.FrameResourceTree[] childFrames, Page.FrameResource[] resources) 1535 { 1536 // Exception-Check(s) to ensure that if any parameters which are not declared as 1537 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1538 1539 if (frame == null) THROWS.throwNPE("frame"); 1540 if (resources == null) THROWS.throwNPE("resources"); 1541 1542 this.frame = frame; 1543 this.childFrames = childFrames; 1544 this.resources = resources; 1545 } 1546 1547 /** 1548 * JSON Object Constructor 1549 * @param jo A Json-Object having data about an instance of {@code 'FrameResourceTree'}. 1550 */ 1551 public FrameResourceTree (JsonObject jo) 1552 { 1553 this.frame = ReadJSON.getObject(jo, "frame", Page.Frame.class, false, true); 1554 this.childFrames = (jo.getJsonArray("childFrames") == null) 1555 ? null 1556 : RJArrIntoStream.objArr(jo.getJsonArray("childFrames"), null, 0, Page.FrameResourceTree.class).toArray(Page.FrameResourceTree[]::new); 1557 1558 this.resources = (jo.getJsonArray("resources") == null) 1559 ? null 1560 : RJArrIntoStream.objArr(jo.getJsonArray("resources"), null, 0, Page.FrameResource.class).toArray(Page.FrameResource[]::new); 1561 1562 } 1563 1564 1565 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1566 public boolean equals(Object other) 1567 { 1568 if (this == other) return true; 1569 if (other == null) return false; 1570 if (other.getClass() != this.getClass()) return false; 1571 1572 FrameResourceTree o = (FrameResourceTree) other; 1573 1574 return 1575 Objects.equals(this.frame, o.frame) 1576 && Arrays.deepEquals(this.childFrames, o.childFrames) 1577 && Arrays.deepEquals(this.resources, o.resources); 1578 } 1579 1580 /** Generates a Hash-Code for {@code 'this'} instance */ 1581 public int hashCode() 1582 { 1583 return 1584 this.frame.hashCode() 1585 + Arrays.deepHashCode(this.childFrames) 1586 + Arrays.deepHashCode(this.resources); 1587 } 1588 } 1589 1590 /** Information about the Frame hierarchy. */ 1591 public static class FrameTree 1592 extends BaseType 1593 implements java.io.Serializable 1594 { 1595 /** For Object Serialization. java.io.Serializable */ 1596 protected static final long serialVersionUID = 1; 1597 1598 public boolean[] optionals() 1599 { return new boolean[] { false, true, }; } 1600 1601 /** Frame information for this tree item. */ 1602 public final Page.Frame frame; 1603 1604 /** 1605 * Child frames. 1606 * <BR /> 1607 * <BR /><B>OPTIONAL</B> 1608 */ 1609 public final Page.FrameTree[] childFrames; 1610 1611 /** 1612 * Constructor 1613 * 1614 * @param frame Frame information for this tree item. 1615 * 1616 * @param childFrames Child frames. 1617 * <BR /><B>OPTIONAL</B> 1618 */ 1619 public FrameTree(Page.Frame frame, Page.FrameTree[] childFrames) 1620 { 1621 // Exception-Check(s) to ensure that if any parameters which are not declared as 1622 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1623 1624 if (frame == null) THROWS.throwNPE("frame"); 1625 1626 this.frame = frame; 1627 this.childFrames = childFrames; 1628 } 1629 1630 /** 1631 * JSON Object Constructor 1632 * @param jo A Json-Object having data about an instance of {@code 'FrameTree'}. 1633 */ 1634 public FrameTree (JsonObject jo) 1635 { 1636 this.frame = ReadJSON.getObject(jo, "frame", Page.Frame.class, false, true); 1637 this.childFrames = (jo.getJsonArray("childFrames") == null) 1638 ? null 1639 : RJArrIntoStream.objArr(jo.getJsonArray("childFrames"), null, 0, Page.FrameTree.class).toArray(Page.FrameTree[]::new); 1640 1641 } 1642 1643 1644 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1645 public boolean equals(Object other) 1646 { 1647 if (this == other) return true; 1648 if (other == null) return false; 1649 if (other.getClass() != this.getClass()) return false; 1650 1651 FrameTree o = (FrameTree) other; 1652 1653 return 1654 Objects.equals(this.frame, o.frame) 1655 && Arrays.deepEquals(this.childFrames, o.childFrames); 1656 } 1657 1658 /** Generates a Hash-Code for {@code 'this'} instance */ 1659 public int hashCode() 1660 { 1661 return 1662 this.frame.hashCode() 1663 + Arrays.deepHashCode(this.childFrames); 1664 } 1665 } 1666 1667 /** Navigation history entry. */ 1668 public static class NavigationEntry 1669 extends BaseType 1670 implements java.io.Serializable 1671 { 1672 /** For Object Serialization. java.io.Serializable */ 1673 protected static final long serialVersionUID = 1; 1674 1675 public boolean[] optionals() 1676 { return new boolean[] { false, false, false, false, false, }; } 1677 1678 /** Unique id of the navigation history entry. */ 1679 public final int id; 1680 1681 /** URL of the navigation history entry. */ 1682 public final String url; 1683 1684 /** URL that the user typed in the url bar. */ 1685 public final String userTypedURL; 1686 1687 /** Title of the navigation history entry. */ 1688 public final String title; 1689 1690 /** Transition type. */ 1691 public final String transitionType; 1692 1693 /** 1694 * Constructor 1695 * 1696 * @param id Unique id of the navigation history entry. 1697 * 1698 * @param url URL of the navigation history entry. 1699 * 1700 * @param userTypedURL URL that the user typed in the url bar. 1701 * 1702 * @param title Title of the navigation history entry. 1703 * 1704 * @param transitionType Transition type. 1705 */ 1706 public NavigationEntry 1707 (int id, String url, String userTypedURL, String title, String transitionType) 1708 { 1709 // Exception-Check(s) to ensure that if any parameters which are not declared as 1710 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1711 1712 if (url == null) THROWS.throwNPE("url"); 1713 if (userTypedURL == null) THROWS.throwNPE("userTypedURL"); 1714 if (title == null) THROWS.throwNPE("title"); 1715 if (transitionType == null) THROWS.throwNPE("transitionType"); 1716 1717 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1718 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1719 1720 THROWS.checkIAE("transitionType", transitionType, "Page.TransitionType", Page.TransitionType); 1721 1722 this.id = id; 1723 this.url = url; 1724 this.userTypedURL = userTypedURL; 1725 this.title = title; 1726 this.transitionType = transitionType; 1727 } 1728 1729 /** 1730 * JSON Object Constructor 1731 * @param jo A Json-Object having data about an instance of {@code 'NavigationEntry'}. 1732 */ 1733 public NavigationEntry (JsonObject jo) 1734 { 1735 this.id = ReadPrimJSON.getInt(jo, "id"); 1736 this.url = ReadJSON.getString(jo, "url", false, true); 1737 this.userTypedURL = ReadJSON.getString(jo, "userTypedURL", false, true); 1738 this.title = ReadJSON.getString(jo, "title", false, true); 1739 this.transitionType = ReadJSON.getString(jo, "transitionType", false, true); 1740 } 1741 1742 1743 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1744 public boolean equals(Object other) 1745 { 1746 if (this == other) return true; 1747 if (other == null) return false; 1748 if (other.getClass() != this.getClass()) return false; 1749 1750 NavigationEntry o = (NavigationEntry) other; 1751 1752 return 1753 (this.id == o.id) 1754 && Objects.equals(this.url, o.url) 1755 && Objects.equals(this.userTypedURL, o.userTypedURL) 1756 && Objects.equals(this.title, o.title) 1757 && Objects.equals(this.transitionType, o.transitionType); 1758 } 1759 1760 /** Generates a Hash-Code for {@code 'this'} instance */ 1761 public int hashCode() 1762 { 1763 return 1764 this.id 1765 + Objects.hashCode(this.url) 1766 + Objects.hashCode(this.userTypedURL) 1767 + Objects.hashCode(this.title) 1768 + Objects.hashCode(this.transitionType); 1769 } 1770 } 1771 1772 /** 1773 * Screencast frame metadata. 1774 * <BR /> 1775 * <BR /><B>EXPERIMENTAL</B> 1776 */ 1777 public static class ScreencastFrameMetadata 1778 extends BaseType 1779 implements java.io.Serializable 1780 { 1781 /** For Object Serialization. java.io.Serializable */ 1782 protected static final long serialVersionUID = 1; 1783 1784 public boolean[] optionals() 1785 { return new boolean[] { false, false, false, false, false, false, true, }; } 1786 1787 /** Top offset in DIP. */ 1788 public final Number offsetTop; 1789 1790 /** Page scale factor. */ 1791 public final Number pageScaleFactor; 1792 1793 /** Device screen width in DIP. */ 1794 public final Number deviceWidth; 1795 1796 /** Device screen height in DIP. */ 1797 public final Number deviceHeight; 1798 1799 /** Position of horizontal scroll in CSS pixels. */ 1800 public final Number scrollOffsetX; 1801 1802 /** Position of vertical scroll in CSS pixels. */ 1803 public final Number scrollOffsetY; 1804 1805 /** 1806 * Frame swap timestamp. 1807 * <BR /> 1808 * <BR /><B>OPTIONAL</B> 1809 */ 1810 public final Number timestamp; 1811 1812 /** 1813 * Constructor 1814 * 1815 * @param offsetTop Top offset in DIP. 1816 * 1817 * @param pageScaleFactor Page scale factor. 1818 * 1819 * @param deviceWidth Device screen width in DIP. 1820 * 1821 * @param deviceHeight Device screen height in DIP. 1822 * 1823 * @param scrollOffsetX Position of horizontal scroll in CSS pixels. 1824 * 1825 * @param scrollOffsetY Position of vertical scroll in CSS pixels. 1826 * 1827 * @param timestamp Frame swap timestamp. 1828 * <BR /><B>OPTIONAL</B> 1829 */ 1830 public ScreencastFrameMetadata( 1831 Number offsetTop, Number pageScaleFactor, Number deviceWidth, Number deviceHeight, 1832 Number scrollOffsetX, Number scrollOffsetY, Number timestamp 1833 ) 1834 { 1835 // Exception-Check(s) to ensure that if any parameters which are not declared as 1836 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1837 1838 if (offsetTop == null) THROWS.throwNPE("offsetTop"); 1839 if (pageScaleFactor == null) THROWS.throwNPE("pageScaleFactor"); 1840 if (deviceWidth == null) THROWS.throwNPE("deviceWidth"); 1841 if (deviceHeight == null) THROWS.throwNPE("deviceHeight"); 1842 if (scrollOffsetX == null) THROWS.throwNPE("scrollOffsetX"); 1843 if (scrollOffsetY == null) THROWS.throwNPE("scrollOffsetY"); 1844 1845 this.offsetTop = offsetTop; 1846 this.pageScaleFactor = pageScaleFactor; 1847 this.deviceWidth = deviceWidth; 1848 this.deviceHeight = deviceHeight; 1849 this.scrollOffsetX = scrollOffsetX; 1850 this.scrollOffsetY = scrollOffsetY; 1851 this.timestamp = timestamp; 1852 } 1853 1854 /** 1855 * JSON Object Constructor 1856 * @param jo A Json-Object having data about an instance of {@code 'ScreencastFrameMetadata'}. 1857 */ 1858 public ScreencastFrameMetadata (JsonObject jo) 1859 { 1860 this.offsetTop = ReadNumberJSON.get(jo, "offsetTop", false, true); 1861 this.pageScaleFactor = ReadNumberJSON.get(jo, "pageScaleFactor", false, true); 1862 this.deviceWidth = ReadNumberJSON.get(jo, "deviceWidth", false, true); 1863 this.deviceHeight = ReadNumberJSON.get(jo, "deviceHeight", false, true); 1864 this.scrollOffsetX = ReadNumberJSON.get(jo, "scrollOffsetX", false, true); 1865 this.scrollOffsetY = ReadNumberJSON.get(jo, "scrollOffsetY", false, true); 1866 this.timestamp = ReadNumberJSON.get(jo, "timestamp", true, false); 1867 } 1868 1869 1870 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1871 public boolean equals(Object other) 1872 { 1873 if (this == other) return true; 1874 if (other == null) return false; 1875 if (other.getClass() != this.getClass()) return false; 1876 1877 ScreencastFrameMetadata o = (ScreencastFrameMetadata) other; 1878 1879 return 1880 Objects.equals(this.offsetTop, o.offsetTop) 1881 && Objects.equals(this.pageScaleFactor, o.pageScaleFactor) 1882 && Objects.equals(this.deviceWidth, o.deviceWidth) 1883 && Objects.equals(this.deviceHeight, o.deviceHeight) 1884 && Objects.equals(this.scrollOffsetX, o.scrollOffsetX) 1885 && Objects.equals(this.scrollOffsetY, o.scrollOffsetY) 1886 && Objects.equals(this.timestamp, o.timestamp); 1887 } 1888 1889 /** Generates a Hash-Code for {@code 'this'} instance */ 1890 public int hashCode() 1891 { 1892 return 1893 Objects.hashCode(this.offsetTop) 1894 + Objects.hashCode(this.pageScaleFactor) 1895 + Objects.hashCode(this.deviceWidth) 1896 + Objects.hashCode(this.deviceHeight) 1897 + Objects.hashCode(this.scrollOffsetX) 1898 + Objects.hashCode(this.scrollOffsetY) 1899 + Objects.hashCode(this.timestamp); 1900 } 1901 } 1902 1903 /** Error while paring app manifest. */ 1904 public static class AppManifestError 1905 extends BaseType 1906 implements java.io.Serializable 1907 { 1908 /** For Object Serialization. java.io.Serializable */ 1909 protected static final long serialVersionUID = 1; 1910 1911 public boolean[] optionals() 1912 { return new boolean[] { false, false, false, false, }; } 1913 1914 /** Error message. */ 1915 public final String message; 1916 1917 /** If criticial, this is a non-recoverable parse error. */ 1918 public final int critical; 1919 1920 /** Error line. */ 1921 public final int line; 1922 1923 /** Error column. */ 1924 public final int column; 1925 1926 /** 1927 * Constructor 1928 * 1929 * @param message Error message. 1930 * 1931 * @param critical If criticial, this is a non-recoverable parse error. 1932 * 1933 * @param line Error line. 1934 * 1935 * @param column Error column. 1936 */ 1937 public AppManifestError(String message, int critical, int line, int column) 1938 { 1939 // Exception-Check(s) to ensure that if any parameters which are not declared as 1940 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1941 1942 if (message == null) THROWS.throwNPE("message"); 1943 1944 this.message = message; 1945 this.critical = critical; 1946 this.line = line; 1947 this.column = column; 1948 } 1949 1950 /** 1951 * JSON Object Constructor 1952 * @param jo A Json-Object having data about an instance of {@code 'AppManifestError'}. 1953 */ 1954 public AppManifestError (JsonObject jo) 1955 { 1956 this.message = ReadJSON.getString(jo, "message", false, true); 1957 this.critical = ReadPrimJSON.getInt(jo, "critical"); 1958 this.line = ReadPrimJSON.getInt(jo, "line"); 1959 this.column = ReadPrimJSON.getInt(jo, "column"); 1960 } 1961 1962 1963 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1964 public boolean equals(Object other) 1965 { 1966 if (this == other) return true; 1967 if (other == null) return false; 1968 if (other.getClass() != this.getClass()) return false; 1969 1970 AppManifestError o = (AppManifestError) other; 1971 1972 return 1973 Objects.equals(this.message, o.message) 1974 && (this.critical == o.critical) 1975 && (this.line == o.line) 1976 && (this.column == o.column); 1977 } 1978 1979 /** Generates a Hash-Code for {@code 'this'} instance */ 1980 public int hashCode() 1981 { 1982 return 1983 Objects.hashCode(this.message) 1984 + this.critical 1985 + this.line 1986 + this.column; 1987 } 1988 } 1989 1990 /** 1991 * Parsed app manifest properties. 1992 * <BR /> 1993 * <BR /><B>EXPERIMENTAL</B> 1994 */ 1995 public static class AppManifestParsedProperties 1996 extends BaseType 1997 implements java.io.Serializable 1998 { 1999 /** For Object Serialization. java.io.Serializable */ 2000 protected static final long serialVersionUID = 1; 2001 2002 public boolean[] optionals() 2003 { return new boolean[] { false, }; } 2004 2005 /** Computed scope value */ 2006 public final String scope; 2007 2008 /** 2009 * Constructor 2010 * 2011 * @param scope Computed scope value 2012 */ 2013 public AppManifestParsedProperties(String scope) 2014 { 2015 // Exception-Check(s) to ensure that if any parameters which are not declared as 2016 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2017 2018 if (scope == null) THROWS.throwNPE("scope"); 2019 2020 this.scope = scope; 2021 } 2022 2023 /** 2024 * JSON Object Constructor 2025 * @param jo A Json-Object having data about an instance of {@code 'AppManifestParsedProperties'}. 2026 */ 2027 public AppManifestParsedProperties (JsonObject jo) 2028 { 2029 this.scope = ReadJSON.getString(jo, "scope", false, true); 2030 } 2031 2032 2033 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2034 public boolean equals(Object other) 2035 { 2036 if (this == other) return true; 2037 if (other == null) return false; 2038 if (other.getClass() != this.getClass()) return false; 2039 2040 AppManifestParsedProperties o = (AppManifestParsedProperties) other; 2041 2042 return 2043 Objects.equals(this.scope, o.scope); 2044 } 2045 2046 /** Generates a Hash-Code for {@code 'this'} instance */ 2047 public int hashCode() 2048 { 2049 return 2050 Objects.hashCode(this.scope); 2051 } 2052 } 2053 2054 /** Layout viewport position and dimensions. */ 2055 public static class LayoutViewport 2056 extends BaseType 2057 implements java.io.Serializable 2058 { 2059 /** For Object Serialization. java.io.Serializable */ 2060 protected static final long serialVersionUID = 1; 2061 2062 public boolean[] optionals() 2063 { return new boolean[] { false, false, false, false, }; } 2064 2065 /** Horizontal offset relative to the document (CSS pixels). */ 2066 public final int pageX; 2067 2068 /** Vertical offset relative to the document (CSS pixels). */ 2069 public final int pageY; 2070 2071 /** Width (CSS pixels), excludes scrollbar if present. */ 2072 public final int clientWidth; 2073 2074 /** Height (CSS pixels), excludes scrollbar if present. */ 2075 public final int clientHeight; 2076 2077 /** 2078 * Constructor 2079 * 2080 * @param pageX Horizontal offset relative to the document (CSS pixels). 2081 * 2082 * @param pageY Vertical offset relative to the document (CSS pixels). 2083 * 2084 * @param clientWidth Width (CSS pixels), excludes scrollbar if present. 2085 * 2086 * @param clientHeight Height (CSS pixels), excludes scrollbar if present. 2087 */ 2088 public LayoutViewport(int pageX, int pageY, int clientWidth, int clientHeight) 2089 { 2090 this.pageX = pageX; 2091 this.pageY = pageY; 2092 this.clientWidth = clientWidth; 2093 this.clientHeight = clientHeight; 2094 } 2095 2096 /** 2097 * JSON Object Constructor 2098 * @param jo A Json-Object having data about an instance of {@code 'LayoutViewport'}. 2099 */ 2100 public LayoutViewport (JsonObject jo) 2101 { 2102 this.pageX = ReadPrimJSON.getInt(jo, "pageX"); 2103 this.pageY = ReadPrimJSON.getInt(jo, "pageY"); 2104 this.clientWidth = ReadPrimJSON.getInt(jo, "clientWidth"); 2105 this.clientHeight = ReadPrimJSON.getInt(jo, "clientHeight"); 2106 } 2107 2108 2109 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2110 public boolean equals(Object other) 2111 { 2112 if (this == other) return true; 2113 if (other == null) return false; 2114 if (other.getClass() != this.getClass()) return false; 2115 2116 LayoutViewport o = (LayoutViewport) other; 2117 2118 return 2119 (this.pageX == o.pageX) 2120 && (this.pageY == o.pageY) 2121 && (this.clientWidth == o.clientWidth) 2122 && (this.clientHeight == o.clientHeight); 2123 } 2124 2125 /** Generates a Hash-Code for {@code 'this'} instance */ 2126 public int hashCode() 2127 { 2128 return 2129 this.pageX 2130 + this.pageY 2131 + this.clientWidth 2132 + this.clientHeight; 2133 } 2134 } 2135 2136 /** Visual viewport position, dimensions, and scale. */ 2137 public static class VisualViewport 2138 extends BaseType 2139 implements java.io.Serializable 2140 { 2141 /** For Object Serialization. java.io.Serializable */ 2142 protected static final long serialVersionUID = 1; 2143 2144 public boolean[] optionals() 2145 { return new boolean[] { false, false, false, false, false, false, false, true, }; } 2146 2147 /** Horizontal offset relative to the layout viewport (CSS pixels). */ 2148 public final Number offsetX; 2149 2150 /** Vertical offset relative to the layout viewport (CSS pixels). */ 2151 public final Number offsetY; 2152 2153 /** Horizontal offset relative to the document (CSS pixels). */ 2154 public final Number pageX; 2155 2156 /** Vertical offset relative to the document (CSS pixels). */ 2157 public final Number pageY; 2158 2159 /** Width (CSS pixels), excludes scrollbar if present. */ 2160 public final Number clientWidth; 2161 2162 /** Height (CSS pixels), excludes scrollbar if present. */ 2163 public final Number clientHeight; 2164 2165 /** Scale relative to the ideal viewport (size at width=device-width). */ 2166 public final Number scale; 2167 2168 /** 2169 * Page zoom factor (CSS to device independent pixels ratio). 2170 * <BR /> 2171 * <BR /><B>OPTIONAL</B> 2172 */ 2173 public final Number zoom; 2174 2175 /** 2176 * Constructor 2177 * 2178 * @param offsetX Horizontal offset relative to the layout viewport (CSS pixels). 2179 * 2180 * @param offsetY Vertical offset relative to the layout viewport (CSS pixels). 2181 * 2182 * @param pageX Horizontal offset relative to the document (CSS pixels). 2183 * 2184 * @param pageY Vertical offset relative to the document (CSS pixels). 2185 * 2186 * @param clientWidth Width (CSS pixels), excludes scrollbar if present. 2187 * 2188 * @param clientHeight Height (CSS pixels), excludes scrollbar if present. 2189 * 2190 * @param scale Scale relative to the ideal viewport (size at width=device-width). 2191 * 2192 * @param zoom Page zoom factor (CSS to device independent pixels ratio). 2193 * <BR /><B>OPTIONAL</B> 2194 */ 2195 public VisualViewport( 2196 Number offsetX, Number offsetY, Number pageX, Number pageY, Number clientWidth, 2197 Number clientHeight, Number scale, Number zoom 2198 ) 2199 { 2200 // Exception-Check(s) to ensure that if any parameters which are not declared as 2201 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2202 2203 if (offsetX == null) THROWS.throwNPE("offsetX"); 2204 if (offsetY == null) THROWS.throwNPE("offsetY"); 2205 if (pageX == null) THROWS.throwNPE("pageX"); 2206 if (pageY == null) THROWS.throwNPE("pageY"); 2207 if (clientWidth == null) THROWS.throwNPE("clientWidth"); 2208 if (clientHeight == null) THROWS.throwNPE("clientHeight"); 2209 if (scale == null) THROWS.throwNPE("scale"); 2210 2211 this.offsetX = offsetX; 2212 this.offsetY = offsetY; 2213 this.pageX = pageX; 2214 this.pageY = pageY; 2215 this.clientWidth = clientWidth; 2216 this.clientHeight = clientHeight; 2217 this.scale = scale; 2218 this.zoom = zoom; 2219 } 2220 2221 /** 2222 * JSON Object Constructor 2223 * @param jo A Json-Object having data about an instance of {@code 'VisualViewport'}. 2224 */ 2225 public VisualViewport (JsonObject jo) 2226 { 2227 this.offsetX = ReadNumberJSON.get(jo, "offsetX", false, true); 2228 this.offsetY = ReadNumberJSON.get(jo, "offsetY", false, true); 2229 this.pageX = ReadNumberJSON.get(jo, "pageX", false, true); 2230 this.pageY = ReadNumberJSON.get(jo, "pageY", false, true); 2231 this.clientWidth = ReadNumberJSON.get(jo, "clientWidth", false, true); 2232 this.clientHeight = ReadNumberJSON.get(jo, "clientHeight", false, true); 2233 this.scale = ReadNumberJSON.get(jo, "scale", false, true); 2234 this.zoom = ReadNumberJSON.get(jo, "zoom", true, false); 2235 } 2236 2237 2238 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2239 public boolean equals(Object other) 2240 { 2241 if (this == other) return true; 2242 if (other == null) return false; 2243 if (other.getClass() != this.getClass()) return false; 2244 2245 VisualViewport o = (VisualViewport) other; 2246 2247 return 2248 Objects.equals(this.offsetX, o.offsetX) 2249 && Objects.equals(this.offsetY, o.offsetY) 2250 && Objects.equals(this.pageX, o.pageX) 2251 && Objects.equals(this.pageY, o.pageY) 2252 && Objects.equals(this.clientWidth, o.clientWidth) 2253 && Objects.equals(this.clientHeight, o.clientHeight) 2254 && Objects.equals(this.scale, o.scale) 2255 && Objects.equals(this.zoom, o.zoom); 2256 } 2257 2258 /** Generates a Hash-Code for {@code 'this'} instance */ 2259 public int hashCode() 2260 { 2261 return 2262 Objects.hashCode(this.offsetX) 2263 + Objects.hashCode(this.offsetY) 2264 + Objects.hashCode(this.pageX) 2265 + Objects.hashCode(this.pageY) 2266 + Objects.hashCode(this.clientWidth) 2267 + Objects.hashCode(this.clientHeight) 2268 + Objects.hashCode(this.scale) 2269 + Objects.hashCode(this.zoom); 2270 } 2271 } 2272 2273 /** Viewport for capturing screenshot. */ 2274 public static class Viewport 2275 extends BaseType 2276 implements java.io.Serializable 2277 { 2278 /** For Object Serialization. java.io.Serializable */ 2279 protected static final long serialVersionUID = 1; 2280 2281 public boolean[] optionals() 2282 { return new boolean[] { false, false, false, false, false, }; } 2283 2284 /** X offset in device independent pixels (dip). */ 2285 public final Number x; 2286 2287 /** Y offset in device independent pixels (dip). */ 2288 public final Number y; 2289 2290 /** Rectangle width in device independent pixels (dip). */ 2291 public final Number width; 2292 2293 /** Rectangle height in device independent pixels (dip). */ 2294 public final Number height; 2295 2296 /** Page scale factor. */ 2297 public final Number scale; 2298 2299 /** 2300 * Constructor 2301 * 2302 * @param x X offset in device independent pixels (dip). 2303 * 2304 * @param y Y offset in device independent pixels (dip). 2305 * 2306 * @param width Rectangle width in device independent pixels (dip). 2307 * 2308 * @param height Rectangle height in device independent pixels (dip). 2309 * 2310 * @param scale Page scale factor. 2311 */ 2312 public Viewport(Number x, Number y, Number width, Number height, Number scale) 2313 { 2314 // Exception-Check(s) to ensure that if any parameters which are not declared as 2315 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2316 2317 if (x == null) THROWS.throwNPE("x"); 2318 if (y == null) THROWS.throwNPE("y"); 2319 if (width == null) THROWS.throwNPE("width"); 2320 if (height == null) THROWS.throwNPE("height"); 2321 if (scale == null) THROWS.throwNPE("scale"); 2322 2323 this.x = x; 2324 this.y = y; 2325 this.width = width; 2326 this.height = height; 2327 this.scale = scale; 2328 } 2329 2330 /** 2331 * JSON Object Constructor 2332 * @param jo A Json-Object having data about an instance of {@code 'Viewport'}. 2333 */ 2334 public Viewport (JsonObject jo) 2335 { 2336 this.x = ReadNumberJSON.get(jo, "x", false, true); 2337 this.y = ReadNumberJSON.get(jo, "y", false, true); 2338 this.width = ReadNumberJSON.get(jo, "width", false, true); 2339 this.height = ReadNumberJSON.get(jo, "height", false, true); 2340 this.scale = ReadNumberJSON.get(jo, "scale", false, true); 2341 } 2342 2343 2344 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2345 public boolean equals(Object other) 2346 { 2347 if (this == other) return true; 2348 if (other == null) return false; 2349 if (other.getClass() != this.getClass()) return false; 2350 2351 Viewport o = (Viewport) other; 2352 2353 return 2354 Objects.equals(this.x, o.x) 2355 && Objects.equals(this.y, o.y) 2356 && Objects.equals(this.width, o.width) 2357 && Objects.equals(this.height, o.height) 2358 && Objects.equals(this.scale, o.scale); 2359 } 2360 2361 /** Generates a Hash-Code for {@code 'this'} instance */ 2362 public int hashCode() 2363 { 2364 return 2365 Objects.hashCode(this.x) 2366 + Objects.hashCode(this.y) 2367 + Objects.hashCode(this.width) 2368 + Objects.hashCode(this.height) 2369 + Objects.hashCode(this.scale); 2370 } 2371 } 2372 2373 /** 2374 * Generic font families collection. 2375 * <BR /> 2376 * <BR /><B>EXPERIMENTAL</B> 2377 */ 2378 public static class FontFamilies 2379 extends BaseType 2380 implements java.io.Serializable 2381 { 2382 /** For Object Serialization. java.io.Serializable */ 2383 protected static final long serialVersionUID = 1; 2384 2385 public boolean[] optionals() 2386 { return new boolean[] { true, true, true, true, true, true, true, }; } 2387 2388 /** 2389 * The standard font-family. 2390 * <BR /> 2391 * <BR /><B>OPTIONAL</B> 2392 */ 2393 public final String standard; 2394 2395 /** 2396 * The fixed font-family. 2397 * <BR /> 2398 * <BR /><B>OPTIONAL</B> 2399 */ 2400 public final String fixed; 2401 2402 /** 2403 * The serif font-family. 2404 * <BR /> 2405 * <BR /><B>OPTIONAL</B> 2406 */ 2407 public final String serif; 2408 2409 /** 2410 * The sansSerif font-family. 2411 * <BR /> 2412 * <BR /><B>OPTIONAL</B> 2413 */ 2414 public final String sansSerif; 2415 2416 /** 2417 * The cursive font-family. 2418 * <BR /> 2419 * <BR /><B>OPTIONAL</B> 2420 */ 2421 public final String cursive; 2422 2423 /** 2424 * The fantasy font-family. 2425 * <BR /> 2426 * <BR /><B>OPTIONAL</B> 2427 */ 2428 public final String fantasy; 2429 2430 /** 2431 * The pictograph font-family. 2432 * <BR /> 2433 * <BR /><B>OPTIONAL</B> 2434 */ 2435 public final String pictograph; 2436 2437 /** 2438 * Constructor 2439 * 2440 * @param standard The standard font-family. 2441 * <BR /><B>OPTIONAL</B> 2442 * 2443 * @param fixed The fixed font-family. 2444 * <BR /><B>OPTIONAL</B> 2445 * 2446 * @param serif The serif font-family. 2447 * <BR /><B>OPTIONAL</B> 2448 * 2449 * @param sansSerif The sansSerif font-family. 2450 * <BR /><B>OPTIONAL</B> 2451 * 2452 * @param cursive The cursive font-family. 2453 * <BR /><B>OPTIONAL</B> 2454 * 2455 * @param fantasy The fantasy font-family. 2456 * <BR /><B>OPTIONAL</B> 2457 * 2458 * @param pictograph The pictograph font-family. 2459 * <BR /><B>OPTIONAL</B> 2460 */ 2461 public FontFamilies( 2462 String standard, String fixed, String serif, String sansSerif, String cursive, 2463 String fantasy, String pictograph 2464 ) 2465 { 2466 this.standard = standard; 2467 this.fixed = fixed; 2468 this.serif = serif; 2469 this.sansSerif = sansSerif; 2470 this.cursive = cursive; 2471 this.fantasy = fantasy; 2472 this.pictograph = pictograph; 2473 } 2474 2475 /** 2476 * JSON Object Constructor 2477 * @param jo A Json-Object having data about an instance of {@code 'FontFamilies'}. 2478 */ 2479 public FontFamilies (JsonObject jo) 2480 { 2481 this.standard = ReadJSON.getString(jo, "standard", true, false); 2482 this.fixed = ReadJSON.getString(jo, "fixed", true, false); 2483 this.serif = ReadJSON.getString(jo, "serif", true, false); 2484 this.sansSerif = ReadJSON.getString(jo, "sansSerif", true, false); 2485 this.cursive = ReadJSON.getString(jo, "cursive", true, false); 2486 this.fantasy = ReadJSON.getString(jo, "fantasy", true, false); 2487 this.pictograph = ReadJSON.getString(jo, "pictograph", true, false); 2488 } 2489 2490 2491 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2492 public boolean equals(Object other) 2493 { 2494 if (this == other) return true; 2495 if (other == null) return false; 2496 if (other.getClass() != this.getClass()) return false; 2497 2498 FontFamilies o = (FontFamilies) other; 2499 2500 return 2501 Objects.equals(this.standard, o.standard) 2502 && Objects.equals(this.fixed, o.fixed) 2503 && Objects.equals(this.serif, o.serif) 2504 && Objects.equals(this.sansSerif, o.sansSerif) 2505 && Objects.equals(this.cursive, o.cursive) 2506 && Objects.equals(this.fantasy, o.fantasy) 2507 && Objects.equals(this.pictograph, o.pictograph); 2508 } 2509 2510 /** Generates a Hash-Code for {@code 'this'} instance */ 2511 public int hashCode() 2512 { 2513 return 2514 Objects.hashCode(this.standard) 2515 + Objects.hashCode(this.fixed) 2516 + Objects.hashCode(this.serif) 2517 + Objects.hashCode(this.sansSerif) 2518 + Objects.hashCode(this.cursive) 2519 + Objects.hashCode(this.fantasy) 2520 + Objects.hashCode(this.pictograph); 2521 } 2522 } 2523 2524 /** 2525 * Default font sizes. 2526 * <BR /> 2527 * <BR /><B>EXPERIMENTAL</B> 2528 */ 2529 public static class FontSizes 2530 extends BaseType 2531 implements java.io.Serializable 2532 { 2533 /** For Object Serialization. java.io.Serializable */ 2534 protected static final long serialVersionUID = 1; 2535 2536 public boolean[] optionals() 2537 { return new boolean[] { true, true, }; } 2538 2539 /** 2540 * Default standard font size. 2541 * <BR /> 2542 * <BR /><B>OPTIONAL</B> 2543 */ 2544 public final Integer standard; 2545 2546 /** 2547 * Default fixed font size. 2548 * <BR /> 2549 * <BR /><B>OPTIONAL</B> 2550 */ 2551 public final Integer fixed; 2552 2553 /** 2554 * Constructor 2555 * 2556 * @param standard Default standard font size. 2557 * <BR /><B>OPTIONAL</B> 2558 * 2559 * @param fixed Default fixed font size. 2560 * <BR /><B>OPTIONAL</B> 2561 */ 2562 public FontSizes(Integer standard, Integer fixed) 2563 { 2564 this.standard = standard; 2565 this.fixed = fixed; 2566 } 2567 2568 /** 2569 * JSON Object Constructor 2570 * @param jo A Json-Object having data about an instance of {@code 'FontSizes'}. 2571 */ 2572 public FontSizes (JsonObject jo) 2573 { 2574 this.standard = ReadBoxedJSON.getInteger(jo, "standard", true); 2575 this.fixed = ReadBoxedJSON.getInteger(jo, "fixed", true); 2576 } 2577 2578 2579 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2580 public boolean equals(Object other) 2581 { 2582 if (this == other) return true; 2583 if (other == null) return false; 2584 if (other.getClass() != this.getClass()) return false; 2585 2586 FontSizes o = (FontSizes) other; 2587 2588 return 2589 Objects.equals(this.standard, o.standard) 2590 && Objects.equals(this.fixed, o.fixed); 2591 } 2592 2593 /** Generates a Hash-Code for {@code 'this'} instance */ 2594 public int hashCode() 2595 { 2596 return 2597 Objects.hashCode(this.standard) 2598 + Objects.hashCode(this.fixed); 2599 } 2600 } 2601 2602 /** 2603 * <CODE>[No Description Provided by Google]</CODE> 2604 * <BR /> 2605 * <BR /><B>EXPERIMENTAL</B> 2606 */ 2607 public static class InstallabilityErrorArgument 2608 extends BaseType 2609 implements java.io.Serializable 2610 { 2611 /** For Object Serialization. java.io.Serializable */ 2612 protected static final long serialVersionUID = 1; 2613 2614 public boolean[] optionals() 2615 { return new boolean[] { false, false, }; } 2616 2617 /** Argument name (e.g. name:'minimum-icon-size-in-pixels'). */ 2618 public final String name; 2619 2620 /** Argument value (e.g. value:'64'). */ 2621 public final String value; 2622 2623 /** 2624 * Constructor 2625 * 2626 * @param name Argument name (e.g. name:'minimum-icon-size-in-pixels'). 2627 * 2628 * @param value Argument value (e.g. value:'64'). 2629 */ 2630 public InstallabilityErrorArgument(String name, String value) 2631 { 2632 // Exception-Check(s) to ensure that if any parameters which are not declared as 2633 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2634 2635 if (name == null) THROWS.throwNPE("name"); 2636 if (value == null) THROWS.throwNPE("value"); 2637 2638 this.name = name; 2639 this.value = value; 2640 } 2641 2642 /** 2643 * JSON Object Constructor 2644 * @param jo A Json-Object having data about an instance of {@code 'InstallabilityErrorArgument'}. 2645 */ 2646 public InstallabilityErrorArgument (JsonObject jo) 2647 { 2648 this.name = ReadJSON.getString(jo, "name", false, true); 2649 this.value = ReadJSON.getString(jo, "value", false, true); 2650 } 2651 2652 2653 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2654 public boolean equals(Object other) 2655 { 2656 if (this == other) return true; 2657 if (other == null) return false; 2658 if (other.getClass() != this.getClass()) return false; 2659 2660 InstallabilityErrorArgument o = (InstallabilityErrorArgument) other; 2661 2662 return 2663 Objects.equals(this.name, o.name) 2664 && Objects.equals(this.value, o.value); 2665 } 2666 2667 /** Generates a Hash-Code for {@code 'this'} instance */ 2668 public int hashCode() 2669 { 2670 return 2671 Objects.hashCode(this.name) 2672 + Objects.hashCode(this.value); 2673 } 2674 } 2675 2676 /** 2677 * The installability error 2678 * <BR /> 2679 * <BR /><B>EXPERIMENTAL</B> 2680 */ 2681 public static class InstallabilityError 2682 extends BaseType 2683 implements java.io.Serializable 2684 { 2685 /** For Object Serialization. java.io.Serializable */ 2686 protected static final long serialVersionUID = 1; 2687 2688 public boolean[] optionals() 2689 { return new boolean[] { false, false, }; } 2690 2691 /** The error id (e.g. 'manifest-missing-suitable-icon'). */ 2692 public final String errorId; 2693 2694 /** The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels', value:'64'}). */ 2695 public final Page.InstallabilityErrorArgument[] errorArguments; 2696 2697 /** 2698 * Constructor 2699 * 2700 * @param errorId The error id (e.g. 'manifest-missing-suitable-icon'). 2701 * 2702 * @param errorArguments The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels', value:'64'}). 2703 */ 2704 public InstallabilityError 2705 (String errorId, Page.InstallabilityErrorArgument[] errorArguments) 2706 { 2707 // Exception-Check(s) to ensure that if any parameters which are not declared as 2708 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2709 2710 if (errorId == null) THROWS.throwNPE("errorId"); 2711 if (errorArguments == null) THROWS.throwNPE("errorArguments"); 2712 2713 this.errorId = errorId; 2714 this.errorArguments = errorArguments; 2715 } 2716 2717 /** 2718 * JSON Object Constructor 2719 * @param jo A Json-Object having data about an instance of {@code 'InstallabilityError'}. 2720 */ 2721 public InstallabilityError (JsonObject jo) 2722 { 2723 this.errorId = ReadJSON.getString(jo, "errorId", false, true); 2724 this.errorArguments = (jo.getJsonArray("errorArguments") == null) 2725 ? null 2726 : RJArrIntoStream.objArr(jo.getJsonArray("errorArguments"), null, 0, Page.InstallabilityErrorArgument.class).toArray(Page.InstallabilityErrorArgument[]::new); 2727 2728 } 2729 2730 2731 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2732 public boolean equals(Object other) 2733 { 2734 if (this == other) return true; 2735 if (other == null) return false; 2736 if (other.getClass() != this.getClass()) return false; 2737 2738 InstallabilityError o = (InstallabilityError) other; 2739 2740 return 2741 Objects.equals(this.errorId, o.errorId) 2742 && Arrays.deepEquals(this.errorArguments, o.errorArguments); 2743 } 2744 2745 /** Generates a Hash-Code for {@code 'this'} instance */ 2746 public int hashCode() 2747 { 2748 return 2749 Objects.hashCode(this.errorId) 2750 + Arrays.deepHashCode(this.errorArguments); 2751 } 2752 } 2753 2754 /** 2755 * Per-script compilation cache parameters for <CODE>Page.produceCompilationCache</CODE> 2756 * <BR /> 2757 * <BR /><B>EXPERIMENTAL</B> 2758 */ 2759 public static class CompilationCacheParams 2760 extends BaseType 2761 implements java.io.Serializable 2762 { 2763 /** For Object Serialization. java.io.Serializable */ 2764 protected static final long serialVersionUID = 1; 2765 2766 public boolean[] optionals() 2767 { return new boolean[] { false, true, }; } 2768 2769 /** The URL of the script to produce a compilation cache entry for. */ 2770 public final String url; 2771 2772 /** 2773 * A hint to the backend whether eager compilation is recommended. 2774 * (the actual compilation mode used is upon backend discretion). 2775 * <BR /> 2776 * <BR /><B>OPTIONAL</B> 2777 */ 2778 public final Boolean eager; 2779 2780 /** 2781 * Constructor 2782 * 2783 * @param url The URL of the script to produce a compilation cache entry for. 2784 * 2785 * @param eager 2786 * A hint to the backend whether eager compilation is recommended. 2787 * (the actual compilation mode used is upon backend discretion). 2788 * <BR /><B>OPTIONAL</B> 2789 */ 2790 public CompilationCacheParams(String url, Boolean eager) 2791 { 2792 // Exception-Check(s) to ensure that if any parameters which are not declared as 2793 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2794 2795 if (url == null) THROWS.throwNPE("url"); 2796 2797 this.url = url; 2798 this.eager = eager; 2799 } 2800 2801 /** 2802 * JSON Object Constructor 2803 * @param jo A Json-Object having data about an instance of {@code 'CompilationCacheParams'}. 2804 */ 2805 public CompilationCacheParams (JsonObject jo) 2806 { 2807 this.url = ReadJSON.getString(jo, "url", false, true); 2808 this.eager = ReadBoxedJSON.getBoolean(jo, "eager", true); 2809 } 2810 2811 2812 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2813 public boolean equals(Object other) 2814 { 2815 if (this == other) return true; 2816 if (other == null) return false; 2817 if (other.getClass() != this.getClass()) return false; 2818 2819 CompilationCacheParams o = (CompilationCacheParams) other; 2820 2821 return 2822 Objects.equals(this.url, o.url) 2823 && Objects.equals(this.eager, o.eager); 2824 } 2825 2826 /** Generates a Hash-Code for {@code 'this'} instance */ 2827 public int hashCode() 2828 { 2829 return 2830 Objects.hashCode(this.url) 2831 + Objects.hashCode(this.eager); 2832 } 2833 } 2834 2835 /** 2836 * <CODE>[No Description Provided by Google]</CODE> 2837 * <BR /> 2838 * <BR /><B>EXPERIMENTAL</B> 2839 */ 2840 public static class BackForwardCacheNotRestoredExplanation 2841 extends BaseType 2842 implements java.io.Serializable 2843 { 2844 /** For Object Serialization. java.io.Serializable */ 2845 protected static final long serialVersionUID = 1; 2846 2847 public boolean[] optionals() 2848 { return new boolean[] { false, false, }; } 2849 2850 /** Type of the reason */ 2851 public final String type; 2852 2853 /** Not restored reason */ 2854 public final String reason; 2855 2856 /** 2857 * Constructor 2858 * 2859 * @param type Type of the reason 2860 * 2861 * @param reason Not restored reason 2862 */ 2863 public BackForwardCacheNotRestoredExplanation(String type, String reason) 2864 { 2865 // Exception-Check(s) to ensure that if any parameters which are not declared as 2866 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2867 2868 if (type == null) THROWS.throwNPE("type"); 2869 if (reason == null) THROWS.throwNPE("reason"); 2870 2871 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2872 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2873 2874 THROWS.checkIAE("type", type, "Page.BackForwardCacheNotRestoredReasonType", Page.BackForwardCacheNotRestoredReasonType); 2875 THROWS.checkIAE("reason", reason, "Page.BackForwardCacheNotRestoredReason", Page.BackForwardCacheNotRestoredReason); 2876 2877 this.type = type; 2878 this.reason = reason; 2879 } 2880 2881 /** 2882 * JSON Object Constructor 2883 * @param jo A Json-Object having data about an instance of {@code 'BackForwardCacheNotRestoredExplanation'}. 2884 */ 2885 public BackForwardCacheNotRestoredExplanation (JsonObject jo) 2886 { 2887 this.type = ReadJSON.getString(jo, "type", false, true); 2888 this.reason = ReadJSON.getString(jo, "reason", false, true); 2889 } 2890 2891 2892 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2893 public boolean equals(Object other) 2894 { 2895 if (this == other) return true; 2896 if (other == null) return false; 2897 if (other.getClass() != this.getClass()) return false; 2898 2899 BackForwardCacheNotRestoredExplanation o = (BackForwardCacheNotRestoredExplanation) other; 2900 2901 return 2902 Objects.equals(this.type, o.type) 2903 && Objects.equals(this.reason, o.reason); 2904 } 2905 2906 /** Generates a Hash-Code for {@code 'this'} instance */ 2907 public int hashCode() 2908 { 2909 return 2910 Objects.hashCode(this.type) 2911 + Objects.hashCode(this.reason); 2912 } 2913 } 2914 2915 /** 2916 * - 2917 * <BR /> 2918 * <BR /><B>EXPERIMENTAL</B> 2919 * 2920 * <BR /><BR />This is Marker-Event. Marker-Event's are Events that do not posses 2921 * any data, fields or state. When they are fired, only the event name is supplied. 2922 */ 2923 public static class frameResized 2924 extends BrowserEvent 2925 implements java.io.Serializable 2926 { 2927 /** For Object Serialization. java.io.Serializable */ 2928 protected static final long serialVersionUID = 1; 2929 2930 public boolean[] optionals() { return new boolean[0]; } 2931 2932 /** JSON Object Constructor */ 2933 public frameResized(JsonObject jo) 2934 { super("Page", "frameResized", 0); } 2935 2936 @Override 2937 public String toString() { return "Page.frameResized Marker Event\n"; } 2938 } 2939 2940 /** 2941 * Fired when interstitial page was hidden 2942 * 2943 * <BR /><BR />This is Marker-Event. Marker-Event's are Events that do not posses 2944 * any data, fields or state. When they are fired, only the event name is supplied. 2945 */ 2946 public static class interstitialHidden 2947 extends BrowserEvent 2948 implements java.io.Serializable 2949 { 2950 /** For Object Serialization. java.io.Serializable */ 2951 protected static final long serialVersionUID = 1; 2952 2953 public boolean[] optionals() { return new boolean[0]; } 2954 2955 /** JSON Object Constructor */ 2956 public interstitialHidden(JsonObject jo) 2957 { super("Page", "interstitialHidden", 0); } 2958 2959 @Override 2960 public String toString() { return "Page.interstitialHidden Marker Event\n"; } 2961 } 2962 2963 /** 2964 * Fired when interstitial page was shown 2965 * 2966 * <BR /><BR />This is Marker-Event. Marker-Event's are Events that do not posses 2967 * any data, fields or state. When they are fired, only the event name is supplied. 2968 */ 2969 public static class interstitialShown 2970 extends BrowserEvent 2971 implements java.io.Serializable 2972 { 2973 /** For Object Serialization. java.io.Serializable */ 2974 protected static final long serialVersionUID = 1; 2975 2976 public boolean[] optionals() { return new boolean[0]; } 2977 2978 /** JSON Object Constructor */ 2979 public interstitialShown(JsonObject jo) 2980 { super("Page", "interstitialShown", 0); } 2981 2982 @Override 2983 public String toString() { return "Page.interstitialShown Marker Event\n"; } 2984 } 2985 2986 /** <CODE>[No Description Provided by Google]</CODE> */ 2987 public static class domContentEventFired 2988 extends BrowserEvent 2989 implements java.io.Serializable 2990 { 2991 /** For Object Serialization. java.io.Serializable */ 2992 protected static final long serialVersionUID = 1; 2993 2994 public boolean[] optionals() 2995 { return new boolean[] { false, }; } 2996 2997 /** <CODE>[No Description Provided by Google]</CODE> */ 2998 public final Number timestamp; 2999 3000 /** 3001 * Constructor 3002 * 3003 * @param timestamp - 3004 */ 3005 public domContentEventFired(Number timestamp) 3006 { 3007 super("Page", "domContentEventFired", 1); 3008 3009 // Exception-Check(s) to ensure that if any parameters which are not declared as 3010 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3011 3012 if (timestamp == null) THROWS.throwNPE("timestamp"); 3013 3014 this.timestamp = timestamp; 3015 } 3016 3017 /** 3018 * JSON Object Constructor 3019 * @param jo A Json-Object having data about an instance of {@code 'domContentEventFired'}. 3020 */ 3021 public domContentEventFired (JsonObject jo) 3022 { 3023 super("Page", "domContentEventFired", 1); 3024 3025 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 3026 } 3027 3028 3029 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3030 public boolean equals(Object other) 3031 { 3032 if (this == other) return true; 3033 if (other == null) return false; 3034 if (other.getClass() != this.getClass()) return false; 3035 3036 domContentEventFired o = (domContentEventFired) other; 3037 3038 return 3039 Objects.equals(this.timestamp, o.timestamp); 3040 } 3041 3042 /** Generates a Hash-Code for {@code 'this'} instance */ 3043 public int hashCode() 3044 { 3045 return 3046 Objects.hashCode(this.timestamp); 3047 } 3048 } 3049 3050 /** Emitted only when <CODE>page.interceptFileChooser</CODE> is enabled. */ 3051 public static class fileChooserOpened 3052 extends BrowserEvent 3053 implements java.io.Serializable 3054 { 3055 /** For Object Serialization. java.io.Serializable */ 3056 protected static final long serialVersionUID = 1; 3057 3058 public boolean[] optionals() 3059 { return new boolean[] { false, false, false, }; } 3060 3061 /** 3062 * Id of the frame containing input node. 3063 * <BR /> 3064 * <BR /><B>EXPERIMENTAL</B> 3065 */ 3066 public final String frameId; 3067 3068 /** 3069 * Input node id. 3070 * <BR /> 3071 * <BR /><B>EXPERIMENTAL</B> 3072 */ 3073 public final int backendNodeId; 3074 3075 /** Input mode. */ 3076 public final String mode; 3077 3078 /** 3079 * Constructor 3080 * 3081 * @param frameId Id of the frame containing input node. 3082 * <BR /><B>EXPERIMENTAL</B> 3083 * 3084 * @param backendNodeId Input node id. 3085 * <BR /><B>EXPERIMENTAL</B> 3086 * 3087 * @param mode Input mode. 3088 * <BR />Acceptable Values: ["selectSingle", "selectMultiple"] 3089 */ 3090 public fileChooserOpened(String frameId, int backendNodeId, String mode) 3091 { 3092 super("Page", "fileChooserOpened", 3); 3093 3094 // Exception-Check(s) to ensure that if any parameters which are not declared as 3095 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3096 3097 if (frameId == null) THROWS.throwNPE("frameId"); 3098 if (mode == null) THROWS.throwNPE("mode"); 3099 3100 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3101 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3102 3103 THROWS.checkIAE( 3104 "mode", mode, 3105 "selectSingle", "selectMultiple" 3106 ); 3107 3108 this.frameId = frameId; 3109 this.backendNodeId = backendNodeId; 3110 this.mode = mode; 3111 } 3112 3113 /** 3114 * JSON Object Constructor 3115 * @param jo A Json-Object having data about an instance of {@code 'fileChooserOpened'}. 3116 */ 3117 public fileChooserOpened (JsonObject jo) 3118 { 3119 super("Page", "fileChooserOpened", 3); 3120 3121 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3122 this.backendNodeId = ReadPrimJSON.getInt(jo, "backendNodeId"); 3123 this.mode = ReadJSON.getString(jo, "mode", false, true); 3124 } 3125 3126 3127 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3128 public boolean equals(Object other) 3129 { 3130 if (this == other) return true; 3131 if (other == null) return false; 3132 if (other.getClass() != this.getClass()) return false; 3133 3134 fileChooserOpened o = (fileChooserOpened) other; 3135 3136 return 3137 Objects.equals(this.frameId, o.frameId) 3138 && Objects.equals(this.backendNodeId, o.backendNodeId) 3139 && Objects.equals(this.mode, o.mode); 3140 } 3141 3142 /** Generates a Hash-Code for {@code 'this'} instance */ 3143 public int hashCode() 3144 { 3145 return 3146 Objects.hashCode(this.frameId) 3147 + this.backendNodeId 3148 + Objects.hashCode(this.mode); 3149 } 3150 } 3151 3152 /** Fired when frame has been attached to its parent. */ 3153 public static class frameAttached 3154 extends BrowserEvent 3155 implements java.io.Serializable 3156 { 3157 /** For Object Serialization. java.io.Serializable */ 3158 protected static final long serialVersionUID = 1; 3159 3160 public boolean[] optionals() 3161 { return new boolean[] { false, false, true, }; } 3162 3163 /** Id of the frame that has been attached. */ 3164 public final String frameId; 3165 3166 /** Parent frame identifier. */ 3167 public final String parentFrameId; 3168 3169 /** 3170 * JavaScript stack trace of when frame was attached, only set if frame initiated from script. 3171 * <BR /> 3172 * <BR /><B>OPTIONAL</B> 3173 */ 3174 public final RunTime.StackTrace stack; 3175 3176 /** 3177 * Constructor 3178 * 3179 * @param frameId Id of the frame that has been attached. 3180 * 3181 * @param parentFrameId Parent frame identifier. 3182 * 3183 * @param stack JavaScript stack trace of when frame was attached, only set if frame initiated from script. 3184 * <BR /><B>OPTIONAL</B> 3185 */ 3186 public frameAttached(String frameId, String parentFrameId, RunTime.StackTrace stack) 3187 { 3188 super("Page", "frameAttached", 3); 3189 3190 // Exception-Check(s) to ensure that if any parameters which are not declared as 3191 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3192 3193 if (frameId == null) THROWS.throwNPE("frameId"); 3194 if (parentFrameId == null) THROWS.throwNPE("parentFrameId"); 3195 3196 this.frameId = frameId; 3197 this.parentFrameId = parentFrameId; 3198 this.stack = stack; 3199 } 3200 3201 /** 3202 * JSON Object Constructor 3203 * @param jo A Json-Object having data about an instance of {@code 'frameAttached'}. 3204 */ 3205 public frameAttached (JsonObject jo) 3206 { 3207 super("Page", "frameAttached", 3); 3208 3209 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3210 this.parentFrameId = ReadJSON.getString(jo, "parentFrameId", false, true); 3211 this.stack = ReadJSON.getObject(jo, "stack", RunTime.StackTrace.class, true, false); 3212 } 3213 3214 3215 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3216 public boolean equals(Object other) 3217 { 3218 if (this == other) return true; 3219 if (other == null) return false; 3220 if (other.getClass() != this.getClass()) return false; 3221 3222 frameAttached o = (frameAttached) other; 3223 3224 return 3225 Objects.equals(this.frameId, o.frameId) 3226 && Objects.equals(this.parentFrameId, o.parentFrameId) 3227 && Objects.equals(this.stack, o.stack); 3228 } 3229 3230 /** Generates a Hash-Code for {@code 'this'} instance */ 3231 public int hashCode() 3232 { 3233 return 3234 Objects.hashCode(this.frameId) 3235 + Objects.hashCode(this.parentFrameId) 3236 + this.stack.hashCode(); 3237 } 3238 } 3239 3240 /** 3241 * Fired when frame no longer has a scheduled navigation. 3242 * <BR /> 3243 * <BR /><B>DEPRECATED</B> 3244 */ 3245 public static class frameClearedScheduledNavigation 3246 extends BrowserEvent 3247 implements java.io.Serializable 3248 { 3249 /** For Object Serialization. java.io.Serializable */ 3250 protected static final long serialVersionUID = 1; 3251 3252 public boolean[] optionals() 3253 { return new boolean[] { false, }; } 3254 3255 /** Id of the frame that has cleared its scheduled navigation. */ 3256 public final String frameId; 3257 3258 /** 3259 * Constructor 3260 * 3261 * @param frameId Id of the frame that has cleared its scheduled navigation. 3262 */ 3263 public frameClearedScheduledNavigation(String frameId) 3264 { 3265 super("Page", "frameClearedScheduledNavigation", 1); 3266 3267 // Exception-Check(s) to ensure that if any parameters which are not declared as 3268 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3269 3270 if (frameId == null) THROWS.throwNPE("frameId"); 3271 3272 this.frameId = frameId; 3273 } 3274 3275 /** 3276 * JSON Object Constructor 3277 * @param jo A Json-Object having data about an instance of {@code 'frameClearedScheduledNavigation'}. 3278 */ 3279 public frameClearedScheduledNavigation (JsonObject jo) 3280 { 3281 super("Page", "frameClearedScheduledNavigation", 1); 3282 3283 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3284 } 3285 3286 3287 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3288 public boolean equals(Object other) 3289 { 3290 if (this == other) return true; 3291 if (other == null) return false; 3292 if (other.getClass() != this.getClass()) return false; 3293 3294 frameClearedScheduledNavigation o = (frameClearedScheduledNavigation) other; 3295 3296 return 3297 Objects.equals(this.frameId, o.frameId); 3298 } 3299 3300 /** Generates a Hash-Code for {@code 'this'} instance */ 3301 public int hashCode() 3302 { 3303 return 3304 Objects.hashCode(this.frameId); 3305 } 3306 } 3307 3308 /** Fired when frame has been detached from its parent. */ 3309 public static class frameDetached 3310 extends BrowserEvent 3311 implements java.io.Serializable 3312 { 3313 /** For Object Serialization. java.io.Serializable */ 3314 protected static final long serialVersionUID = 1; 3315 3316 public boolean[] optionals() 3317 { return new boolean[] { false, false, }; } 3318 3319 /** Id of the frame that has been detached. */ 3320 public final String frameId; 3321 3322 /** 3323 * <CODE>[No Description Provided by Google]</CODE> 3324 * <BR /> 3325 * <BR /><B>EXPERIMENTAL</B> 3326 */ 3327 public final String reason; 3328 3329 /** 3330 * Constructor 3331 * 3332 * @param frameId Id of the frame that has been detached. 3333 * 3334 * @param reason - 3335 * <BR />Acceptable Values: ["remove", "swap"] 3336 * <BR /><B>EXPERIMENTAL</B> 3337 */ 3338 public frameDetached(String frameId, String reason) 3339 { 3340 super("Page", "frameDetached", 2); 3341 3342 // Exception-Check(s) to ensure that if any parameters which are not declared as 3343 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3344 3345 if (frameId == null) THROWS.throwNPE("frameId"); 3346 if (reason == null) THROWS.throwNPE("reason"); 3347 3348 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3349 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3350 3351 THROWS.checkIAE( 3352 "reason", reason, 3353 "remove", "swap" 3354 ); 3355 3356 this.frameId = frameId; 3357 this.reason = reason; 3358 } 3359 3360 /** 3361 * JSON Object Constructor 3362 * @param jo A Json-Object having data about an instance of {@code 'frameDetached'}. 3363 */ 3364 public frameDetached (JsonObject jo) 3365 { 3366 super("Page", "frameDetached", 2); 3367 3368 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3369 this.reason = ReadJSON.getString(jo, "reason", false, true); 3370 } 3371 3372 3373 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3374 public boolean equals(Object other) 3375 { 3376 if (this == other) return true; 3377 if (other == null) return false; 3378 if (other.getClass() != this.getClass()) return false; 3379 3380 frameDetached o = (frameDetached) other; 3381 3382 return 3383 Objects.equals(this.frameId, o.frameId) 3384 && Objects.equals(this.reason, o.reason); 3385 } 3386 3387 /** Generates a Hash-Code for {@code 'this'} instance */ 3388 public int hashCode() 3389 { 3390 return 3391 Objects.hashCode(this.frameId) 3392 + Objects.hashCode(this.reason); 3393 } 3394 } 3395 3396 /** Fired once navigation of the frame has completed. Frame is now associated with the new loader. */ 3397 public static class frameNavigated 3398 extends BrowserEvent 3399 implements java.io.Serializable 3400 { 3401 /** For Object Serialization. java.io.Serializable */ 3402 protected static final long serialVersionUID = 1; 3403 3404 public boolean[] optionals() 3405 { return new boolean[] { false, false, }; } 3406 3407 /** Frame object. */ 3408 public final Page.Frame frame; 3409 3410 /** 3411 * <CODE>[No Description Provided by Google]</CODE> 3412 * <BR /> 3413 * <BR /><B>EXPERIMENTAL</B> 3414 */ 3415 public final String type; 3416 3417 /** 3418 * Constructor 3419 * 3420 * @param frame Frame object. 3421 * 3422 * @param type - 3423 * <BR /><B>EXPERIMENTAL</B> 3424 */ 3425 public frameNavigated(Page.Frame frame, String type) 3426 { 3427 super("Page", "frameNavigated", 2); 3428 3429 // Exception-Check(s) to ensure that if any parameters which are not declared as 3430 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3431 3432 if (frame == null) THROWS.throwNPE("frame"); 3433 if (type == null) THROWS.throwNPE("type"); 3434 3435 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3436 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3437 3438 THROWS.checkIAE("type", type, "Page.NavigationType", Page.NavigationType); 3439 3440 this.frame = frame; 3441 this.type = type; 3442 } 3443 3444 /** 3445 * JSON Object Constructor 3446 * @param jo A Json-Object having data about an instance of {@code 'frameNavigated'}. 3447 */ 3448 public frameNavigated (JsonObject jo) 3449 { 3450 super("Page", "frameNavigated", 2); 3451 3452 this.frame = ReadJSON.getObject(jo, "frame", Page.Frame.class, false, true); 3453 this.type = ReadJSON.getString(jo, "type", false, true); 3454 } 3455 3456 3457 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3458 public boolean equals(Object other) 3459 { 3460 if (this == other) return true; 3461 if (other == null) return false; 3462 if (other.getClass() != this.getClass()) return false; 3463 3464 frameNavigated o = (frameNavigated) other; 3465 3466 return 3467 Objects.equals(this.frame, o.frame) 3468 && Objects.equals(this.type, o.type); 3469 } 3470 3471 /** Generates a Hash-Code for {@code 'this'} instance */ 3472 public int hashCode() 3473 { 3474 return 3475 this.frame.hashCode() 3476 + Objects.hashCode(this.type); 3477 } 3478 } 3479 3480 /** 3481 * Fired when opening document to write to. 3482 * <BR /> 3483 * <BR /><B>EXPERIMENTAL</B> 3484 */ 3485 public static class documentOpened 3486 extends BrowserEvent 3487 implements java.io.Serializable 3488 { 3489 /** For Object Serialization. java.io.Serializable */ 3490 protected static final long serialVersionUID = 1; 3491 3492 public boolean[] optionals() 3493 { return new boolean[] { false, }; } 3494 3495 /** Frame object. */ 3496 public final Page.Frame frame; 3497 3498 /** 3499 * Constructor 3500 * 3501 * @param frame Frame object. 3502 */ 3503 public documentOpened(Page.Frame frame) 3504 { 3505 super("Page", "documentOpened", 1); 3506 3507 // Exception-Check(s) to ensure that if any parameters which are not declared as 3508 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3509 3510 if (frame == null) THROWS.throwNPE("frame"); 3511 3512 this.frame = frame; 3513 } 3514 3515 /** 3516 * JSON Object Constructor 3517 * @param jo A Json-Object having data about an instance of {@code 'documentOpened'}. 3518 */ 3519 public documentOpened (JsonObject jo) 3520 { 3521 super("Page", "documentOpened", 1); 3522 3523 this.frame = ReadJSON.getObject(jo, "frame", Page.Frame.class, false, true); 3524 } 3525 3526 3527 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3528 public boolean equals(Object other) 3529 { 3530 if (this == other) return true; 3531 if (other == null) return false; 3532 if (other.getClass() != this.getClass()) return false; 3533 3534 documentOpened o = (documentOpened) other; 3535 3536 return 3537 Objects.equals(this.frame, o.frame); 3538 } 3539 3540 /** Generates a Hash-Code for {@code 'this'} instance */ 3541 public int hashCode() 3542 { 3543 return 3544 this.frame.hashCode(); 3545 } 3546 } 3547 3548 /** 3549 * Fired when a renderer-initiated navigation is requested. 3550 * Navigation may still be cancelled after the event is issued. 3551 * <BR /> 3552 * <BR /><B>EXPERIMENTAL</B> 3553 */ 3554 public static class frameRequestedNavigation 3555 extends BrowserEvent 3556 implements java.io.Serializable 3557 { 3558 /** For Object Serialization. java.io.Serializable */ 3559 protected static final long serialVersionUID = 1; 3560 3561 public boolean[] optionals() 3562 { return new boolean[] { false, false, false, false, }; } 3563 3564 /** Id of the frame that is being navigated. */ 3565 public final String frameId; 3566 3567 /** The reason for the navigation. */ 3568 public final String reason; 3569 3570 /** The destination URL for the requested navigation. */ 3571 public final String url; 3572 3573 /** The disposition for the navigation. */ 3574 public final String disposition; 3575 3576 /** 3577 * Constructor 3578 * 3579 * @param frameId Id of the frame that is being navigated. 3580 * 3581 * @param reason The reason for the navigation. 3582 * 3583 * @param url The destination URL for the requested navigation. 3584 * 3585 * @param disposition The disposition for the navigation. 3586 */ 3587 public frameRequestedNavigation 3588 (String frameId, String reason, String url, String disposition) 3589 { 3590 super("Page", "frameRequestedNavigation", 4); 3591 3592 // Exception-Check(s) to ensure that if any parameters which are not declared as 3593 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3594 3595 if (frameId == null) THROWS.throwNPE("frameId"); 3596 if (reason == null) THROWS.throwNPE("reason"); 3597 if (url == null) THROWS.throwNPE("url"); 3598 if (disposition == null) THROWS.throwNPE("disposition"); 3599 3600 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3601 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3602 3603 THROWS.checkIAE("reason", reason, "Page.ClientNavigationReason", Page.ClientNavigationReason); 3604 THROWS.checkIAE("disposition", disposition, "Page.ClientNavigationDisposition", Page.ClientNavigationDisposition); 3605 3606 this.frameId = frameId; 3607 this.reason = reason; 3608 this.url = url; 3609 this.disposition = disposition; 3610 } 3611 3612 /** 3613 * JSON Object Constructor 3614 * @param jo A Json-Object having data about an instance of {@code 'frameRequestedNavigation'}. 3615 */ 3616 public frameRequestedNavigation (JsonObject jo) 3617 { 3618 super("Page", "frameRequestedNavigation", 4); 3619 3620 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3621 this.reason = ReadJSON.getString(jo, "reason", false, true); 3622 this.url = ReadJSON.getString(jo, "url", false, true); 3623 this.disposition = ReadJSON.getString(jo, "disposition", false, true); 3624 } 3625 3626 3627 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3628 public boolean equals(Object other) 3629 { 3630 if (this == other) return true; 3631 if (other == null) return false; 3632 if (other.getClass() != this.getClass()) return false; 3633 3634 frameRequestedNavigation o = (frameRequestedNavigation) other; 3635 3636 return 3637 Objects.equals(this.frameId, o.frameId) 3638 && Objects.equals(this.reason, o.reason) 3639 && Objects.equals(this.url, o.url) 3640 && Objects.equals(this.disposition, o.disposition); 3641 } 3642 3643 /** Generates a Hash-Code for {@code 'this'} instance */ 3644 public int hashCode() 3645 { 3646 return 3647 Objects.hashCode(this.frameId) 3648 + Objects.hashCode(this.reason) 3649 + Objects.hashCode(this.url) 3650 + Objects.hashCode(this.disposition); 3651 } 3652 } 3653 3654 /** 3655 * Fired when frame schedules a potential navigation. 3656 * <BR /> 3657 * <BR /><B>DEPRECATED</B> 3658 */ 3659 public static class frameScheduledNavigation 3660 extends BrowserEvent 3661 implements java.io.Serializable 3662 { 3663 /** For Object Serialization. java.io.Serializable */ 3664 protected static final long serialVersionUID = 1; 3665 3666 public boolean[] optionals() 3667 { return new boolean[] { false, false, false, false, }; } 3668 3669 /** Id of the frame that has scheduled a navigation. */ 3670 public final String frameId; 3671 3672 /** 3673 * Delay (in seconds) until the navigation is scheduled to begin. The navigation is not 3674 * guaranteed to start. 3675 */ 3676 public final Number delay; 3677 3678 /** The reason for the navigation. */ 3679 public final String reason; 3680 3681 /** The destination URL for the scheduled navigation. */ 3682 public final String url; 3683 3684 /** 3685 * Constructor 3686 * 3687 * @param frameId Id of the frame that has scheduled a navigation. 3688 * 3689 * @param delay 3690 * Delay (in seconds) until the navigation is scheduled to begin. The navigation is not 3691 * guaranteed to start. 3692 * 3693 * @param reason The reason for the navigation. 3694 * 3695 * @param url The destination URL for the scheduled navigation. 3696 */ 3697 public frameScheduledNavigation(String frameId, Number delay, String reason, String url) 3698 { 3699 super("Page", "frameScheduledNavigation", 4); 3700 3701 // Exception-Check(s) to ensure that if any parameters which are not declared as 3702 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3703 3704 if (frameId == null) THROWS.throwNPE("frameId"); 3705 if (delay == null) THROWS.throwNPE("delay"); 3706 if (reason == null) THROWS.throwNPE("reason"); 3707 if (url == null) THROWS.throwNPE("url"); 3708 3709 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3710 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3711 3712 THROWS.checkIAE("reason", reason, "Page.ClientNavigationReason", Page.ClientNavigationReason); 3713 3714 this.frameId = frameId; 3715 this.delay = delay; 3716 this.reason = reason; 3717 this.url = url; 3718 } 3719 3720 /** 3721 * JSON Object Constructor 3722 * @param jo A Json-Object having data about an instance of {@code 'frameScheduledNavigation'}. 3723 */ 3724 public frameScheduledNavigation (JsonObject jo) 3725 { 3726 super("Page", "frameScheduledNavigation", 4); 3727 3728 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3729 this.delay = ReadNumberJSON.get(jo, "delay", false, true); 3730 this.reason = ReadJSON.getString(jo, "reason", false, true); 3731 this.url = ReadJSON.getString(jo, "url", false, true); 3732 } 3733 3734 3735 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3736 public boolean equals(Object other) 3737 { 3738 if (this == other) return true; 3739 if (other == null) return false; 3740 if (other.getClass() != this.getClass()) return false; 3741 3742 frameScheduledNavigation o = (frameScheduledNavigation) other; 3743 3744 return 3745 Objects.equals(this.frameId, o.frameId) 3746 && Objects.equals(this.delay, o.delay) 3747 && Objects.equals(this.reason, o.reason) 3748 && Objects.equals(this.url, o.url); 3749 } 3750 3751 /** Generates a Hash-Code for {@code 'this'} instance */ 3752 public int hashCode() 3753 { 3754 return 3755 Objects.hashCode(this.frameId) 3756 + Objects.hashCode(this.delay) 3757 + Objects.hashCode(this.reason) 3758 + Objects.hashCode(this.url); 3759 } 3760 } 3761 3762 /** 3763 * Fired when frame has started loading. 3764 * <BR /> 3765 * <BR /><B>EXPERIMENTAL</B> 3766 */ 3767 public static class frameStartedLoading 3768 extends BrowserEvent 3769 implements java.io.Serializable 3770 { 3771 /** For Object Serialization. java.io.Serializable */ 3772 protected static final long serialVersionUID = 1; 3773 3774 public boolean[] optionals() 3775 { return new boolean[] { false, }; } 3776 3777 /** Id of the frame that has started loading. */ 3778 public final String frameId; 3779 3780 /** 3781 * Constructor 3782 * 3783 * @param frameId Id of the frame that has started loading. 3784 */ 3785 public frameStartedLoading(String frameId) 3786 { 3787 super("Page", "frameStartedLoading", 1); 3788 3789 // Exception-Check(s) to ensure that if any parameters which are not declared as 3790 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3791 3792 if (frameId == null) THROWS.throwNPE("frameId"); 3793 3794 this.frameId = frameId; 3795 } 3796 3797 /** 3798 * JSON Object Constructor 3799 * @param jo A Json-Object having data about an instance of {@code 'frameStartedLoading'}. 3800 */ 3801 public frameStartedLoading (JsonObject jo) 3802 { 3803 super("Page", "frameStartedLoading", 1); 3804 3805 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3806 } 3807 3808 3809 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3810 public boolean equals(Object other) 3811 { 3812 if (this == other) return true; 3813 if (other == null) return false; 3814 if (other.getClass() != this.getClass()) return false; 3815 3816 frameStartedLoading o = (frameStartedLoading) other; 3817 3818 return 3819 Objects.equals(this.frameId, o.frameId); 3820 } 3821 3822 /** Generates a Hash-Code for {@code 'this'} instance */ 3823 public int hashCode() 3824 { 3825 return 3826 Objects.hashCode(this.frameId); 3827 } 3828 } 3829 3830 /** 3831 * Fired when frame has stopped loading. 3832 * <BR /> 3833 * <BR /><B>EXPERIMENTAL</B> 3834 */ 3835 public static class frameStoppedLoading 3836 extends BrowserEvent 3837 implements java.io.Serializable 3838 { 3839 /** For Object Serialization. java.io.Serializable */ 3840 protected static final long serialVersionUID = 1; 3841 3842 public boolean[] optionals() 3843 { return new boolean[] { false, }; } 3844 3845 /** Id of the frame that has stopped loading. */ 3846 public final String frameId; 3847 3848 /** 3849 * Constructor 3850 * 3851 * @param frameId Id of the frame that has stopped loading. 3852 */ 3853 public frameStoppedLoading(String frameId) 3854 { 3855 super("Page", "frameStoppedLoading", 1); 3856 3857 // Exception-Check(s) to ensure that if any parameters which are not declared as 3858 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3859 3860 if (frameId == null) THROWS.throwNPE("frameId"); 3861 3862 this.frameId = frameId; 3863 } 3864 3865 /** 3866 * JSON Object Constructor 3867 * @param jo A Json-Object having data about an instance of {@code 'frameStoppedLoading'}. 3868 */ 3869 public frameStoppedLoading (JsonObject jo) 3870 { 3871 super("Page", "frameStoppedLoading", 1); 3872 3873 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3874 } 3875 3876 3877 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3878 public boolean equals(Object other) 3879 { 3880 if (this == other) return true; 3881 if (other == null) return false; 3882 if (other.getClass() != this.getClass()) return false; 3883 3884 frameStoppedLoading o = (frameStoppedLoading) other; 3885 3886 return 3887 Objects.equals(this.frameId, o.frameId); 3888 } 3889 3890 /** Generates a Hash-Code for {@code 'this'} instance */ 3891 public int hashCode() 3892 { 3893 return 3894 Objects.hashCode(this.frameId); 3895 } 3896 } 3897 3898 /** 3899 * Fired when page is about to start a download. 3900 * Deprecated. Use Browser.downloadWillBegin instead. 3901 * <BR /> 3902 * <BR /><B>EXPERIMENTAL</B> 3903 * <BR /><B>DEPRECATED</B> 3904 */ 3905 public static class downloadWillBegin 3906 extends BrowserEvent 3907 implements java.io.Serializable 3908 { 3909 /** For Object Serialization. java.io.Serializable */ 3910 protected static final long serialVersionUID = 1; 3911 3912 public boolean[] optionals() 3913 { return new boolean[] { false, false, false, false, }; } 3914 3915 /** Id of the frame that caused download to begin. */ 3916 public final String frameId; 3917 3918 /** Global unique identifier of the download. */ 3919 public final String guid; 3920 3921 /** URL of the resource being downloaded. */ 3922 public final String url; 3923 3924 /** Suggested file name of the resource (the actual name of the file saved on disk may differ). */ 3925 public final String suggestedFilename; 3926 3927 /** 3928 * Constructor 3929 * 3930 * @param frameId Id of the frame that caused download to begin. 3931 * 3932 * @param guid Global unique identifier of the download. 3933 * 3934 * @param url URL of the resource being downloaded. 3935 * 3936 * @param suggestedFilename Suggested file name of the resource (the actual name of the file saved on disk may differ). 3937 */ 3938 public downloadWillBegin 3939 (String frameId, String guid, String url, String suggestedFilename) 3940 { 3941 super("Page", "downloadWillBegin", 4); 3942 3943 // Exception-Check(s) to ensure that if any parameters which are not declared as 3944 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3945 3946 if (frameId == null) THROWS.throwNPE("frameId"); 3947 if (guid == null) THROWS.throwNPE("guid"); 3948 if (url == null) THROWS.throwNPE("url"); 3949 if (suggestedFilename == null) THROWS.throwNPE("suggestedFilename"); 3950 3951 this.frameId = frameId; 3952 this.guid = guid; 3953 this.url = url; 3954 this.suggestedFilename = suggestedFilename; 3955 } 3956 3957 /** 3958 * JSON Object Constructor 3959 * @param jo A Json-Object having data about an instance of {@code 'downloadWillBegin'}. 3960 */ 3961 public downloadWillBegin (JsonObject jo) 3962 { 3963 super("Page", "downloadWillBegin", 4); 3964 3965 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 3966 this.guid = ReadJSON.getString(jo, "guid", false, true); 3967 this.url = ReadJSON.getString(jo, "url", false, true); 3968 this.suggestedFilename = ReadJSON.getString(jo, "suggestedFilename", false, true); 3969 } 3970 3971 3972 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3973 public boolean equals(Object other) 3974 { 3975 if (this == other) return true; 3976 if (other == null) return false; 3977 if (other.getClass() != this.getClass()) return false; 3978 3979 downloadWillBegin o = (downloadWillBegin) other; 3980 3981 return 3982 Objects.equals(this.frameId, o.frameId) 3983 && Objects.equals(this.guid, o.guid) 3984 && Objects.equals(this.url, o.url) 3985 && Objects.equals(this.suggestedFilename, o.suggestedFilename); 3986 } 3987 3988 /** Generates a Hash-Code for {@code 'this'} instance */ 3989 public int hashCode() 3990 { 3991 return 3992 Objects.hashCode(this.frameId) 3993 + Objects.hashCode(this.guid) 3994 + Objects.hashCode(this.url) 3995 + Objects.hashCode(this.suggestedFilename); 3996 } 3997 } 3998 3999 /** 4000 * Fired when download makes progress. Last call has |done| == true. 4001 * Deprecated. Use Browser.downloadProgress instead. 4002 * <BR /> 4003 * <BR /><B>EXPERIMENTAL</B> 4004 * <BR /><B>DEPRECATED</B> 4005 */ 4006 public static class downloadProgress 4007 extends BrowserEvent 4008 implements java.io.Serializable 4009 { 4010 /** For Object Serialization. java.io.Serializable */ 4011 protected static final long serialVersionUID = 1; 4012 4013 public boolean[] optionals() 4014 { return new boolean[] { false, false, false, false, }; } 4015 4016 /** Global unique identifier of the download. */ 4017 public final String guid; 4018 4019 /** Total expected bytes to download. */ 4020 public final Number totalBytes; 4021 4022 /** Total bytes received. */ 4023 public final Number receivedBytes; 4024 4025 /** Download status. */ 4026 public final String state; 4027 4028 /** 4029 * Constructor 4030 * 4031 * @param guid Global unique identifier of the download. 4032 * 4033 * @param totalBytes Total expected bytes to download. 4034 * 4035 * @param receivedBytes Total bytes received. 4036 * 4037 * @param state Download status. 4038 * <BR />Acceptable Values: ["inProgress", "completed", "canceled"] 4039 */ 4040 public downloadProgress 4041 (String guid, Number totalBytes, Number receivedBytes, String state) 4042 { 4043 super("Page", "downloadProgress", 4); 4044 4045 // Exception-Check(s) to ensure that if any parameters which are not declared as 4046 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4047 4048 if (guid == null) THROWS.throwNPE("guid"); 4049 if (totalBytes == null) THROWS.throwNPE("totalBytes"); 4050 if (receivedBytes == null) THROWS.throwNPE("receivedBytes"); 4051 if (state == null) THROWS.throwNPE("state"); 4052 4053 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4054 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4055 4056 THROWS.checkIAE( 4057 "state", state, 4058 "inProgress", "completed", "canceled" 4059 ); 4060 4061 this.guid = guid; 4062 this.totalBytes = totalBytes; 4063 this.receivedBytes = receivedBytes; 4064 this.state = state; 4065 } 4066 4067 /** 4068 * JSON Object Constructor 4069 * @param jo A Json-Object having data about an instance of {@code 'downloadProgress'}. 4070 */ 4071 public downloadProgress (JsonObject jo) 4072 { 4073 super("Page", "downloadProgress", 4); 4074 4075 this.guid = ReadJSON.getString(jo, "guid", false, true); 4076 this.totalBytes = ReadNumberJSON.get(jo, "totalBytes", false, true); 4077 this.receivedBytes = ReadNumberJSON.get(jo, "receivedBytes", false, true); 4078 this.state = ReadJSON.getString(jo, "state", false, true); 4079 } 4080 4081 4082 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4083 public boolean equals(Object other) 4084 { 4085 if (this == other) return true; 4086 if (other == null) return false; 4087 if (other.getClass() != this.getClass()) return false; 4088 4089 downloadProgress o = (downloadProgress) other; 4090 4091 return 4092 Objects.equals(this.guid, o.guid) 4093 && Objects.equals(this.totalBytes, o.totalBytes) 4094 && Objects.equals(this.receivedBytes, o.receivedBytes) 4095 && Objects.equals(this.state, o.state); 4096 } 4097 4098 /** Generates a Hash-Code for {@code 'this'} instance */ 4099 public int hashCode() 4100 { 4101 return 4102 Objects.hashCode(this.guid) 4103 + Objects.hashCode(this.totalBytes) 4104 + Objects.hashCode(this.receivedBytes) 4105 + Objects.hashCode(this.state); 4106 } 4107 } 4108 4109 /** 4110 * Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been 4111 * closed. 4112 */ 4113 public static class javascriptDialogClosed 4114 extends BrowserEvent 4115 implements java.io.Serializable 4116 { 4117 /** For Object Serialization. java.io.Serializable */ 4118 protected static final long serialVersionUID = 1; 4119 4120 public boolean[] optionals() 4121 { return new boolean[] { false, false, }; } 4122 4123 /** Whether dialog was confirmed. */ 4124 public final boolean result; 4125 4126 /** User input in case of prompt. */ 4127 public final String userInput; 4128 4129 /** 4130 * Constructor 4131 * 4132 * @param result Whether dialog was confirmed. 4133 * 4134 * @param userInput User input in case of prompt. 4135 */ 4136 public javascriptDialogClosed(boolean result, String userInput) 4137 { 4138 super("Page", "javascriptDialogClosed", 2); 4139 4140 // Exception-Check(s) to ensure that if any parameters which are not declared as 4141 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4142 4143 if (userInput == null) THROWS.throwNPE("userInput"); 4144 4145 this.result = result; 4146 this.userInput = userInput; 4147 } 4148 4149 /** 4150 * JSON Object Constructor 4151 * @param jo A Json-Object having data about an instance of {@code 'javascriptDialogClosed'}. 4152 */ 4153 public javascriptDialogClosed (JsonObject jo) 4154 { 4155 super("Page", "javascriptDialogClosed", 2); 4156 4157 this.result = ReadPrimJSON.getBoolean(jo, "result"); 4158 this.userInput = ReadJSON.getString(jo, "userInput", false, true); 4159 } 4160 4161 4162 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4163 public boolean equals(Object other) 4164 { 4165 if (this == other) return true; 4166 if (other == null) return false; 4167 if (other.getClass() != this.getClass()) return false; 4168 4169 javascriptDialogClosed o = (javascriptDialogClosed) other; 4170 4171 return 4172 (this.result == o.result) 4173 && Objects.equals(this.userInput, o.userInput); 4174 } 4175 4176 /** Generates a Hash-Code for {@code 'this'} instance */ 4177 public int hashCode() 4178 { 4179 return 4180 (this.result ? 1 : 0) 4181 + Objects.hashCode(this.userInput); 4182 } 4183 } 4184 4185 /** 4186 * Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to 4187 * open. 4188 */ 4189 public static class javascriptDialogOpening 4190 extends BrowserEvent 4191 implements java.io.Serializable 4192 { 4193 /** For Object Serialization. java.io.Serializable */ 4194 protected static final long serialVersionUID = 1; 4195 4196 public boolean[] optionals() 4197 { return new boolean[] { false, false, false, false, true, }; } 4198 4199 /** Frame url. */ 4200 public final String url; 4201 4202 /** Message that will be displayed by the dialog. */ 4203 public final String message; 4204 4205 /** Dialog type. */ 4206 public final String type; 4207 4208 /** 4209 * True iff browser is capable showing or acting on the given dialog. When browser has no 4210 * dialog handler for given target, calling alert while Page domain is engaged will stall 4211 * the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog. 4212 */ 4213 public final boolean hasBrowserHandler; 4214 4215 /** 4216 * Default dialog prompt. 4217 * <BR /> 4218 * <BR /><B>OPTIONAL</B> 4219 */ 4220 public final String defaultPrompt; 4221 4222 /** 4223 * Constructor 4224 * 4225 * @param url Frame url. 4226 * 4227 * @param message Message that will be displayed by the dialog. 4228 * 4229 * @param type Dialog type. 4230 * 4231 * @param hasBrowserHandler 4232 * True iff browser is capable showing or acting on the given dialog. When browser has no 4233 * dialog handler for given target, calling alert while Page domain is engaged will stall 4234 * the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog. 4235 * 4236 * @param defaultPrompt Default dialog prompt. 4237 * <BR /><B>OPTIONAL</B> 4238 */ 4239 public javascriptDialogOpening( 4240 String url, String message, String type, boolean hasBrowserHandler, 4241 String defaultPrompt 4242 ) 4243 { 4244 super("Page", "javascriptDialogOpening", 5); 4245 4246 // Exception-Check(s) to ensure that if any parameters which are not declared as 4247 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4248 4249 if (url == null) THROWS.throwNPE("url"); 4250 if (message == null) THROWS.throwNPE("message"); 4251 if (type == null) THROWS.throwNPE("type"); 4252 4253 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4254 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4255 4256 THROWS.checkIAE("type", type, "Page.DialogType", Page.DialogType); 4257 4258 this.url = url; 4259 this.message = message; 4260 this.type = type; 4261 this.hasBrowserHandler = hasBrowserHandler; 4262 this.defaultPrompt = defaultPrompt; 4263 } 4264 4265 /** 4266 * JSON Object Constructor 4267 * @param jo A Json-Object having data about an instance of {@code 'javascriptDialogOpening'}. 4268 */ 4269 public javascriptDialogOpening (JsonObject jo) 4270 { 4271 super("Page", "javascriptDialogOpening", 5); 4272 4273 this.url = ReadJSON.getString(jo, "url", false, true); 4274 this.message = ReadJSON.getString(jo, "message", false, true); 4275 this.type = ReadJSON.getString(jo, "type", false, true); 4276 this.hasBrowserHandler = ReadPrimJSON.getBoolean(jo, "hasBrowserHandler"); 4277 this.defaultPrompt = ReadJSON.getString(jo, "defaultPrompt", true, false); 4278 } 4279 4280 4281 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4282 public boolean equals(Object other) 4283 { 4284 if (this == other) return true; 4285 if (other == null) return false; 4286 if (other.getClass() != this.getClass()) return false; 4287 4288 javascriptDialogOpening o = (javascriptDialogOpening) other; 4289 4290 return 4291 Objects.equals(this.url, o.url) 4292 && Objects.equals(this.message, o.message) 4293 && Objects.equals(this.type, o.type) 4294 && (this.hasBrowserHandler == o.hasBrowserHandler) 4295 && Objects.equals(this.defaultPrompt, o.defaultPrompt); 4296 } 4297 4298 /** Generates a Hash-Code for {@code 'this'} instance */ 4299 public int hashCode() 4300 { 4301 return 4302 Objects.hashCode(this.url) 4303 + Objects.hashCode(this.message) 4304 + Objects.hashCode(this.type) 4305 + (this.hasBrowserHandler ? 1 : 0) 4306 + Objects.hashCode(this.defaultPrompt); 4307 } 4308 } 4309 4310 /** Fired for top level page lifecycle events such as navigation, load, paint, etc. */ 4311 public static class lifecycleEvent 4312 extends BrowserEvent 4313 implements java.io.Serializable 4314 { 4315 /** For Object Serialization. java.io.Serializable */ 4316 protected static final long serialVersionUID = 1; 4317 4318 public boolean[] optionals() 4319 { return new boolean[] { false, false, false, false, }; } 4320 4321 /** Id of the frame. */ 4322 public final String frameId; 4323 4324 /** Loader identifier. Empty string if the request is fetched from worker. */ 4325 public final String loaderId; 4326 4327 /** <CODE>[No Description Provided by Google]</CODE> */ 4328 public final String name; 4329 4330 /** <CODE>[No Description Provided by Google]</CODE> */ 4331 public final Number timestamp; 4332 4333 /** 4334 * Constructor 4335 * 4336 * @param frameId Id of the frame. 4337 * 4338 * @param loaderId Loader identifier. Empty string if the request is fetched from worker. 4339 * 4340 * @param name - 4341 * 4342 * @param timestamp - 4343 */ 4344 public lifecycleEvent(String frameId, String loaderId, String name, Number timestamp) 4345 { 4346 super("Page", "lifecycleEvent", 4); 4347 4348 // Exception-Check(s) to ensure that if any parameters which are not declared as 4349 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4350 4351 if (frameId == null) THROWS.throwNPE("frameId"); 4352 if (loaderId == null) THROWS.throwNPE("loaderId"); 4353 if (name == null) THROWS.throwNPE("name"); 4354 if (timestamp == null) THROWS.throwNPE("timestamp"); 4355 4356 this.frameId = frameId; 4357 this.loaderId = loaderId; 4358 this.name = name; 4359 this.timestamp = timestamp; 4360 } 4361 4362 /** 4363 * JSON Object Constructor 4364 * @param jo A Json-Object having data about an instance of {@code 'lifecycleEvent'}. 4365 */ 4366 public lifecycleEvent (JsonObject jo) 4367 { 4368 super("Page", "lifecycleEvent", 4); 4369 4370 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 4371 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 4372 this.name = ReadJSON.getString(jo, "name", false, true); 4373 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 4374 } 4375 4376 4377 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4378 public boolean equals(Object other) 4379 { 4380 if (this == other) return true; 4381 if (other == null) return false; 4382 if (other.getClass() != this.getClass()) return false; 4383 4384 lifecycleEvent o = (lifecycleEvent) other; 4385 4386 return 4387 Objects.equals(this.frameId, o.frameId) 4388 && Objects.equals(this.loaderId, o.loaderId) 4389 && Objects.equals(this.name, o.name) 4390 && Objects.equals(this.timestamp, o.timestamp); 4391 } 4392 4393 /** Generates a Hash-Code for {@code 'this'} instance */ 4394 public int hashCode() 4395 { 4396 return 4397 Objects.hashCode(this.frameId) 4398 + Objects.hashCode(this.loaderId) 4399 + Objects.hashCode(this.name) 4400 + Objects.hashCode(this.timestamp); 4401 } 4402 } 4403 4404 /** 4405 * Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do 4406 * not assume any ordering with the Page.frameNavigated event. This event is fired only for 4407 * main-frame history navigation where the document changes (non-same-document navigations), 4408 * when bfcache navigation fails. 4409 * <BR /> 4410 * <BR /><B>EXPERIMENTAL</B> 4411 */ 4412 public static class backForwardCacheNotUsed 4413 extends BrowserEvent 4414 implements java.io.Serializable 4415 { 4416 /** For Object Serialization. java.io.Serializable */ 4417 protected static final long serialVersionUID = 1; 4418 4419 public boolean[] optionals() 4420 { return new boolean[] { false, false, false, }; } 4421 4422 /** The loader id for the associated navgation. */ 4423 public final String loaderId; 4424 4425 /** The frame id of the associated frame. */ 4426 public final String frameId; 4427 4428 /** Array of reasons why the page could not be cached. This must not be empty. */ 4429 public final Page.BackForwardCacheNotRestoredExplanation[] notRestoredExplanations; 4430 4431 /** 4432 * Constructor 4433 * 4434 * @param loaderId The loader id for the associated navgation. 4435 * 4436 * @param frameId The frame id of the associated frame. 4437 * 4438 * @param notRestoredExplanations Array of reasons why the page could not be cached. This must not be empty. 4439 */ 4440 public backForwardCacheNotUsed( 4441 String loaderId, String frameId, 4442 Page.BackForwardCacheNotRestoredExplanation[] notRestoredExplanations 4443 ) 4444 { 4445 super("Page", "backForwardCacheNotUsed", 3); 4446 4447 // Exception-Check(s) to ensure that if any parameters which are not declared as 4448 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4449 4450 if (loaderId == null) THROWS.throwNPE("loaderId"); 4451 if (frameId == null) THROWS.throwNPE("frameId"); 4452 if (notRestoredExplanations == null) THROWS.throwNPE("notRestoredExplanations"); 4453 4454 this.loaderId = loaderId; 4455 this.frameId = frameId; 4456 this.notRestoredExplanations = notRestoredExplanations; 4457 } 4458 4459 /** 4460 * JSON Object Constructor 4461 * @param jo A Json-Object having data about an instance of {@code 'backForwardCacheNotUsed'}. 4462 */ 4463 public backForwardCacheNotUsed (JsonObject jo) 4464 { 4465 super("Page", "backForwardCacheNotUsed", 3); 4466 4467 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 4468 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 4469 this.notRestoredExplanations = (jo.getJsonArray("notRestoredExplanations") == null) 4470 ? null 4471 : RJArrIntoStream.objArr(jo.getJsonArray("notRestoredExplanations"), null, 0, Page.BackForwardCacheNotRestoredExplanation.class).toArray(Page.BackForwardCacheNotRestoredExplanation[]::new); 4472 4473 } 4474 4475 4476 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4477 public boolean equals(Object other) 4478 { 4479 if (this == other) return true; 4480 if (other == null) return false; 4481 if (other.getClass() != this.getClass()) return false; 4482 4483 backForwardCacheNotUsed o = (backForwardCacheNotUsed) other; 4484 4485 return 4486 Objects.equals(this.loaderId, o.loaderId) 4487 && Objects.equals(this.frameId, o.frameId) 4488 && Arrays.deepEquals(this.notRestoredExplanations, o.notRestoredExplanations); 4489 } 4490 4491 /** Generates a Hash-Code for {@code 'this'} instance */ 4492 public int hashCode() 4493 { 4494 return 4495 Objects.hashCode(this.loaderId) 4496 + Objects.hashCode(this.frameId) 4497 + Arrays.deepHashCode(this.notRestoredExplanations); 4498 } 4499 } 4500 4501 /** <CODE>[No Description Provided by Google]</CODE> */ 4502 public static class loadEventFired 4503 extends BrowserEvent 4504 implements java.io.Serializable 4505 { 4506 /** For Object Serialization. java.io.Serializable */ 4507 protected static final long serialVersionUID = 1; 4508 4509 public boolean[] optionals() 4510 { return new boolean[] { false, }; } 4511 4512 /** <CODE>[No Description Provided by Google]</CODE> */ 4513 public final Number timestamp; 4514 4515 /** 4516 * Constructor 4517 * 4518 * @param timestamp - 4519 */ 4520 public loadEventFired(Number timestamp) 4521 { 4522 super("Page", "loadEventFired", 1); 4523 4524 // Exception-Check(s) to ensure that if any parameters which are not declared as 4525 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4526 4527 if (timestamp == null) THROWS.throwNPE("timestamp"); 4528 4529 this.timestamp = timestamp; 4530 } 4531 4532 /** 4533 * JSON Object Constructor 4534 * @param jo A Json-Object having data about an instance of {@code 'loadEventFired'}. 4535 */ 4536 public loadEventFired (JsonObject jo) 4537 { 4538 super("Page", "loadEventFired", 1); 4539 4540 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 4541 } 4542 4543 4544 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4545 public boolean equals(Object other) 4546 { 4547 if (this == other) return true; 4548 if (other == null) return false; 4549 if (other.getClass() != this.getClass()) return false; 4550 4551 loadEventFired o = (loadEventFired) other; 4552 4553 return 4554 Objects.equals(this.timestamp, o.timestamp); 4555 } 4556 4557 /** Generates a Hash-Code for {@code 'this'} instance */ 4558 public int hashCode() 4559 { 4560 return 4561 Objects.hashCode(this.timestamp); 4562 } 4563 } 4564 4565 /** 4566 * Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. 4567 * <BR /> 4568 * <BR /><B>EXPERIMENTAL</B> 4569 */ 4570 public static class navigatedWithinDocument 4571 extends BrowserEvent 4572 implements java.io.Serializable 4573 { 4574 /** For Object Serialization. java.io.Serializable */ 4575 protected static final long serialVersionUID = 1; 4576 4577 public boolean[] optionals() 4578 { return new boolean[] { false, false, }; } 4579 4580 /** Id of the frame. */ 4581 public final String frameId; 4582 4583 /** Frame's new url. */ 4584 public final String url; 4585 4586 /** 4587 * Constructor 4588 * 4589 * @param frameId Id of the frame. 4590 * 4591 * @param url Frame's new url. 4592 */ 4593 public navigatedWithinDocument(String frameId, String url) 4594 { 4595 super("Page", "navigatedWithinDocument", 2); 4596 4597 // Exception-Check(s) to ensure that if any parameters which are not declared as 4598 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4599 4600 if (frameId == null) THROWS.throwNPE("frameId"); 4601 if (url == null) THROWS.throwNPE("url"); 4602 4603 this.frameId = frameId; 4604 this.url = url; 4605 } 4606 4607 /** 4608 * JSON Object Constructor 4609 * @param jo A Json-Object having data about an instance of {@code 'navigatedWithinDocument'}. 4610 */ 4611 public navigatedWithinDocument (JsonObject jo) 4612 { 4613 super("Page", "navigatedWithinDocument", 2); 4614 4615 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 4616 this.url = ReadJSON.getString(jo, "url", false, true); 4617 } 4618 4619 4620 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4621 public boolean equals(Object other) 4622 { 4623 if (this == other) return true; 4624 if (other == null) return false; 4625 if (other.getClass() != this.getClass()) return false; 4626 4627 navigatedWithinDocument o = (navigatedWithinDocument) other; 4628 4629 return 4630 Objects.equals(this.frameId, o.frameId) 4631 && Objects.equals(this.url, o.url); 4632 } 4633 4634 /** Generates a Hash-Code for {@code 'this'} instance */ 4635 public int hashCode() 4636 { 4637 return 4638 Objects.hashCode(this.frameId) 4639 + Objects.hashCode(this.url); 4640 } 4641 } 4642 4643 /** 4644 * Compressed image data requested by the <CODE>startScreencast</CODE>. 4645 * <BR /> 4646 * <BR /><B>EXPERIMENTAL</B> 4647 */ 4648 public static class screencastFrame 4649 extends BrowserEvent 4650 implements java.io.Serializable 4651 { 4652 /** For Object Serialization. java.io.Serializable */ 4653 protected static final long serialVersionUID = 1; 4654 4655 public boolean[] optionals() 4656 { return new boolean[] { false, false, false, }; } 4657 4658 /** Base64-encoded compressed image. (Encoded as a base64 string when passed over JSON) */ 4659 public final String data; 4660 4661 /** Screencast frame metadata. */ 4662 public final Page.ScreencastFrameMetadata metadata; 4663 4664 /** Frame number. */ 4665 public final int sessionId; 4666 4667 /** 4668 * Constructor 4669 * 4670 * @param data Base64-encoded compressed image. (Encoded as a base64 string when passed over JSON) 4671 * 4672 * @param metadata Screencast frame metadata. 4673 * 4674 * @param sessionId Frame number. 4675 */ 4676 public screencastFrame 4677 (String data, Page.ScreencastFrameMetadata metadata, int sessionId) 4678 { 4679 super("Page", "screencastFrame", 3); 4680 4681 // Exception-Check(s) to ensure that if any parameters which are not declared as 4682 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4683 4684 if (data == null) THROWS.throwNPE("data"); 4685 if (metadata == null) THROWS.throwNPE("metadata"); 4686 4687 this.data = data; 4688 this.metadata = metadata; 4689 this.sessionId = sessionId; 4690 } 4691 4692 /** 4693 * JSON Object Constructor 4694 * @param jo A Json-Object having data about an instance of {@code 'screencastFrame'}. 4695 */ 4696 public screencastFrame (JsonObject jo) 4697 { 4698 super("Page", "screencastFrame", 3); 4699 4700 this.data = ReadJSON.getString(jo, "data", false, true); 4701 this.metadata = ReadJSON.getObject(jo, "metadata", Page.ScreencastFrameMetadata.class, false, true); 4702 this.sessionId = ReadPrimJSON.getInt(jo, "sessionId"); 4703 } 4704 4705 4706 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4707 public boolean equals(Object other) 4708 { 4709 if (this == other) return true; 4710 if (other == null) return false; 4711 if (other.getClass() != this.getClass()) return false; 4712 4713 screencastFrame o = (screencastFrame) other; 4714 4715 return 4716 Objects.equals(this.data, o.data) 4717 && Objects.equals(this.metadata, o.metadata) 4718 && (this.sessionId == o.sessionId); 4719 } 4720 4721 /** Generates a Hash-Code for {@code 'this'} instance */ 4722 public int hashCode() 4723 { 4724 return 4725 Objects.hashCode(this.data) 4726 + this.metadata.hashCode() 4727 + this.sessionId; 4728 } 4729 } 4730 4731 /** 4732 * Fired when the page with currently enabled screencast was shown or hidden. 4733 * <BR /> 4734 * <BR /><B>EXPERIMENTAL</B> 4735 */ 4736 public static class screencastVisibilityChanged 4737 extends BrowserEvent 4738 implements java.io.Serializable 4739 { 4740 /** For Object Serialization. java.io.Serializable */ 4741 protected static final long serialVersionUID = 1; 4742 4743 public boolean[] optionals() 4744 { return new boolean[] { false, }; } 4745 4746 /** True if the page is visible. */ 4747 public final boolean visible; 4748 4749 /** 4750 * Constructor 4751 * 4752 * @param visible True if the page is visible. 4753 */ 4754 public screencastVisibilityChanged(boolean visible) 4755 { 4756 super("Page", "screencastVisibilityChanged", 1); 4757 4758 this.visible = visible; 4759 } 4760 4761 /** 4762 * JSON Object Constructor 4763 * @param jo A Json-Object having data about an instance of {@code 'screencastVisibilityChanged'}. 4764 */ 4765 public screencastVisibilityChanged (JsonObject jo) 4766 { 4767 super("Page", "screencastVisibilityChanged", 1); 4768 4769 this.visible = ReadPrimJSON.getBoolean(jo, "visible"); 4770 } 4771 4772 4773 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4774 public boolean equals(Object other) 4775 { 4776 if (this == other) return true; 4777 if (other == null) return false; 4778 if (other.getClass() != this.getClass()) return false; 4779 4780 screencastVisibilityChanged o = (screencastVisibilityChanged) other; 4781 4782 return 4783 (this.visible == o.visible); 4784 } 4785 4786 /** Generates a Hash-Code for {@code 'this'} instance */ 4787 public int hashCode() 4788 { 4789 return 4790 (this.visible ? 1 : 0); 4791 } 4792 } 4793 4794 /** 4795 * Fired when a new window is going to be opened, via window.open(), link click, form submission, 4796 * etc. 4797 */ 4798 public static class windowOpen 4799 extends BrowserEvent 4800 implements java.io.Serializable 4801 { 4802 /** For Object Serialization. java.io.Serializable */ 4803 protected static final long serialVersionUID = 1; 4804 4805 public boolean[] optionals() 4806 { return new boolean[] { false, false, false, false, }; } 4807 4808 /** The URL for the new window. */ 4809 public final String url; 4810 4811 /** Window name. */ 4812 public final String windowName; 4813 4814 /** An array of enabled window features. */ 4815 public final String[] windowFeatures; 4816 4817 /** Whether or not it was triggered by user gesture. */ 4818 public final boolean userGesture; 4819 4820 /** 4821 * Constructor 4822 * 4823 * @param url The URL for the new window. 4824 * 4825 * @param windowName Window name. 4826 * 4827 * @param windowFeatures An array of enabled window features. 4828 * 4829 * @param userGesture Whether or not it was triggered by user gesture. 4830 */ 4831 public windowOpen 4832 (String url, String windowName, String[] windowFeatures, boolean userGesture) 4833 { 4834 super("Page", "windowOpen", 4); 4835 4836 // Exception-Check(s) to ensure that if any parameters which are not declared as 4837 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4838 4839 if (url == null) THROWS.throwNPE("url"); 4840 if (windowName == null) THROWS.throwNPE("windowName"); 4841 if (windowFeatures == null) THROWS.throwNPE("windowFeatures"); 4842 4843 this.url = url; 4844 this.windowName = windowName; 4845 this.windowFeatures = windowFeatures; 4846 this.userGesture = userGesture; 4847 } 4848 4849 /** 4850 * JSON Object Constructor 4851 * @param jo A Json-Object having data about an instance of {@code 'windowOpen'}. 4852 */ 4853 public windowOpen (JsonObject jo) 4854 { 4855 super("Page", "windowOpen", 4); 4856 4857 this.url = ReadJSON.getString(jo, "url", false, true); 4858 this.windowName = ReadJSON.getString(jo, "windowName", false, true); 4859 this.windowFeatures = (jo.getJsonArray("windowFeatures") == null) 4860 ? null 4861 : RJArrIntoStream.strArr(jo.getJsonArray("windowFeatures"), null, 0).toArray(String[]::new); 4862 4863 this.userGesture = ReadPrimJSON.getBoolean(jo, "userGesture"); 4864 } 4865 4866 4867 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4868 public boolean equals(Object other) 4869 { 4870 if (this == other) return true; 4871 if (other == null) return false; 4872 if (other.getClass() != this.getClass()) return false; 4873 4874 windowOpen o = (windowOpen) other; 4875 4876 return 4877 Objects.equals(this.url, o.url) 4878 && Objects.equals(this.windowName, o.windowName) 4879 && Arrays.deepEquals(this.windowFeatures, o.windowFeatures) 4880 && (this.userGesture == o.userGesture); 4881 } 4882 4883 /** Generates a Hash-Code for {@code 'this'} instance */ 4884 public int hashCode() 4885 { 4886 return 4887 Objects.hashCode(this.url) 4888 + Objects.hashCode(this.windowName) 4889 + Arrays.deepHashCode(this.windowFeatures) 4890 + (this.userGesture ? 1 : 0); 4891 } 4892 } 4893 4894 /** 4895 * Issued for every compilation cache generated. Is only available 4896 * if Page.setGenerateCompilationCache is enabled. 4897 * <BR /> 4898 * <BR /><B>EXPERIMENTAL</B> 4899 */ 4900 public static class compilationCacheProduced 4901 extends BrowserEvent 4902 implements java.io.Serializable 4903 { 4904 /** For Object Serialization. java.io.Serializable */ 4905 protected static final long serialVersionUID = 1; 4906 4907 public boolean[] optionals() 4908 { return new boolean[] { false, false, }; } 4909 4910 /** <CODE>[No Description Provided by Google]</CODE> */ 4911 public final String url; 4912 4913 /** Base64-encoded data (Encoded as a base64 string when passed over JSON) */ 4914 public final String data; 4915 4916 /** 4917 * Constructor 4918 * 4919 * @param url - 4920 * 4921 * @param data Base64-encoded data (Encoded as a base64 string when passed over JSON) 4922 */ 4923 public compilationCacheProduced(String url, String data) 4924 { 4925 super("Page", "compilationCacheProduced", 2); 4926 4927 // Exception-Check(s) to ensure that if any parameters which are not declared as 4928 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4929 4930 if (url == null) THROWS.throwNPE("url"); 4931 if (data == null) THROWS.throwNPE("data"); 4932 4933 this.url = url; 4934 this.data = data; 4935 } 4936 4937 /** 4938 * JSON Object Constructor 4939 * @param jo A Json-Object having data about an instance of {@code 'compilationCacheProduced'}. 4940 */ 4941 public compilationCacheProduced (JsonObject jo) 4942 { 4943 super("Page", "compilationCacheProduced", 2); 4944 4945 this.url = ReadJSON.getString(jo, "url", false, true); 4946 this.data = ReadJSON.getString(jo, "data", false, true); 4947 } 4948 4949 4950 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4951 public boolean equals(Object other) 4952 { 4953 if (this == other) return true; 4954 if (other == null) return false; 4955 if (other.getClass() != this.getClass()) return false; 4956 4957 compilationCacheProduced o = (compilationCacheProduced) other; 4958 4959 return 4960 Objects.equals(this.url, o.url) 4961 && Objects.equals(this.data, o.data); 4962 } 4963 4964 /** Generates a Hash-Code for {@code 'this'} instance */ 4965 public int hashCode() 4966 { 4967 return 4968 Objects.hashCode(this.url) 4969 + Objects.hashCode(this.data); 4970 } 4971 } 4972 4973 4974 // Counter for keeping the WebSocket Request ID's distinct. 4975 private static int counter = 1; 4976 4977 /** 4978 * Deprecated, please use addScriptToEvaluateOnNewDocument instead. 4979 * <BR /><B>EXPERIMENTAL</B> 4980 * <BR /><B>DEPRECATED</B> 4981 * 4982 * @param scriptSource - 4983 * 4984 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 4985 * String></CODE> 4986 * 4987 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 4988 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 4989 * String></CODE> will be returned. 4990 * 4991 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 4992 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 4993 * may be retrieved.</I> 4994 * 4995 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 4996 * <BR /><BR /><UL CLASS=JDUL> 4997 * <LI><CODE>String (<B>identifier</B></CODE>) 4998 * <BR />Identifier of the added script. 4999 * </LI> 5000 * </UL> */ 5001 public static Script<String, JsonObject, String> addScriptToEvaluateOnLoad 5002 (String scriptSource) 5003 { 5004 // Exception-Check(s) to ensure that if any parameters which are not declared as 5005 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5006 5007 if (scriptSource == null) THROWS.throwNPE("scriptSource"); 5008 5009 final int webSocketID = 32000000 + counter++; 5010 final boolean[] optionals = { false, }; 5011 5012 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5013 String requestJSON = WriteJSON.get( 5014 parameterTypes.get("addScriptToEvaluateOnLoad"), 5015 parameterNames.get("addScriptToEvaluateOnLoad"), 5016 optionals, webSocketID, 5017 "Page.addScriptToEvaluateOnLoad", 5018 scriptSource 5019 ); 5020 5021 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 5022 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 5023 ReadJSON.getString(jo, "identifier", false, true); 5024 5025 return new Script<>(webSocketID, requestJSON, responseProcessor); 5026 } 5027 5028 /** 5029 * Evaluates given script in every frame upon creation (before loading frame's scripts). 5030 * 5031 * @param source - 5032 * 5033 * @param worldName 5034 * If specified, creates an isolated world with the given name and evaluates given script in it. 5035 * This world name will be used as the ExecutionContextDescription::name when the corresponding 5036 * event is emitted. 5037 * <BR /><B>OPTIONAL</B> 5038 * <BR /><B>EXPERIMENTAL</B> 5039 * 5040 * @param includeCommandLineAPI 5041 * Specifies whether command line API should be available to the script, defaults 5042 * to false. 5043 * <BR /><B>OPTIONAL</B> 5044 * <BR /><B>EXPERIMENTAL</B> 5045 * 5046 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5047 * String></CODE> 5048 * 5049 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 5050 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 5051 * String></CODE> will be returned. 5052 * 5053 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 5054 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 5055 * may be retrieved.</I> 5056 * 5057 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 5058 * <BR /><BR /><UL CLASS=JDUL> 5059 * <LI><CODE>String (<B>identifier</B></CODE>) 5060 * <BR />Identifier of the added script. 5061 * </LI> 5062 * </UL> */ 5063 public static Script<String, JsonObject, String> addScriptToEvaluateOnNewDocument 5064 (String source, String worldName, Boolean includeCommandLineAPI) 5065 { 5066 // Exception-Check(s) to ensure that if any parameters which are not declared as 5067 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5068 5069 if (source == null) THROWS.throwNPE("source"); 5070 5071 final int webSocketID = 32001000 + counter++; 5072 final boolean[] optionals = { false, true, true, }; 5073 5074 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5075 String requestJSON = WriteJSON.get( 5076 parameterTypes.get("addScriptToEvaluateOnNewDocument"), 5077 parameterNames.get("addScriptToEvaluateOnNewDocument"), 5078 optionals, webSocketID, 5079 "Page.addScriptToEvaluateOnNewDocument", 5080 source, worldName, includeCommandLineAPI 5081 ); 5082 5083 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 5084 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 5085 ReadJSON.getString(jo, "identifier", false, true); 5086 5087 return new Script<>(webSocketID, requestJSON, responseProcessor); 5088 } 5089 5090 /** 5091 * Brings page to front (activates tab). 5092 * 5093 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5094 * {@link Ret0}></CODE> 5095 * 5096 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 5097 * browser receives the invocation-request. 5098 * 5099 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 5100 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 5101 * {@code >} to ensure the Browser Function has run to completion. 5102 */ 5103 public static Script<String, JsonObject, Ret0> bringToFront() 5104 { 5105 final int webSocketID = 32002000 + counter++; 5106 final boolean[] optionals = new boolean[0]; 5107 5108 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5109 String requestJSON = WriteJSON.get( 5110 parameterTypes.get("bringToFront"), 5111 parameterNames.get("bringToFront"), 5112 optionals, webSocketID, 5113 "Page.bringToFront" 5114 ); 5115 5116 // This Remote Command does not have a Return-Value. 5117 return new Script<> 5118 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 5119 } 5120 5121 /** 5122 * Capture page screenshot. 5123 * 5124 * @param format Image compression format (defaults to png). 5125 * <BR />Acceptable Values: ["jpeg", "png", "webp"] 5126 * <BR /><B>OPTIONAL</B> 5127 * 5128 * @param quality Compression quality from range [0..100] (jpeg only). 5129 * <BR /><B>OPTIONAL</B> 5130 * 5131 * @param clip Capture the screenshot of a given region only. 5132 * <BR /><B>OPTIONAL</B> 5133 * 5134 * @param fromSurface Capture the screenshot from the surface, rather than the view. Defaults to true. 5135 * <BR /><B>OPTIONAL</B> 5136 * <BR /><B>EXPERIMENTAL</B> 5137 * 5138 * @param captureBeyondViewport Capture the screenshot beyond the viewport. Defaults to false. 5139 * <BR /><B>OPTIONAL</B> 5140 * <BR /><B>EXPERIMENTAL</B> 5141 * 5142 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5143 * String></CODE> 5144 * 5145 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 5146 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 5147 * String></CODE> will be returned. 5148 * 5149 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 5150 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 5151 * may be retrieved.</I> 5152 * 5153 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 5154 * <BR /><BR /><UL CLASS=JDUL> 5155 * <LI><CODE>String (<B>data</B></CODE>) 5156 * <BR />Base64-encoded image data. (Encoded as a base64 string when passed over JSON) 5157 * </LI> 5158 * </UL> */ 5159 public static Script<String, JsonObject, String> captureScreenshot( 5160 String format, Integer quality, Page.Viewport clip, Boolean fromSurface, 5161 Boolean captureBeyondViewport 5162 ) 5163 { 5164 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5165 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5166 5167 THROWS.checkIAE( 5168 "format", format, 5169 "jpeg", "png", "webp" 5170 ); 5171 5172 final int webSocketID = 32003000 + counter++; 5173 final boolean[] optionals = { true, true, true, true, true, }; 5174 5175 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5176 String requestJSON = WriteJSON.get( 5177 parameterTypes.get("captureScreenshot"), 5178 parameterNames.get("captureScreenshot"), 5179 optionals, webSocketID, 5180 "Page.captureScreenshot", 5181 format, quality, clip, fromSurface, captureBeyondViewport 5182 ); 5183 5184 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 5185 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 5186 ReadJSON.getString(jo, "data", false, true); 5187 5188 return new Script<>(webSocketID, requestJSON, responseProcessor); 5189 } 5190 5191 /** 5192 * Returns a snapshot of the page as a string. For MHTML format, the serialization includes 5193 * iframes, shadow DOM, external resources, and element-inline styles. 5194 * <BR /><B>EXPERIMENTAL</B> 5195 * 5196 * @param format Format (defaults to mhtml). 5197 * <BR />Acceptable Values: ["mhtml"] 5198 * <BR /><B>OPTIONAL</B> 5199 * 5200 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5201 * String></CODE> 5202 * 5203 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 5204 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 5205 * String></CODE> will be returned. 5206 * 5207 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 5208 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 5209 * may be retrieved.</I> 5210 * 5211 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 5212 * <BR /><BR /><UL CLASS=JDUL> 5213 * <LI><CODE>String (<B>data</B></CODE>) 5214 * <BR />Serialized page data. 5215 * </LI> 5216 * </UL> */ 5217 public static Script<String, JsonObject, String> captureSnapshot(String format) 5218 { 5219 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5220 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5221 5222 THROWS.checkIAE( 5223 "format", format, 5224 "mhtml" 5225 ); 5226 5227 final int webSocketID = 32004000 + counter++; 5228 final boolean[] optionals = { true, }; 5229 5230 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5231 String requestJSON = WriteJSON.get( 5232 parameterTypes.get("captureSnapshot"), 5233 parameterNames.get("captureSnapshot"), 5234 optionals, webSocketID, 5235 "Page.captureSnapshot", 5236 format 5237 ); 5238 5239 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 5240 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 5241 ReadJSON.getString(jo, "data", false, true); 5242 5243 return new Script<>(webSocketID, requestJSON, responseProcessor); 5244 } 5245 5246 /** 5247 * Clears the overridden device metrics. 5248 * <BR /><B>EXPERIMENTAL</B> 5249 * <BR /><B>DEPRECATED</B> 5250 * 5251 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5252 * {@link Ret0}></CODE> 5253 * 5254 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 5255 * browser receives the invocation-request. 5256 * 5257 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 5258 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 5259 * {@code >} to ensure the Browser Function has run to completion. 5260 */ 5261 public static Script<String, JsonObject, Ret0> clearDeviceMetricsOverride() 5262 { 5263 final int webSocketID = 32005000 + counter++; 5264 final boolean[] optionals = new boolean[0]; 5265 5266 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5267 String requestJSON = WriteJSON.get( 5268 parameterTypes.get("clearDeviceMetricsOverride"), 5269 parameterNames.get("clearDeviceMetricsOverride"), 5270 optionals, webSocketID, 5271 "Page.clearDeviceMetricsOverride" 5272 ); 5273 5274 // This Remote Command does not have a Return-Value. 5275 return new Script<> 5276 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 5277 } 5278 5279 /** 5280 * Clears the overridden Device Orientation. 5281 * <BR /><B>EXPERIMENTAL</B> 5282 * <BR /><B>DEPRECATED</B> 5283 * 5284 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5285 * {@link Ret0}></CODE> 5286 * 5287 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 5288 * browser receives the invocation-request. 5289 * 5290 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 5291 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 5292 * {@code >} to ensure the Browser Function has run to completion. 5293 */ 5294 public static Script<String, JsonObject, Ret0> clearDeviceOrientationOverride() 5295 { 5296 final int webSocketID = 32006000 + counter++; 5297 final boolean[] optionals = new boolean[0]; 5298 5299 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5300 String requestJSON = WriteJSON.get( 5301 parameterTypes.get("clearDeviceOrientationOverride"), 5302 parameterNames.get("clearDeviceOrientationOverride"), 5303 optionals, webSocketID, 5304 "Page.clearDeviceOrientationOverride" 5305 ); 5306 5307 // This Remote Command does not have a Return-Value. 5308 return new Script<> 5309 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 5310 } 5311 5312 /** 5313 * Clears the overridden Geolocation Position and Error. 5314 * <BR /><B>DEPRECATED</B> 5315 * 5316 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5317 * {@link Ret0}></CODE> 5318 * 5319 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 5320 * browser receives the invocation-request. 5321 * 5322 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 5323 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 5324 * {@code >} to ensure the Browser Function has run to completion. 5325 */ 5326 public static Script<String, JsonObject, Ret0> clearGeolocationOverride() 5327 { 5328 final int webSocketID = 32007000 + counter++; 5329 final boolean[] optionals = new boolean[0]; 5330 5331 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5332 String requestJSON = WriteJSON.get( 5333 parameterTypes.get("clearGeolocationOverride"), 5334 parameterNames.get("clearGeolocationOverride"), 5335 optionals, webSocketID, 5336 "Page.clearGeolocationOverride" 5337 ); 5338 5339 // This Remote Command does not have a Return-Value. 5340 return new Script<> 5341 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 5342 } 5343 5344 /** 5345 * Creates an isolated world for the given frame. 5346 * 5347 * @param frameId Id of the frame in which the isolated world should be created. 5348 * 5349 * @param worldName An optional name which is reported in the Execution Context. 5350 * <BR /><B>OPTIONAL</B> 5351 * 5352 * @param grantUniveralAccess 5353 * Whether or not universal access should be granted to the isolated world. This is a powerful 5354 * option, use with caution. 5355 * <BR /><B>OPTIONAL</B> 5356 * 5357 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5358 * Integer></CODE> 5359 * 5360 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 5361 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 5362 * Integer></CODE> will be returned. 5363 * 5364 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 5365 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 5366 * may be retrieved.</I> 5367 * 5368 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 5369 * <BR /><BR /><UL CLASS=JDUL> 5370 * <LI><CODE>Integer (<B>executionContextId</B></CODE>) 5371 * <BR />Execution context of the isolated world. 5372 * </LI> 5373 * </UL> */ 5374 public static Script<String, JsonObject, Integer> createIsolatedWorld 5375 (String frameId, String worldName, Boolean grantUniveralAccess) 5376 { 5377 // Exception-Check(s) to ensure that if any parameters which are not declared as 5378 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5379 5380 if (frameId == null) THROWS.throwNPE("frameId"); 5381 5382 final int webSocketID = 32008000 + counter++; 5383 final boolean[] optionals = { false, true, true, }; 5384 5385 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5386 String requestJSON = WriteJSON.get( 5387 parameterTypes.get("createIsolatedWorld"), 5388 parameterNames.get("createIsolatedWorld"), 5389 optionals, webSocketID, 5390 "Page.createIsolatedWorld", 5391 frameId, worldName, grantUniveralAccess 5392 ); 5393 5394 // 'JSON Binding' ... Converts Browser Response-JSON to 'Integer' 5395 Function<JsonObject, Integer> responseProcessor = (JsonObject jo) -> 5396 ReadBoxedJSON.getInteger(jo, "executionContextId", true); 5397 5398 return new Script<>(webSocketID, requestJSON, responseProcessor); 5399 } 5400 5401 /** 5402 * Deletes browser cookie with given name, domain and path. 5403 * <BR /><B>EXPERIMENTAL</B> 5404 * <BR /><B>DEPRECATED</B> 5405 * 5406 * @param cookieName Name of the cookie to remove. 5407 * 5408 * @param url URL to match cooke domain and path. 5409 * 5410 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5411 * {@link Ret0}></CODE> 5412 * 5413 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 5414 * browser receives the invocation-request. 5415 * 5416 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 5417 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 5418 * {@code >} to ensure the Browser Function has run to completion. 5419 */ 5420 public static Script<String, JsonObject, Ret0> deleteCookie(String cookieName, String url) 5421 { 5422 // Exception-Check(s) to ensure that if any parameters which are not declared as 5423 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5424 5425 if (cookieName == null) THROWS.throwNPE("cookieName"); 5426 if (url == null) THROWS.throwNPE("url"); 5427 5428 final int webSocketID = 32009000 + counter++; 5429 final boolean[] optionals = { false, false, }; 5430 5431 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5432 String requestJSON = WriteJSON.get( 5433 parameterTypes.get("deleteCookie"), 5434 parameterNames.get("deleteCookie"), 5435 optionals, webSocketID, 5436 "Page.deleteCookie", 5437 cookieName, url 5438 ); 5439 5440 // This Remote Command does not have a Return-Value. 5441 return new Script<> 5442 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 5443 } 5444 5445 /** 5446 * Disables page domain notifications. 5447 * 5448 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5449 * {@link Ret0}></CODE> 5450 * 5451 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 5452 * browser receives the invocation-request. 5453 * 5454 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 5455 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 5456 * {@code >} to ensure the Browser Function has run to completion. 5457 */ 5458 public static Script<String, JsonObject, Ret0> disable() 5459 { 5460 final int webSocketID = 32010000 + counter++; 5461 final boolean[] optionals = new boolean[0]; 5462 5463 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5464 String requestJSON = WriteJSON.get( 5465 parameterTypes.get("disable"), 5466 parameterNames.get("disable"), 5467 optionals, webSocketID, 5468 "Page.disable" 5469 ); 5470 5471 // This Remote Command does not have a Return-Value. 5472 return new Script<> 5473 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 5474 } 5475 5476 /** 5477 * Enables page domain notifications. 5478 * 5479 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5480 * {@link Ret0}></CODE> 5481 * 5482 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 5483 * browser receives the invocation-request. 5484 * 5485 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 5486 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 5487 * {@code >} to ensure the Browser Function has run to completion. 5488 */ 5489 public static Script<String, JsonObject, Ret0> enable() 5490 { 5491 final int webSocketID = 32011000 + counter++; 5492 final boolean[] optionals = new boolean[0]; 5493 5494 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5495 String requestJSON = WriteJSON.get( 5496 parameterTypes.get("enable"), 5497 parameterNames.get("enable"), 5498 optionals, webSocketID, 5499 "Page.enable" 5500 ); 5501 5502 // This Remote Command does not have a Return-Value. 5503 return new Script<> 5504 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 5505 } 5506 5507 /** 5508 * <CODE>[No Description Provided by Google]</CODE> 5509 * 5510 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5511 * {@link Ret4}></CODE> 5512 * 5513 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 5514 * {@link Script#exec()}), and a {@link Promise} returned. 5515 * 5516 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 5517 * (using {@link Promise#await()}), the {@code Ret4} will subsequently 5518 * be returned from that call. 5519 * 5520 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 5521 * in an instance of <B>{@link Ret4}</B> 5522 * 5523 * <BR /><BR /><UL CLASS=JDUL> 5524 * <LI><CODE><B>Ret4.a:</B> String (<B>url</B>)</CODE> 5525 * <BR />Manifest location. 5526 * <BR /><BR /></LI> 5527 * <LI><CODE><B>Ret4.b:</B> {@link Page.AppManifestError}[] (<B>errors</B>)</CODE> 5528 * <BR />- 5529 * <BR /><BR /></LI> 5530 * <LI><CODE><B>Ret4.c:</B> String (<B>data</B>)</CODE> 5531 * <BR />Manifest content. 5532 * <BR /><BR /></LI> 5533 * <LI><CODE><B>Ret4.d:</B> {@link Page.AppManifestParsedProperties} (<B>parsed</B>)</CODE> 5534 * <BR />Parsed manifest properties 5535 * </LI> 5536 * </UL> 5537 */ 5538 public static Script<String, JsonObject, Ret4<String, Page.AppManifestError[], String, Page.AppManifestParsedProperties>> 5539 getAppManifest() 5540 { 5541 final int webSocketID = 32012000 + counter++; 5542 final boolean[] optionals = new boolean[0]; 5543 5544 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5545 String requestJSON = WriteJSON.get( 5546 parameterTypes.get("getAppManifest"), 5547 parameterNames.get("getAppManifest"), 5548 optionals, webSocketID, 5549 "Page.getAppManifest" 5550 ); 5551 5552 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret4' 5553 Function<JsonObject, Ret4<String, Page.AppManifestError[], String, Page.AppManifestParsedProperties>> 5554 responseProcessor = (JsonObject jo) -> new Ret4<>( 5555 ReadJSON.getString(jo, "url", false, true), 5556 (jo.getJsonArray("errors") == null) 5557 ? null 5558 : RJArrIntoStream.objArr(jo.getJsonArray("errors"), null, 0, Page.AppManifestError.class).toArray(Page.AppManifestError[]::new), 5559 ReadJSON.getString(jo, "data", true, false), 5560 ReadJSON.getObject(jo, "parsed", Page.AppManifestParsedProperties.class, true, false) 5561 ); 5562 5563 return new Script<>(webSocketID, requestJSON, responseProcessor); 5564 } 5565 5566 /** 5567 * <CODE>[No Description Provided by Google]</CODE> 5568 * <BR /><B>EXPERIMENTAL</B> 5569 * 5570 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5571 * {@link Page.InstallabilityError}[]></CODE> 5572 * 5573 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 5574 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 5575 * {@link Page.InstallabilityError}[]></CODE> will be returned. 5576 * 5577 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 5578 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 5579 * may be retrieved.</I> 5580 * 5581 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 5582 * <BR /><BR /><UL CLASS=JDUL> 5583 * <LI><CODE>{@link Page.InstallabilityError}[] (<B>installabilityErrors</B></CODE>) 5584 * <BR />- 5585 * </LI> 5586 * </UL> */ 5587 public static Script<String, JsonObject, Page.InstallabilityError[]> getInstallabilityErrors() 5588 { 5589 final int webSocketID = 32013000 + counter++; 5590 final boolean[] optionals = new boolean[0]; 5591 5592 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5593 String requestJSON = WriteJSON.get( 5594 parameterTypes.get("getInstallabilityErrors"), 5595 parameterNames.get("getInstallabilityErrors"), 5596 optionals, webSocketID, 5597 "Page.getInstallabilityErrors" 5598 ); 5599 5600 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.InstallabilityError[]' 5601 Function<JsonObject, Page.InstallabilityError[]> responseProcessor = (JsonObject jo) -> 5602 (jo.getJsonArray("installabilityErrors") == null) 5603 ? null 5604 : RJArrIntoStream.objArr(jo.getJsonArray("installabilityErrors"), null, 0, Page.InstallabilityError.class).toArray(Page.InstallabilityError[]::new); 5605 5606 return new Script<>(webSocketID, requestJSON, responseProcessor); 5607 } 5608 5609 /** 5610 * <CODE>[No Description Provided by Google]</CODE> 5611 * <BR /><B>EXPERIMENTAL</B> 5612 * 5613 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5614 * String></CODE> 5615 * 5616 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 5617 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 5618 * String></CODE> will be returned. 5619 * 5620 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 5621 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 5622 * may be retrieved.</I> 5623 * 5624 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 5625 * <BR /><BR /><UL CLASS=JDUL> 5626 * <LI><CODE>String (<B>primaryIcon</B></CODE>) 5627 * <BR />- 5628 * </LI> 5629 * </UL> */ 5630 public static Script<String, JsonObject, String> getManifestIcons() 5631 { 5632 final int webSocketID = 32014000 + counter++; 5633 final boolean[] optionals = new boolean[0]; 5634 5635 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5636 String requestJSON = WriteJSON.get( 5637 parameterTypes.get("getManifestIcons"), 5638 parameterNames.get("getManifestIcons"), 5639 optionals, webSocketID, 5640 "Page.getManifestIcons" 5641 ); 5642 5643 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 5644 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 5645 ReadJSON.getString(jo, "primaryIcon", true, false); 5646 5647 return new Script<>(webSocketID, requestJSON, responseProcessor); 5648 } 5649 5650 /** 5651 * Returns the unique (PWA) app id. 5652 * Only returns values if the feature flag 'WebAppEnableManifestId' is enabled 5653 * <BR /><B>EXPERIMENTAL</B> 5654 * 5655 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5656 * {@link Ret2}></CODE> 5657 * 5658 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 5659 * {@link Script#exec()}), and a {@link Promise} returned. 5660 * 5661 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 5662 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 5663 * be returned from that call. 5664 * 5665 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 5666 * in an instance of <B>{@link Ret2}</B> 5667 * 5668 * <BR /><BR /><UL CLASS=JDUL> 5669 * <LI><CODE><B>Ret2.a:</B> String (<B>appId</B>)</CODE> 5670 * <BR />App id, either from manifest's id attribute or computed from start_url 5671 * <BR /><BR /></LI> 5672 * <LI><CODE><B>Ret2.b:</B> String (<B>recommendedId</B>)</CODE> 5673 * <BR />Recommendation for manifest's id attribute to match current id computed from start_url 5674 * </LI> 5675 * </UL> 5676 */ 5677 public static Script<String, JsonObject, Ret2<String, String>> getAppId() 5678 { 5679 final int webSocketID = 32015000 + counter++; 5680 final boolean[] optionals = new boolean[0]; 5681 5682 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5683 String requestJSON = WriteJSON.get( 5684 parameterTypes.get("getAppId"), 5685 parameterNames.get("getAppId"), 5686 optionals, webSocketID, 5687 "Page.getAppId" 5688 ); 5689 5690 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 5691 Function<JsonObject, Ret2<String, String>> 5692 responseProcessor = (JsonObject jo) -> new Ret2<>( 5693 ReadJSON.getString(jo, "appId", true, false), 5694 ReadJSON.getString(jo, "recommendedId", true, false) 5695 ); 5696 5697 return new Script<>(webSocketID, requestJSON, responseProcessor); 5698 } 5699 5700 /** 5701 * Returns all browser cookies. Depending on the backend support, will return detailed cookie 5702 * information in the <CODE>cookies</CODE> field. 5703 * <BR /><B>EXPERIMENTAL</B> 5704 * <BR /><B>DEPRECATED</B> 5705 * 5706 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5707 * {@link Network.Cookie}[]></CODE> 5708 * 5709 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 5710 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 5711 * {@link Network.Cookie}[]></CODE> will be returned. 5712 * 5713 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 5714 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 5715 * may be retrieved.</I> 5716 * 5717 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 5718 * <BR /><BR /><UL CLASS=JDUL> 5719 * <LI><CODE>{@link Network.Cookie}[] (<B>cookies</B></CODE>) 5720 * <BR />Array of cookie objects. 5721 * </LI> 5722 * </UL> */ 5723 public static Script<String, JsonObject, Network.Cookie[]> getCookies() 5724 { 5725 final int webSocketID = 32016000 + counter++; 5726 final boolean[] optionals = new boolean[0]; 5727 5728 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5729 String requestJSON = WriteJSON.get( 5730 parameterTypes.get("getCookies"), 5731 parameterNames.get("getCookies"), 5732 optionals, webSocketID, 5733 "Page.getCookies" 5734 ); 5735 5736 // 'JSON Binding' ... Converts Browser Response-JSON to 'Network.Cookie[]' 5737 Function<JsonObject, Network.Cookie[]> responseProcessor = (JsonObject jo) -> 5738 (jo.getJsonArray("cookies") == null) 5739 ? null 5740 : RJArrIntoStream.objArr(jo.getJsonArray("cookies"), null, 0, Network.Cookie.class).toArray(Network.Cookie[]::new); 5741 5742 return new Script<>(webSocketID, requestJSON, responseProcessor); 5743 } 5744 5745 /** 5746 * Returns present frame tree structure. 5747 * 5748 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5749 * {@link Page.FrameTree}></CODE> 5750 * 5751 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 5752 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 5753 * {@link Page.FrameTree}></CODE> will be returned. 5754 * 5755 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 5756 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 5757 * may be retrieved.</I> 5758 * 5759 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 5760 * <BR /><BR /><UL CLASS=JDUL> 5761 * <LI><CODE>{@link Page.FrameTree} (<B>frameTree</B></CODE>) 5762 * <BR />Present frame tree structure. 5763 * </LI> 5764 * </UL> */ 5765 public static Script<String, JsonObject, Page.FrameTree> getFrameTree() 5766 { 5767 final int webSocketID = 32017000 + counter++; 5768 final boolean[] optionals = new boolean[0]; 5769 5770 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5771 String requestJSON = WriteJSON.get( 5772 parameterTypes.get("getFrameTree"), 5773 parameterNames.get("getFrameTree"), 5774 optionals, webSocketID, 5775 "Page.getFrameTree" 5776 ); 5777 5778 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.FrameTree' 5779 Function<JsonObject, Page.FrameTree> responseProcessor = (JsonObject jo) -> 5780 ReadJSON.getObject(jo, "frameTree", Page.FrameTree.class, false, true); 5781 5782 return new Script<>(webSocketID, requestJSON, responseProcessor); 5783 } 5784 5785 /** 5786 * Returns metrics relating to the layouting of the page, such as viewport bounds/scale. 5787 * 5788 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5789 * {@link Ret6}></CODE> 5790 * 5791 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 5792 * {@link Script#exec()}), and a {@link Promise} returned. 5793 * 5794 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 5795 * (using {@link Promise#await()}), the {@code Ret6} will subsequently 5796 * be returned from that call. 5797 * 5798 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 5799 * in an instance of <B>{@link Ret6}</B> 5800 * 5801 * <BR /><BR /><UL CLASS=JDUL> 5802 * <LI><CODE><B>Ret6.a1:</B> {@link Page.LayoutViewport} (<B>layoutViewport</B>)</CODE> 5803 * <BR />Deprecated metrics relating to the layout viewport. Can be in DP or in CSS pixels depending on the <CODE>enable-use-zoom-for-dsf</CODE> flag. Use <CODE>cssLayoutViewport</CODE> instead. 5804 * <BR /><BR /></LI> 5805 * <LI><CODE><B>Ret6.b2:</B> {@link Page.VisualViewport} (<B>visualViewport</B>)</CODE> 5806 * <BR />Deprecated metrics relating to the visual viewport. Can be in DP or in CSS pixels depending on the <CODE>enable-use-zoom-for-dsf</CODE> flag. Use <CODE>cssVisualViewport</CODE> instead. 5807 * <BR /><BR /></LI> 5808 * <LI><CODE><B>Ret6.c3:</B> {@link DOM.Rect} (<B>contentSize</B>)</CODE> 5809 * <BR />Deprecated size of scrollable area. Can be in DP or in CSS pixels depending on the <CODE>enable-use-zoom-for-dsf</CODE> flag. Use <CODE>cssContentSize</CODE> instead. 5810 * <BR /><BR /></LI> 5811 * <LI><CODE><B>Ret6.d4:</B> {@link Page.LayoutViewport} (<B>cssLayoutViewport</B>)</CODE> 5812 * <BR />Metrics relating to the layout viewport in CSS pixels. 5813 * <BR /><BR /></LI> 5814 * <LI><CODE><B>Ret6.e5:</B> {@link Page.VisualViewport} (<B>cssVisualViewport</B>)</CODE> 5815 * <BR />Metrics relating to the visual viewport in CSS pixels. 5816 * <BR /><BR /></LI> 5817 * <LI><CODE><B>Ret6.f6:</B> {@link DOM.Rect} (<B>cssContentSize</B>)</CODE> 5818 * <BR />Size of scrollable area in CSS pixels. 5819 * </LI> 5820 * </UL> 5821 */ 5822 public static Script<String, JsonObject, Ret6<Page.LayoutViewport, Page.VisualViewport, DOM.Rect, Page.LayoutViewport, Page.VisualViewport, DOM.Rect>> 5823 getLayoutMetrics() 5824 { 5825 final int webSocketID = 32018000 + counter++; 5826 final boolean[] optionals = new boolean[0]; 5827 5828 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5829 String requestJSON = WriteJSON.get( 5830 parameterTypes.get("getLayoutMetrics"), 5831 parameterNames.get("getLayoutMetrics"), 5832 optionals, webSocketID, 5833 "Page.getLayoutMetrics" 5834 ); 5835 5836 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret6' 5837 Function<JsonObject, Ret6<Page.LayoutViewport, Page.VisualViewport, DOM.Rect, Page.LayoutViewport, Page.VisualViewport, DOM.Rect>> 5838 responseProcessor = (JsonObject jo) -> new Ret6<>( 5839 ReadJSON.getObject(jo, "layoutViewport", Page.LayoutViewport.class, false, true), 5840 ReadJSON.getObject(jo, "visualViewport", Page.VisualViewport.class, false, true), 5841 ReadJSON.getObject(jo, "contentSize", DOM.Rect.class, false, true), 5842 ReadJSON.getObject(jo, "cssLayoutViewport", Page.LayoutViewport.class, false, true), 5843 ReadJSON.getObject(jo, "cssVisualViewport", Page.VisualViewport.class, false, true), 5844 ReadJSON.getObject(jo, "cssContentSize", DOM.Rect.class, false, true) 5845 ); 5846 5847 return new Script<>(webSocketID, requestJSON, responseProcessor); 5848 } 5849 5850 /** 5851 * Returns navigation history for the current page. 5852 * 5853 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5854 * {@link Ret2}></CODE> 5855 * 5856 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 5857 * {@link Script#exec()}), and a {@link Promise} returned. 5858 * 5859 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 5860 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 5861 * be returned from that call. 5862 * 5863 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 5864 * in an instance of <B>{@link Ret2}</B> 5865 * 5866 * <BR /><BR /><UL CLASS=JDUL> 5867 * <LI><CODE><B>Ret2.a:</B> Integer (<B>currentIndex</B>)</CODE> 5868 * <BR />Index of the current navigation history entry. 5869 * <BR /><BR /></LI> 5870 * <LI><CODE><B>Ret2.b:</B> {@link Page.NavigationEntry}[] (<B>entries</B>)</CODE> 5871 * <BR />Array of navigation history entries. 5872 * </LI> 5873 * </UL> 5874 */ 5875 public static Script<String, JsonObject, Ret2<Integer, Page.NavigationEntry[]>> getNavigationHistory() 5876 { 5877 final int webSocketID = 32019000 + counter++; 5878 final boolean[] optionals = new boolean[0]; 5879 5880 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5881 String requestJSON = WriteJSON.get( 5882 parameterTypes.get("getNavigationHistory"), 5883 parameterNames.get("getNavigationHistory"), 5884 optionals, webSocketID, 5885 "Page.getNavigationHistory" 5886 ); 5887 5888 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 5889 Function<JsonObject, Ret2<Integer, Page.NavigationEntry[]>> 5890 responseProcessor = (JsonObject jo) -> new Ret2<>( 5891 ReadBoxedJSON.getInteger(jo, "currentIndex", true), 5892 (jo.getJsonArray("entries") == null) 5893 ? null 5894 : RJArrIntoStream.objArr(jo.getJsonArray("entries"), null, 0, Page.NavigationEntry.class).toArray(Page.NavigationEntry[]::new) 5895 ); 5896 5897 return new Script<>(webSocketID, requestJSON, responseProcessor); 5898 } 5899 5900 /** 5901 * Resets navigation history for the current page. 5902 * 5903 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5904 * {@link Ret0}></CODE> 5905 * 5906 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 5907 * browser receives the invocation-request. 5908 * 5909 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 5910 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 5911 * {@code >} to ensure the Browser Function has run to completion. 5912 */ 5913 public static Script<String, JsonObject, Ret0> resetNavigationHistory() 5914 { 5915 final int webSocketID = 32020000 + counter++; 5916 final boolean[] optionals = new boolean[0]; 5917 5918 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5919 String requestJSON = WriteJSON.get( 5920 parameterTypes.get("resetNavigationHistory"), 5921 parameterNames.get("resetNavigationHistory"), 5922 optionals, webSocketID, 5923 "Page.resetNavigationHistory" 5924 ); 5925 5926 // This Remote Command does not have a Return-Value. 5927 return new Script<> 5928 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 5929 } 5930 5931 /** 5932 * Returns content of the given resource. 5933 * <BR /><B>EXPERIMENTAL</B> 5934 * 5935 * @param frameId Frame id to get resource for. 5936 * 5937 * @param url URL of the resource to get content for. 5938 * 5939 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5940 * {@link Ret2}></CODE> 5941 * 5942 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 5943 * {@link Script#exec()}), and a {@link Promise} returned. 5944 * 5945 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 5946 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 5947 * be returned from that call. 5948 * 5949 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 5950 * in an instance of <B>{@link Ret2}</B> 5951 * 5952 * <BR /><BR /><UL CLASS=JDUL> 5953 * <LI><CODE><B>Ret2.a:</B> String (<B>content</B>)</CODE> 5954 * <BR />Resource content. 5955 * <BR /><BR /></LI> 5956 * <LI><CODE><B>Ret2.b:</B> Boolean (<B>base64Encoded</B>)</CODE> 5957 * <BR />True, if content was served as base64. 5958 * </LI> 5959 * </UL> 5960 */ 5961 public static Script<String, JsonObject, Ret2<String, Boolean>> getResourceContent 5962 (String frameId, String url) 5963 { 5964 // Exception-Check(s) to ensure that if any parameters which are not declared as 5965 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5966 5967 if (frameId == null) THROWS.throwNPE("frameId"); 5968 if (url == null) THROWS.throwNPE("url"); 5969 5970 final int webSocketID = 32021000 + counter++; 5971 final boolean[] optionals = { false, false, }; 5972 5973 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 5974 String requestJSON = WriteJSON.get( 5975 parameterTypes.get("getResourceContent"), 5976 parameterNames.get("getResourceContent"), 5977 optionals, webSocketID, 5978 "Page.getResourceContent", 5979 frameId, url 5980 ); 5981 5982 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 5983 Function<JsonObject, Ret2<String, Boolean>> 5984 responseProcessor = (JsonObject jo) -> new Ret2<>( 5985 ReadJSON.getString(jo, "content", false, true), 5986 ReadBoxedJSON.getBoolean(jo, "base64Encoded", true) 5987 ); 5988 5989 return new Script<>(webSocketID, requestJSON, responseProcessor); 5990 } 5991 5992 /** 5993 * Returns present frame / resource tree structure. 5994 * <BR /><B>EXPERIMENTAL</B> 5995 * 5996 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 5997 * {@link Page.FrameResourceTree}></CODE> 5998 * 5999 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 6000 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 6001 * {@link Page.FrameResourceTree}></CODE> will be returned. 6002 * 6003 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 6004 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 6005 * may be retrieved.</I> 6006 * 6007 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 6008 * <BR /><BR /><UL CLASS=JDUL> 6009 * <LI><CODE>{@link Page.FrameResourceTree} (<B>frameTree</B></CODE>) 6010 * <BR />Present frame / resource tree structure. 6011 * </LI> 6012 * </UL> */ 6013 public static Script<String, JsonObject, Page.FrameResourceTree> getResourceTree() 6014 { 6015 final int webSocketID = 32022000 + counter++; 6016 final boolean[] optionals = new boolean[0]; 6017 6018 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6019 String requestJSON = WriteJSON.get( 6020 parameterTypes.get("getResourceTree"), 6021 parameterNames.get("getResourceTree"), 6022 optionals, webSocketID, 6023 "Page.getResourceTree" 6024 ); 6025 6026 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.FrameResourceTree' 6027 Function<JsonObject, Page.FrameResourceTree> responseProcessor = (JsonObject jo) -> 6028 ReadJSON.getObject(jo, "frameTree", Page.FrameResourceTree.class, false, true); 6029 6030 return new Script<>(webSocketID, requestJSON, responseProcessor); 6031 } 6032 6033 /** 6034 * Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). 6035 * 6036 * @param accept Whether to accept or dismiss the dialog. 6037 * 6038 * @param promptText 6039 * The text to enter into the dialog prompt before accepting. Used only if this is a prompt 6040 * dialog. 6041 * <BR /><B>OPTIONAL</B> 6042 * 6043 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6044 * {@link Ret0}></CODE> 6045 * 6046 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6047 * browser receives the invocation-request. 6048 * 6049 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6050 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6051 * {@code >} to ensure the Browser Function has run to completion. 6052 */ 6053 public static Script<String, JsonObject, Ret0> handleJavaScriptDialog 6054 (boolean accept, String promptText) 6055 { 6056 final int webSocketID = 32023000 + counter++; 6057 final boolean[] optionals = { false, true, }; 6058 6059 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6060 String requestJSON = WriteJSON.get( 6061 parameterTypes.get("handleJavaScriptDialog"), 6062 parameterNames.get("handleJavaScriptDialog"), 6063 optionals, webSocketID, 6064 "Page.handleJavaScriptDialog", 6065 accept, promptText 6066 ); 6067 6068 // This Remote Command does not have a Return-Value. 6069 return new Script<> 6070 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6071 } 6072 6073 /** 6074 * Navigates current page to the given URL. 6075 * 6076 * @param url URL to navigate the page to. 6077 * 6078 * @param referrer Referrer URL. 6079 * <BR /><B>OPTIONAL</B> 6080 * 6081 * @param transitionType Intended transition type. 6082 * <BR /><B>OPTIONAL</B> 6083 * 6084 * @param frameId Frame id to navigate, if not specified navigates the top frame. 6085 * <BR /><B>OPTIONAL</B> 6086 * 6087 * @param referrerPolicy Referrer-policy used for the navigation. 6088 * <BR /><B>OPTIONAL</B> 6089 * <BR /><B>EXPERIMENTAL</B> 6090 * 6091 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6092 * {@link Ret3}></CODE> 6093 * 6094 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 6095 * {@link Script#exec()}), and a {@link Promise} returned. 6096 * 6097 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 6098 * (using {@link Promise#await()}), the {@code Ret3} will subsequently 6099 * be returned from that call. 6100 * 6101 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 6102 * in an instance of <B>{@link Ret3}</B> 6103 * 6104 * <BR /><BR /><UL CLASS=JDUL> 6105 * <LI><CODE><B>Ret3.a:</B> String (<B>frameId</B>)</CODE> 6106 * <BR />Frame id that has navigated (or failed to navigate) 6107 * <BR /><BR /></LI> 6108 * <LI><CODE><B>Ret3.b:</B> String (<B>loaderId</B>)</CODE> 6109 * <BR />Loader identifier. 6110 * <BR /><BR /></LI> 6111 * <LI><CODE><B>Ret3.c:</B> String (<B>errorText</B>)</CODE> 6112 * <BR />User friendly error message, present if and only if navigation has failed. 6113 * </LI> 6114 * </UL> 6115 */ 6116 public static Script<String, JsonObject, Ret3<String, String, String>> navigate 6117 (String url, String referrer, String transitionType, String frameId, String referrerPolicy) 6118 { 6119 // Exception-Check(s) to ensure that if any parameters which are not declared as 6120 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6121 6122 if (url == null) THROWS.throwNPE("url"); 6123 6124 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6125 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6126 6127 THROWS.checkIAE("transitionType", transitionType, "Page.TransitionType", Page.TransitionType); 6128 THROWS.checkIAE("referrerPolicy", referrerPolicy, "Page.ReferrerPolicy", Page.ReferrerPolicy); 6129 6130 final int webSocketID = 32024000 + counter++; 6131 final boolean[] optionals = { false, true, true, true, true, }; 6132 6133 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6134 String requestJSON = WriteJSON.get( 6135 parameterTypes.get("navigate"), 6136 parameterNames.get("navigate"), 6137 optionals, webSocketID, 6138 "Page.navigate", 6139 url, referrer, transitionType, frameId, referrerPolicy 6140 ); 6141 6142 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret3' 6143 Function<JsonObject, Ret3<String, String, String>> 6144 responseProcessor = (JsonObject jo) -> new Ret3<>( 6145 ReadJSON.getString(jo, "frameId", false, true), 6146 ReadJSON.getString(jo, "loaderId", true, false), 6147 ReadJSON.getString(jo, "errorText", true, false) 6148 ); 6149 6150 return new Script<>(webSocketID, requestJSON, responseProcessor); 6151 } 6152 6153 /** 6154 * Navigates current page to the given history entry. 6155 * 6156 * @param entryId Unique id of the entry to navigate to. 6157 * 6158 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6159 * {@link Ret0}></CODE> 6160 * 6161 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6162 * browser receives the invocation-request. 6163 * 6164 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6165 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6166 * {@code >} to ensure the Browser Function has run to completion. 6167 */ 6168 public static Script<String, JsonObject, Ret0> navigateToHistoryEntry(int entryId) 6169 { 6170 final int webSocketID = 32025000 + counter++; 6171 final boolean[] optionals = { false, }; 6172 6173 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6174 String requestJSON = WriteJSON.get( 6175 parameterTypes.get("navigateToHistoryEntry"), 6176 parameterNames.get("navigateToHistoryEntry"), 6177 optionals, webSocketID, 6178 "Page.navigateToHistoryEntry", 6179 entryId 6180 ); 6181 6182 // This Remote Command does not have a Return-Value. 6183 return new Script<> 6184 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6185 } 6186 6187 /** 6188 * Print page as PDF. 6189 * 6190 * @param landscape Paper orientation. Defaults to false. 6191 * <BR /><B>OPTIONAL</B> 6192 * 6193 * @param displayHeaderFooter Display header and footer. Defaults to false. 6194 * <BR /><B>OPTIONAL</B> 6195 * 6196 * @param printBackground Print background graphics. Defaults to false. 6197 * <BR /><B>OPTIONAL</B> 6198 * 6199 * @param scale Scale of the webpage rendering. Defaults to 1. 6200 * <BR /><B>OPTIONAL</B> 6201 * 6202 * @param paperWidth Paper width in inches. Defaults to 8.5 inches. 6203 * <BR /><B>OPTIONAL</B> 6204 * 6205 * @param paperHeight Paper height in inches. Defaults to 11 inches. 6206 * <BR /><B>OPTIONAL</B> 6207 * 6208 * @param marginTop Top margin in inches. Defaults to 1cm (~0.4 inches). 6209 * <BR /><B>OPTIONAL</B> 6210 * 6211 * @param marginBottom Bottom margin in inches. Defaults to 1cm (~0.4 inches). 6212 * <BR /><B>OPTIONAL</B> 6213 * 6214 * @param marginLeft Left margin in inches. Defaults to 1cm (~0.4 inches). 6215 * <BR /><B>OPTIONAL</B> 6216 * 6217 * @param marginRight Right margin in inches. Defaults to 1cm (~0.4 inches). 6218 * <BR /><B>OPTIONAL</B> 6219 * 6220 * @param pageRanges 6221 * Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means 6222 * print all pages. 6223 * <BR /><B>OPTIONAL</B> 6224 * 6225 * @param ignoreInvalidPageRanges 6226 * Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. 6227 * Defaults to false. 6228 * <BR /><B>OPTIONAL</B> 6229 * 6230 * @param headerTemplate 6231 * HTML template for the print header. Should be valid HTML markup with following 6232 * classes used to inject printing values into them: 6233 * - <CODE>date</CODE>: formatted print date 6234 * - <CODE>title</CODE>: document title 6235 * - <CODE>url</CODE>: document location 6236 * - <CODE>pageNumber</CODE>: current page number 6237 * - <CODE>totalPages</CODE>: total pages in the document 6238 * 6239 * For example, <CODE><span class=title></span></CODE> would generate span containing the title. 6240 * <BR /><B>OPTIONAL</B> 6241 * 6242 * @param footerTemplate HTML template for the print footer. Should use the same format as the <CODE>headerTemplate</CODE>. 6243 * <BR /><B>OPTIONAL</B> 6244 * 6245 * @param preferCSSPageSize 6246 * Whether or not to prefer page size as defined by css. Defaults to false, 6247 * in which case the content will be scaled to fit the paper size. 6248 * <BR /><B>OPTIONAL</B> 6249 * 6250 * @param transferMode return as stream 6251 * <BR />Acceptable Values: ["ReturnAsBase64", "ReturnAsStream"] 6252 * <BR /><B>OPTIONAL</B> 6253 * <BR /><B>EXPERIMENTAL</B> 6254 * 6255 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6256 * {@link Ret2}></CODE> 6257 * 6258 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 6259 * {@link Script#exec()}), and a {@link Promise} returned. 6260 * 6261 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 6262 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 6263 * be returned from that call. 6264 * 6265 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 6266 * in an instance of <B>{@link Ret2}</B> 6267 * 6268 * <BR /><BR /><UL CLASS=JDUL> 6269 * <LI><CODE><B>Ret2.a:</B> String (<B>data</B>)</CODE> 6270 * <BR />Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded as a base64 string when passed over JSON) 6271 * <BR /><BR /></LI> 6272 * <LI><CODE><B>Ret2.b:</B> String (<B>stream</B>)</CODE> 6273 * <BR />A handle of the stream that holds resulting PDF data. 6274 * </LI> 6275 * </UL> 6276 */ 6277 public static Script<String, JsonObject, Ret2<String, String>> printToPDF( 6278 Boolean landscape, Boolean displayHeaderFooter, Boolean printBackground, Number scale, 6279 Number paperWidth, Number paperHeight, Number marginTop, Number marginBottom, 6280 Number marginLeft, Number marginRight, String pageRanges, 6281 Boolean ignoreInvalidPageRanges, String headerTemplate, String footerTemplate, 6282 Boolean preferCSSPageSize, String transferMode 6283 ) 6284 { 6285 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6286 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6287 6288 THROWS.checkIAE( 6289 "transferMode", transferMode, 6290 "ReturnAsBase64", "ReturnAsStream" 6291 ); 6292 6293 final int webSocketID = 32026000 + counter++; 6294 final boolean[] optionals = { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, }; 6295 6296 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6297 String requestJSON = WriteJSON.get( 6298 parameterTypes.get("printToPDF"), 6299 parameterNames.get("printToPDF"), 6300 optionals, webSocketID, 6301 "Page.printToPDF", 6302 landscape, displayHeaderFooter, printBackground, scale, paperWidth, paperHeight, 6303 marginTop, marginBottom, marginLeft, marginRight, pageRanges, ignoreInvalidPageRanges, 6304 headerTemplate, footerTemplate, preferCSSPageSize, transferMode 6305 ); 6306 6307 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 6308 Function<JsonObject, Ret2<String, String>> 6309 responseProcessor = (JsonObject jo) -> new Ret2<>( 6310 ReadJSON.getString(jo, "data", false, true), 6311 ReadJSON.getString(jo, "stream", true, false) 6312 ); 6313 6314 return new Script<>(webSocketID, requestJSON, responseProcessor); 6315 } 6316 6317 /** 6318 * Reloads given page optionally ignoring the cache. 6319 * 6320 * @param ignoreCache If true, browser cache is ignored (as if the user pressed Shift+refresh). 6321 * <BR /><B>OPTIONAL</B> 6322 * 6323 * @param scriptToEvaluateOnLoad 6324 * If set, the script will be injected into all frames of the inspected page after reload. 6325 * Argument will be ignored if reloading dataURL origin. 6326 * <BR /><B>OPTIONAL</B> 6327 * 6328 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6329 * {@link Ret0}></CODE> 6330 * 6331 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6332 * browser receives the invocation-request. 6333 * 6334 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6335 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6336 * {@code >} to ensure the Browser Function has run to completion. 6337 */ 6338 public static Script<String, JsonObject, Ret0> reload 6339 (Boolean ignoreCache, String scriptToEvaluateOnLoad) 6340 { 6341 final int webSocketID = 32027000 + counter++; 6342 final boolean[] optionals = { true, true, }; 6343 6344 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6345 String requestJSON = WriteJSON.get( 6346 parameterTypes.get("reload"), 6347 parameterNames.get("reload"), 6348 optionals, webSocketID, 6349 "Page.reload", 6350 ignoreCache, scriptToEvaluateOnLoad 6351 ); 6352 6353 // This Remote Command does not have a Return-Value. 6354 return new Script<> 6355 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6356 } 6357 6358 /** 6359 * Deprecated, please use removeScriptToEvaluateOnNewDocument instead. 6360 * <BR /><B>EXPERIMENTAL</B> 6361 * <BR /><B>DEPRECATED</B> 6362 * 6363 * @param identifier - 6364 * 6365 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6366 * {@link Ret0}></CODE> 6367 * 6368 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6369 * browser receives the invocation-request. 6370 * 6371 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6372 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6373 * {@code >} to ensure the Browser Function has run to completion. 6374 */ 6375 public static Script<String, JsonObject, Ret0> removeScriptToEvaluateOnLoad 6376 (String identifier) 6377 { 6378 // Exception-Check(s) to ensure that if any parameters which are not declared as 6379 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6380 6381 if (identifier == null) THROWS.throwNPE("identifier"); 6382 6383 final int webSocketID = 32028000 + counter++; 6384 final boolean[] optionals = { false, }; 6385 6386 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6387 String requestJSON = WriteJSON.get( 6388 parameterTypes.get("removeScriptToEvaluateOnLoad"), 6389 parameterNames.get("removeScriptToEvaluateOnLoad"), 6390 optionals, webSocketID, 6391 "Page.removeScriptToEvaluateOnLoad", 6392 identifier 6393 ); 6394 6395 // This Remote Command does not have a Return-Value. 6396 return new Script<> 6397 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6398 } 6399 6400 /** 6401 * Removes given script from the list. 6402 * 6403 * @param identifier - 6404 * 6405 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6406 * {@link Ret0}></CODE> 6407 * 6408 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6409 * browser receives the invocation-request. 6410 * 6411 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6412 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6413 * {@code >} to ensure the Browser Function has run to completion. 6414 */ 6415 public static Script<String, JsonObject, Ret0> removeScriptToEvaluateOnNewDocument 6416 (String identifier) 6417 { 6418 // Exception-Check(s) to ensure that if any parameters which are not declared as 6419 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6420 6421 if (identifier == null) THROWS.throwNPE("identifier"); 6422 6423 final int webSocketID = 32029000 + counter++; 6424 final boolean[] optionals = { false, }; 6425 6426 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6427 String requestJSON = WriteJSON.get( 6428 parameterTypes.get("removeScriptToEvaluateOnNewDocument"), 6429 parameterNames.get("removeScriptToEvaluateOnNewDocument"), 6430 optionals, webSocketID, 6431 "Page.removeScriptToEvaluateOnNewDocument", 6432 identifier 6433 ); 6434 6435 // This Remote Command does not have a Return-Value. 6436 return new Script<> 6437 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6438 } 6439 6440 /** 6441 * Acknowledges that a screencast frame has been received by the frontend. 6442 * <BR /><B>EXPERIMENTAL</B> 6443 * 6444 * @param sessionId Frame number. 6445 * 6446 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6447 * {@link Ret0}></CODE> 6448 * 6449 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6450 * browser receives the invocation-request. 6451 * 6452 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6453 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6454 * {@code >} to ensure the Browser Function has run to completion. 6455 */ 6456 public static Script<String, JsonObject, Ret0> screencastFrameAck(int sessionId) 6457 { 6458 final int webSocketID = 32030000 + counter++; 6459 final boolean[] optionals = { false, }; 6460 6461 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6462 String requestJSON = WriteJSON.get( 6463 parameterTypes.get("screencastFrameAck"), 6464 parameterNames.get("screencastFrameAck"), 6465 optionals, webSocketID, 6466 "Page.screencastFrameAck", 6467 sessionId 6468 ); 6469 6470 // This Remote Command does not have a Return-Value. 6471 return new Script<> 6472 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6473 } 6474 6475 /** 6476 * Searches for given string in resource content. 6477 * <BR /><B>EXPERIMENTAL</B> 6478 * 6479 * @param frameId Frame id for resource to search in. 6480 * 6481 * @param url URL of the resource to search in. 6482 * 6483 * @param query String to search for. 6484 * 6485 * @param caseSensitive If true, search is case sensitive. 6486 * <BR /><B>OPTIONAL</B> 6487 * 6488 * @param isRegex If true, treats string parameter as regex. 6489 * <BR /><B>OPTIONAL</B> 6490 * 6491 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6492 * {@link Debugger.SearchMatch}[]></CODE> 6493 * 6494 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 6495 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 6496 * {@link Debugger.SearchMatch}[]></CODE> will be returned. 6497 * 6498 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 6499 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 6500 * may be retrieved.</I> 6501 * 6502 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 6503 * <BR /><BR /><UL CLASS=JDUL> 6504 * <LI><CODE>{@link Debugger.SearchMatch}[] (<B>result</B></CODE>) 6505 * <BR />List of search matches. 6506 * </LI> 6507 * </UL> */ 6508 public static Script<String, JsonObject, Debugger.SearchMatch[]> searchInResource 6509 (String frameId, String url, String query, Boolean caseSensitive, Boolean isRegex) 6510 { 6511 // Exception-Check(s) to ensure that if any parameters which are not declared as 6512 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6513 6514 if (frameId == null) THROWS.throwNPE("frameId"); 6515 if (url == null) THROWS.throwNPE("url"); 6516 if (query == null) THROWS.throwNPE("query"); 6517 6518 final int webSocketID = 32031000 + counter++; 6519 final boolean[] optionals = { false, false, false, true, true, }; 6520 6521 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6522 String requestJSON = WriteJSON.get( 6523 parameterTypes.get("searchInResource"), 6524 parameterNames.get("searchInResource"), 6525 optionals, webSocketID, 6526 "Page.searchInResource", 6527 frameId, url, query, caseSensitive, isRegex 6528 ); 6529 6530 // 'JSON Binding' ... Converts Browser Response-JSON to 'Debugger.SearchMatch[]' 6531 Function<JsonObject, Debugger.SearchMatch[]> responseProcessor = (JsonObject jo) -> 6532 (jo.getJsonArray("result") == null) 6533 ? null 6534 : RJArrIntoStream.objArr(jo.getJsonArray("result"), null, 0, Debugger.SearchMatch.class).toArray(Debugger.SearchMatch[]::new); 6535 6536 return new Script<>(webSocketID, requestJSON, responseProcessor); 6537 } 6538 6539 /** 6540 * Enable Chrome's experimental ad filter on all sites. 6541 * <BR /><B>EXPERIMENTAL</B> 6542 * 6543 * @param enabled Whether to block ads. 6544 * 6545 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6546 * {@link Ret0}></CODE> 6547 * 6548 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6549 * browser receives the invocation-request. 6550 * 6551 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6552 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6553 * {@code >} to ensure the Browser Function has run to completion. 6554 */ 6555 public static Script<String, JsonObject, Ret0> setAdBlockingEnabled(boolean enabled) 6556 { 6557 final int webSocketID = 32032000 + counter++; 6558 final boolean[] optionals = { false, }; 6559 6560 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6561 String requestJSON = WriteJSON.get( 6562 parameterTypes.get("setAdBlockingEnabled"), 6563 parameterNames.get("setAdBlockingEnabled"), 6564 optionals, webSocketID, 6565 "Page.setAdBlockingEnabled", 6566 enabled 6567 ); 6568 6569 // This Remote Command does not have a Return-Value. 6570 return new Script<> 6571 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6572 } 6573 6574 /** 6575 * Enable page Content Security Policy by-passing. 6576 * <BR /><B>EXPERIMENTAL</B> 6577 * 6578 * @param enabled Whether to bypass page CSP. 6579 * 6580 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6581 * {@link Ret0}></CODE> 6582 * 6583 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6584 * browser receives the invocation-request. 6585 * 6586 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6587 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6588 * {@code >} to ensure the Browser Function has run to completion. 6589 */ 6590 public static Script<String, JsonObject, Ret0> setBypassCSP(boolean enabled) 6591 { 6592 final int webSocketID = 32033000 + counter++; 6593 final boolean[] optionals = { false, }; 6594 6595 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6596 String requestJSON = WriteJSON.get( 6597 parameterTypes.get("setBypassCSP"), 6598 parameterNames.get("setBypassCSP"), 6599 optionals, webSocketID, 6600 "Page.setBypassCSP", 6601 enabled 6602 ); 6603 6604 // This Remote Command does not have a Return-Value. 6605 return new Script<> 6606 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6607 } 6608 6609 /** 6610 * Get Permissions Policy state on given frame. 6611 * <BR /><B>EXPERIMENTAL</B> 6612 * 6613 * @param frameId - 6614 * 6615 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6616 * {@link Page.PermissionsPolicyFeatureState}[]></CODE> 6617 * 6618 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 6619 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 6620 * {@link Page.PermissionsPolicyFeatureState}[]></CODE> will be returned. 6621 * 6622 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 6623 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 6624 * may be retrieved.</I> 6625 * 6626 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 6627 * <BR /><BR /><UL CLASS=JDUL> 6628 * <LI><CODE>{@link Page.PermissionsPolicyFeatureState}[] (<B>states</B></CODE>) 6629 * <BR />- 6630 * </LI> 6631 * </UL> */ 6632 public static Script<String, JsonObject, Page.PermissionsPolicyFeatureState[]> getPermissionsPolicyState 6633 (String frameId) 6634 { 6635 // Exception-Check(s) to ensure that if any parameters which are not declared as 6636 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6637 6638 if (frameId == null) THROWS.throwNPE("frameId"); 6639 6640 final int webSocketID = 32034000 + counter++; 6641 final boolean[] optionals = { false, }; 6642 6643 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6644 String requestJSON = WriteJSON.get( 6645 parameterTypes.get("getPermissionsPolicyState"), 6646 parameterNames.get("getPermissionsPolicyState"), 6647 optionals, webSocketID, 6648 "Page.getPermissionsPolicyState", 6649 frameId 6650 ); 6651 6652 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.PermissionsPolicyFeatureState[]' 6653 Function<JsonObject, Page.PermissionsPolicyFeatureState[]> responseProcessor = (JsonObject jo) -> 6654 (jo.getJsonArray("states") == null) 6655 ? null 6656 : RJArrIntoStream.objArr(jo.getJsonArray("states"), null, 0, Page.PermissionsPolicyFeatureState.class).toArray(Page.PermissionsPolicyFeatureState[]::new); 6657 6658 return new Script<>(webSocketID, requestJSON, responseProcessor); 6659 } 6660 6661 /** 6662 * Get Origin Trials on given frame. 6663 * <BR /><B>EXPERIMENTAL</B> 6664 * 6665 * @param frameId - 6666 * 6667 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6668 * {@link Page.OriginTrial}[]></CODE> 6669 * 6670 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 6671 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 6672 * {@link Page.OriginTrial}[]></CODE> will be returned. 6673 * 6674 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 6675 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 6676 * may be retrieved.</I> 6677 * 6678 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 6679 * <BR /><BR /><UL CLASS=JDUL> 6680 * <LI><CODE>{@link Page.OriginTrial}[] (<B>originTrials</B></CODE>) 6681 * <BR />- 6682 * </LI> 6683 * </UL> */ 6684 public static Script<String, JsonObject, Page.OriginTrial[]> getOriginTrials(String frameId) 6685 { 6686 // Exception-Check(s) to ensure that if any parameters which are not declared as 6687 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6688 6689 if (frameId == null) THROWS.throwNPE("frameId"); 6690 6691 final int webSocketID = 32035000 + counter++; 6692 final boolean[] optionals = { false, }; 6693 6694 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6695 String requestJSON = WriteJSON.get( 6696 parameterTypes.get("getOriginTrials"), 6697 parameterNames.get("getOriginTrials"), 6698 optionals, webSocketID, 6699 "Page.getOriginTrials", 6700 frameId 6701 ); 6702 6703 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.OriginTrial[]' 6704 Function<JsonObject, Page.OriginTrial[]> responseProcessor = (JsonObject jo) -> 6705 (jo.getJsonArray("originTrials") == null) 6706 ? null 6707 : RJArrIntoStream.objArr(jo.getJsonArray("originTrials"), null, 0, Page.OriginTrial.class).toArray(Page.OriginTrial[]::new); 6708 6709 return new Script<>(webSocketID, requestJSON, responseProcessor); 6710 } 6711 6712 /** 6713 * Overrides the values of device screen dimensions (window.screen.width, window.screen.height, 6714 * window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media 6715 * query results). 6716 * <BR /><B>EXPERIMENTAL</B> 6717 * <BR /><B>DEPRECATED</B> 6718 * 6719 * @param width Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. 6720 * 6721 * @param height Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override. 6722 * 6723 * @param deviceScaleFactor Overriding device scale factor value. 0 disables the override. 6724 * 6725 * @param mobile 6726 * Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text 6727 * autosizing and more. 6728 * 6729 * @param scale Scale to apply to resulting view image. 6730 * <BR /><B>OPTIONAL</B> 6731 * 6732 * @param screenWidth Overriding screen width value in pixels (minimum 0, maximum 10000000). 6733 * <BR /><B>OPTIONAL</B> 6734 * 6735 * @param screenHeight Overriding screen height value in pixels (minimum 0, maximum 10000000). 6736 * <BR /><B>OPTIONAL</B> 6737 * 6738 * @param positionX Overriding view X position on screen in pixels (minimum 0, maximum 10000000). 6739 * <BR /><B>OPTIONAL</B> 6740 * 6741 * @param positionY Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). 6742 * <BR /><B>OPTIONAL</B> 6743 * 6744 * @param dontSetVisibleSize Do not set visible view size, rely upon explicit setVisibleSize call. 6745 * <BR /><B>OPTIONAL</B> 6746 * 6747 * @param screenOrientation Screen orientation override. 6748 * <BR /><B>OPTIONAL</B> 6749 * 6750 * @param viewport The viewport dimensions and scale. If not set, the override is cleared. 6751 * <BR /><B>OPTIONAL</B> 6752 * 6753 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6754 * {@link Ret0}></CODE> 6755 * 6756 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6757 * browser receives the invocation-request. 6758 * 6759 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6760 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6761 * {@code >} to ensure the Browser Function has run to completion. 6762 */ 6763 public static Script<String, JsonObject, Ret0> setDeviceMetricsOverride( 6764 int width, int height, Number deviceScaleFactor, boolean mobile, Number scale, 6765 Integer screenWidth, Integer screenHeight, Integer positionX, Integer positionY, 6766 Boolean dontSetVisibleSize, Emulation.ScreenOrientation screenOrientation, 6767 Page.Viewport viewport 6768 ) 6769 { 6770 // Exception-Check(s) to ensure that if any parameters which are not declared as 6771 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6772 6773 if (deviceScaleFactor == null) THROWS.throwNPE("deviceScaleFactor"); 6774 6775 final int webSocketID = 32036000 + counter++; 6776 final boolean[] optionals = { false, false, false, false, true, true, true, true, true, true, true, true, }; 6777 6778 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6779 String requestJSON = WriteJSON.get( 6780 parameterTypes.get("setDeviceMetricsOverride"), 6781 parameterNames.get("setDeviceMetricsOverride"), 6782 optionals, webSocketID, 6783 "Page.setDeviceMetricsOverride", 6784 width, height, deviceScaleFactor, mobile, scale, screenWidth, screenHeight, positionX, 6785 positionY, dontSetVisibleSize, screenOrientation, viewport 6786 ); 6787 6788 // This Remote Command does not have a Return-Value. 6789 return new Script<> 6790 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6791 } 6792 6793 /** 6794 * Overrides the Device Orientation. 6795 * <BR /><B>EXPERIMENTAL</B> 6796 * <BR /><B>DEPRECATED</B> 6797 * 6798 * @param alpha Mock alpha 6799 * 6800 * @param beta Mock beta 6801 * 6802 * @param gamma Mock gamma 6803 * 6804 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6805 * {@link Ret0}></CODE> 6806 * 6807 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6808 * browser receives the invocation-request. 6809 * 6810 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6811 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6812 * {@code >} to ensure the Browser Function has run to completion. 6813 */ 6814 public static Script<String, JsonObject, Ret0> setDeviceOrientationOverride 6815 (Number alpha, Number beta, Number gamma) 6816 { 6817 // Exception-Check(s) to ensure that if any parameters which are not declared as 6818 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6819 6820 if (alpha == null) THROWS.throwNPE("alpha"); 6821 if (beta == null) THROWS.throwNPE("beta"); 6822 if (gamma == null) THROWS.throwNPE("gamma"); 6823 6824 final int webSocketID = 32037000 + counter++; 6825 final boolean[] optionals = { false, false, false, }; 6826 6827 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6828 String requestJSON = WriteJSON.get( 6829 parameterTypes.get("setDeviceOrientationOverride"), 6830 parameterNames.get("setDeviceOrientationOverride"), 6831 optionals, webSocketID, 6832 "Page.setDeviceOrientationOverride", 6833 alpha, beta, gamma 6834 ); 6835 6836 // This Remote Command does not have a Return-Value. 6837 return new Script<> 6838 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6839 } 6840 6841 /** 6842 * Set generic font families. 6843 * <BR /><B>EXPERIMENTAL</B> 6844 * 6845 * @param fontFamilies Specifies font families to set. If a font family is not specified, it won't be changed. 6846 * 6847 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6848 * {@link Ret0}></CODE> 6849 * 6850 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6851 * browser receives the invocation-request. 6852 * 6853 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6854 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6855 * {@code >} to ensure the Browser Function has run to completion. 6856 */ 6857 public static Script<String, JsonObject, Ret0> setFontFamilies 6858 (Page.FontFamilies fontFamilies) 6859 { 6860 // Exception-Check(s) to ensure that if any parameters which are not declared as 6861 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6862 6863 if (fontFamilies == null) THROWS.throwNPE("fontFamilies"); 6864 6865 final int webSocketID = 32038000 + counter++; 6866 final boolean[] optionals = { false, }; 6867 6868 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6869 String requestJSON = WriteJSON.get( 6870 parameterTypes.get("setFontFamilies"), 6871 parameterNames.get("setFontFamilies"), 6872 optionals, webSocketID, 6873 "Page.setFontFamilies", 6874 fontFamilies 6875 ); 6876 6877 // This Remote Command does not have a Return-Value. 6878 return new Script<> 6879 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6880 } 6881 6882 /** 6883 * Set default font sizes. 6884 * <BR /><B>EXPERIMENTAL</B> 6885 * 6886 * @param fontSizes Specifies font sizes to set. If a font size is not specified, it won't be changed. 6887 * 6888 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6889 * {@link Ret0}></CODE> 6890 * 6891 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6892 * browser receives the invocation-request. 6893 * 6894 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6895 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6896 * {@code >} to ensure the Browser Function has run to completion. 6897 */ 6898 public static Script<String, JsonObject, Ret0> setFontSizes(Page.FontSizes fontSizes) 6899 { 6900 // Exception-Check(s) to ensure that if any parameters which are not declared as 6901 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6902 6903 if (fontSizes == null) THROWS.throwNPE("fontSizes"); 6904 6905 final int webSocketID = 32039000 + counter++; 6906 final boolean[] optionals = { false, }; 6907 6908 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6909 String requestJSON = WriteJSON.get( 6910 parameterTypes.get("setFontSizes"), 6911 parameterNames.get("setFontSizes"), 6912 optionals, webSocketID, 6913 "Page.setFontSizes", 6914 fontSizes 6915 ); 6916 6917 // This Remote Command does not have a Return-Value. 6918 return new Script<> 6919 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6920 } 6921 6922 /** 6923 * Sets given markup as the document's HTML. 6924 * 6925 * @param frameId Frame id to set HTML for. 6926 * 6927 * @param html HTML content to set. 6928 * 6929 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6930 * {@link Ret0}></CODE> 6931 * 6932 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6933 * browser receives the invocation-request. 6934 * 6935 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6936 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6937 * {@code >} to ensure the Browser Function has run to completion. 6938 */ 6939 public static Script<String, JsonObject, Ret0> setDocumentContent 6940 (String frameId, String html) 6941 { 6942 // Exception-Check(s) to ensure that if any parameters which are not declared as 6943 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6944 6945 if (frameId == null) THROWS.throwNPE("frameId"); 6946 if (html == null) THROWS.throwNPE("html"); 6947 6948 final int webSocketID = 32040000 + counter++; 6949 final boolean[] optionals = { false, false, }; 6950 6951 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 6952 String requestJSON = WriteJSON.get( 6953 parameterTypes.get("setDocumentContent"), 6954 parameterNames.get("setDocumentContent"), 6955 optionals, webSocketID, 6956 "Page.setDocumentContent", 6957 frameId, html 6958 ); 6959 6960 // This Remote Command does not have a Return-Value. 6961 return new Script<> 6962 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 6963 } 6964 6965 /** 6966 * Set the behavior when downloading a file. 6967 * <BR /><B>EXPERIMENTAL</B> 6968 * <BR /><B>DEPRECATED</B> 6969 * 6970 * @param behavior 6971 * Whether to allow all or deny all download requests, or use default Chrome behavior if 6972 * available (otherwise deny). 6973 * <BR />Acceptable Values: ["deny", "allow", "default"] 6974 * 6975 * @param downloadPath The default path to save downloaded files to. This is required if behavior is set to 'allow' 6976 * <BR /><B>OPTIONAL</B> 6977 * 6978 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 6979 * {@link Ret0}></CODE> 6980 * 6981 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 6982 * browser receives the invocation-request. 6983 * 6984 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 6985 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 6986 * {@code >} to ensure the Browser Function has run to completion. 6987 */ 6988 public static Script<String, JsonObject, Ret0> setDownloadBehavior 6989 (String behavior, String downloadPath) 6990 { 6991 // Exception-Check(s) to ensure that if any parameters which are not declared as 6992 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6993 6994 if (behavior == null) THROWS.throwNPE("behavior"); 6995 6996 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6997 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6998 6999 THROWS.checkIAE( 7000 "behavior", behavior, 7001 "deny", "allow", "default" 7002 ); 7003 7004 final int webSocketID = 32041000 + counter++; 7005 final boolean[] optionals = { false, true, }; 7006 7007 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7008 String requestJSON = WriteJSON.get( 7009 parameterTypes.get("setDownloadBehavior"), 7010 parameterNames.get("setDownloadBehavior"), 7011 optionals, webSocketID, 7012 "Page.setDownloadBehavior", 7013 behavior, downloadPath 7014 ); 7015 7016 // This Remote Command does not have a Return-Value. 7017 return new Script<> 7018 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7019 } 7020 7021 /** 7022 * Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position 7023 * unavailable. 7024 * <BR /><B>DEPRECATED</B> 7025 * 7026 * @param latitude Mock latitude 7027 * <BR /><B>OPTIONAL</B> 7028 * 7029 * @param longitude Mock longitude 7030 * <BR /><B>OPTIONAL</B> 7031 * 7032 * @param accuracy Mock accuracy 7033 * <BR /><B>OPTIONAL</B> 7034 * 7035 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7036 * {@link Ret0}></CODE> 7037 * 7038 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7039 * browser receives the invocation-request. 7040 * 7041 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7042 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7043 * {@code >} to ensure the Browser Function has run to completion. 7044 */ 7045 public static Script<String, JsonObject, Ret0> setGeolocationOverride 7046 (Number latitude, Number longitude, Number accuracy) 7047 { 7048 final int webSocketID = 32042000 + counter++; 7049 final boolean[] optionals = { true, true, true, }; 7050 7051 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7052 String requestJSON = WriteJSON.get( 7053 parameterTypes.get("setGeolocationOverride"), 7054 parameterNames.get("setGeolocationOverride"), 7055 optionals, webSocketID, 7056 "Page.setGeolocationOverride", 7057 latitude, longitude, accuracy 7058 ); 7059 7060 // This Remote Command does not have a Return-Value. 7061 return new Script<> 7062 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7063 } 7064 7065 /** 7066 * Controls whether page will emit lifecycle events. 7067 * <BR /><B>EXPERIMENTAL</B> 7068 * 7069 * @param enabled If true, starts emitting lifecycle events. 7070 * 7071 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7072 * {@link Ret0}></CODE> 7073 * 7074 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7075 * browser receives the invocation-request. 7076 * 7077 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7078 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7079 * {@code >} to ensure the Browser Function has run to completion. 7080 */ 7081 public static Script<String, JsonObject, Ret0> setLifecycleEventsEnabled(boolean enabled) 7082 { 7083 final int webSocketID = 32043000 + counter++; 7084 final boolean[] optionals = { false, }; 7085 7086 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7087 String requestJSON = WriteJSON.get( 7088 parameterTypes.get("setLifecycleEventsEnabled"), 7089 parameterNames.get("setLifecycleEventsEnabled"), 7090 optionals, webSocketID, 7091 "Page.setLifecycleEventsEnabled", 7092 enabled 7093 ); 7094 7095 // This Remote Command does not have a Return-Value. 7096 return new Script<> 7097 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7098 } 7099 7100 /** 7101 * Toggles mouse event-based touch event emulation. 7102 * <BR /><B>EXPERIMENTAL</B> 7103 * <BR /><B>DEPRECATED</B> 7104 * 7105 * @param enabled Whether the touch event emulation should be enabled. 7106 * 7107 * @param configuration Touch/gesture events configuration. Default: current platform. 7108 * <BR />Acceptable Values: ["mobile", "desktop"] 7109 * <BR /><B>OPTIONAL</B> 7110 * 7111 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7112 * {@link Ret0}></CODE> 7113 * 7114 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7115 * browser receives the invocation-request. 7116 * 7117 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7118 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7119 * {@code >} to ensure the Browser Function has run to completion. 7120 */ 7121 public static Script<String, JsonObject, Ret0> setTouchEmulationEnabled 7122 (boolean enabled, String configuration) 7123 { 7124 // Exception-Check(s) to ensure that if any parameters which must adhere to a 7125 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 7126 7127 THROWS.checkIAE( 7128 "configuration", configuration, 7129 "mobile", "desktop" 7130 ); 7131 7132 final int webSocketID = 32044000 + counter++; 7133 final boolean[] optionals = { false, true, }; 7134 7135 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7136 String requestJSON = WriteJSON.get( 7137 parameterTypes.get("setTouchEmulationEnabled"), 7138 parameterNames.get("setTouchEmulationEnabled"), 7139 optionals, webSocketID, 7140 "Page.setTouchEmulationEnabled", 7141 enabled, configuration 7142 ); 7143 7144 // This Remote Command does not have a Return-Value. 7145 return new Script<> 7146 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7147 } 7148 7149 /** 7150 * Starts sending each frame using the <CODE>screencastFrame</CODE> event. 7151 * <BR /><B>EXPERIMENTAL</B> 7152 * 7153 * @param format Image compression format. 7154 * <BR />Acceptable Values: ["jpeg", "png"] 7155 * <BR /><B>OPTIONAL</B> 7156 * 7157 * @param quality Compression quality from range [0..100]. 7158 * <BR /><B>OPTIONAL</B> 7159 * 7160 * @param maxWidth Maximum screenshot width. 7161 * <BR /><B>OPTIONAL</B> 7162 * 7163 * @param maxHeight Maximum screenshot height. 7164 * <BR /><B>OPTIONAL</B> 7165 * 7166 * @param everyNthFrame Send every n-th frame. 7167 * <BR /><B>OPTIONAL</B> 7168 * 7169 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7170 * {@link Ret0}></CODE> 7171 * 7172 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7173 * browser receives the invocation-request. 7174 * 7175 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7176 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7177 * {@code >} to ensure the Browser Function has run to completion. 7178 */ 7179 public static Script<String, JsonObject, Ret0> startScreencast 7180 (String format, Integer quality, Integer maxWidth, Integer maxHeight, Integer everyNthFrame) 7181 { 7182 // Exception-Check(s) to ensure that if any parameters which must adhere to a 7183 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 7184 7185 THROWS.checkIAE( 7186 "format", format, 7187 "jpeg", "png" 7188 ); 7189 7190 final int webSocketID = 32045000 + counter++; 7191 final boolean[] optionals = { true, true, true, true, true, }; 7192 7193 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7194 String requestJSON = WriteJSON.get( 7195 parameterTypes.get("startScreencast"), 7196 parameterNames.get("startScreencast"), 7197 optionals, webSocketID, 7198 "Page.startScreencast", 7199 format, quality, maxWidth, maxHeight, everyNthFrame 7200 ); 7201 7202 // This Remote Command does not have a Return-Value. 7203 return new Script<> 7204 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7205 } 7206 7207 /** 7208 * Force the page stop all navigations and pending resource fetches. 7209 * 7210 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7211 * {@link Ret0}></CODE> 7212 * 7213 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7214 * browser receives the invocation-request. 7215 * 7216 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7217 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7218 * {@code >} to ensure the Browser Function has run to completion. 7219 */ 7220 public static Script<String, JsonObject, Ret0> stopLoading() 7221 { 7222 final int webSocketID = 32046000 + counter++; 7223 final boolean[] optionals = new boolean[0]; 7224 7225 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7226 String requestJSON = WriteJSON.get( 7227 parameterTypes.get("stopLoading"), 7228 parameterNames.get("stopLoading"), 7229 optionals, webSocketID, 7230 "Page.stopLoading" 7231 ); 7232 7233 // This Remote Command does not have a Return-Value. 7234 return new Script<> 7235 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7236 } 7237 7238 /** 7239 * Crashes renderer on the IO thread, generates minidumps. 7240 * <BR /><B>EXPERIMENTAL</B> 7241 * 7242 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7243 * {@link Ret0}></CODE> 7244 * 7245 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7246 * browser receives the invocation-request. 7247 * 7248 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7249 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7250 * {@code >} to ensure the Browser Function has run to completion. 7251 */ 7252 public static Script<String, JsonObject, Ret0> crash() 7253 { 7254 final int webSocketID = 32047000 + counter++; 7255 final boolean[] optionals = new boolean[0]; 7256 7257 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7258 String requestJSON = WriteJSON.get( 7259 parameterTypes.get("crash"), 7260 parameterNames.get("crash"), 7261 optionals, webSocketID, 7262 "Page.crash" 7263 ); 7264 7265 // This Remote Command does not have a Return-Value. 7266 return new Script<> 7267 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7268 } 7269 7270 /** 7271 * Tries to close page, running its beforeunload hooks, if any. 7272 * <BR /><B>EXPERIMENTAL</B> 7273 * 7274 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7275 * {@link Ret0}></CODE> 7276 * 7277 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7278 * browser receives the invocation-request. 7279 * 7280 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7281 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7282 * {@code >} to ensure the Browser Function has run to completion. 7283 */ 7284 public static Script<String, JsonObject, Ret0> close() 7285 { 7286 final int webSocketID = 32048000 + counter++; 7287 final boolean[] optionals = new boolean[0]; 7288 7289 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7290 String requestJSON = WriteJSON.get( 7291 parameterTypes.get("close"), 7292 parameterNames.get("close"), 7293 optionals, webSocketID, 7294 "Page.close" 7295 ); 7296 7297 // This Remote Command does not have a Return-Value. 7298 return new Script<> 7299 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7300 } 7301 7302 /** 7303 * Tries to update the web lifecycle state of the page. 7304 * It will transition the page to the given state according to: 7305 * https://github.com/WICG/web-lifecycle/ 7306 * <BR /><B>EXPERIMENTAL</B> 7307 * 7308 * @param state Target lifecycle state 7309 * <BR />Acceptable Values: ["frozen", "active"] 7310 * 7311 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7312 * {@link Ret0}></CODE> 7313 * 7314 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7315 * browser receives the invocation-request. 7316 * 7317 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7318 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7319 * {@code >} to ensure the Browser Function has run to completion. 7320 */ 7321 public static Script<String, JsonObject, Ret0> setWebLifecycleState(String state) 7322 { 7323 // Exception-Check(s) to ensure that if any parameters which are not declared as 7324 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7325 7326 if (state == null) THROWS.throwNPE("state"); 7327 7328 // Exception-Check(s) to ensure that if any parameters which must adhere to a 7329 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 7330 7331 THROWS.checkIAE( 7332 "state", state, 7333 "frozen", "active" 7334 ); 7335 7336 final int webSocketID = 32049000 + counter++; 7337 final boolean[] optionals = { false, }; 7338 7339 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7340 String requestJSON = WriteJSON.get( 7341 parameterTypes.get("setWebLifecycleState"), 7342 parameterNames.get("setWebLifecycleState"), 7343 optionals, webSocketID, 7344 "Page.setWebLifecycleState", 7345 state 7346 ); 7347 7348 // This Remote Command does not have a Return-Value. 7349 return new Script<> 7350 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7351 } 7352 7353 /** 7354 * Stops sending each frame in the <CODE>screencastFrame</CODE>. 7355 * <BR /><B>EXPERIMENTAL</B> 7356 * 7357 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7358 * {@link Ret0}></CODE> 7359 * 7360 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7361 * browser receives the invocation-request. 7362 * 7363 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7364 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7365 * {@code >} to ensure the Browser Function has run to completion. 7366 */ 7367 public static Script<String, JsonObject, Ret0> stopScreencast() 7368 { 7369 final int webSocketID = 32050000 + counter++; 7370 final boolean[] optionals = new boolean[0]; 7371 7372 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7373 String requestJSON = WriteJSON.get( 7374 parameterTypes.get("stopScreencast"), 7375 parameterNames.get("stopScreencast"), 7376 optionals, webSocketID, 7377 "Page.stopScreencast" 7378 ); 7379 7380 // This Remote Command does not have a Return-Value. 7381 return new Script<> 7382 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7383 } 7384 7385 /** 7386 * Requests backend to produce compilation cache for the specified scripts. 7387 * <CODE>scripts</CODE> are appeneded to the list of scripts for which the cache 7388 * would be produced. The list may be reset during page navigation. 7389 * When script with a matching URL is encountered, the cache is optionally 7390 * produced upon backend discretion, based on internal heuristics. 7391 * See also: <CODE>Page.compilationCacheProduced</CODE>. 7392 * <BR /><B>EXPERIMENTAL</B> 7393 * 7394 * @param scripts - 7395 * 7396 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7397 * {@link Ret0}></CODE> 7398 * 7399 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7400 * browser receives the invocation-request. 7401 * 7402 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7403 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7404 * {@code >} to ensure the Browser Function has run to completion. 7405 */ 7406 public static Script<String, JsonObject, Ret0> produceCompilationCache 7407 (Page.CompilationCacheParams[] scripts) 7408 { 7409 // Exception-Check(s) to ensure that if any parameters which are not declared as 7410 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7411 7412 if (scripts == null) THROWS.throwNPE("scripts"); 7413 7414 final int webSocketID = 32051000 + counter++; 7415 final boolean[] optionals = { false, }; 7416 7417 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7418 String requestJSON = WriteJSON.get( 7419 parameterTypes.get("produceCompilationCache"), 7420 parameterNames.get("produceCompilationCache"), 7421 optionals, webSocketID, 7422 "Page.produceCompilationCache", 7423 (Object) scripts 7424 ); 7425 7426 // This Remote Command does not have a Return-Value. 7427 return new Script<> 7428 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7429 } 7430 7431 /** 7432 * Seeds compilation cache for given url. Compilation cache does not survive 7433 * cross-process navigation. 7434 * <BR /><B>EXPERIMENTAL</B> 7435 * 7436 * @param url - 7437 * 7438 * @param data Base64-encoded data (Encoded as a base64 string when passed over JSON) 7439 * 7440 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7441 * {@link Ret0}></CODE> 7442 * 7443 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7444 * browser receives the invocation-request. 7445 * 7446 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7447 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7448 * {@code >} to ensure the Browser Function has run to completion. 7449 */ 7450 public static Script<String, JsonObject, Ret0> addCompilationCache(String url, String data) 7451 { 7452 // Exception-Check(s) to ensure that if any parameters which are not declared as 7453 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7454 7455 if (url == null) THROWS.throwNPE("url"); 7456 if (data == null) THROWS.throwNPE("data"); 7457 7458 final int webSocketID = 32052000 + counter++; 7459 final boolean[] optionals = { false, false, }; 7460 7461 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7462 String requestJSON = WriteJSON.get( 7463 parameterTypes.get("addCompilationCache"), 7464 parameterNames.get("addCompilationCache"), 7465 optionals, webSocketID, 7466 "Page.addCompilationCache", 7467 url, data 7468 ); 7469 7470 // This Remote Command does not have a Return-Value. 7471 return new Script<> 7472 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7473 } 7474 7475 /** 7476 * Clears seeded compilation cache. 7477 * <BR /><B>EXPERIMENTAL</B> 7478 * 7479 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7480 * {@link Ret0}></CODE> 7481 * 7482 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7483 * browser receives the invocation-request. 7484 * 7485 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7486 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7487 * {@code >} to ensure the Browser Function has run to completion. 7488 */ 7489 public static Script<String, JsonObject, Ret0> clearCompilationCache() 7490 { 7491 final int webSocketID = 32053000 + counter++; 7492 final boolean[] optionals = new boolean[0]; 7493 7494 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7495 String requestJSON = WriteJSON.get( 7496 parameterTypes.get("clearCompilationCache"), 7497 parameterNames.get("clearCompilationCache"), 7498 optionals, webSocketID, 7499 "Page.clearCompilationCache" 7500 ); 7501 7502 // This Remote Command does not have a Return-Value. 7503 return new Script<> 7504 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7505 } 7506 7507 /** 7508 * Generates a report for testing. 7509 * <BR /><B>EXPERIMENTAL</B> 7510 * 7511 * @param message Message to be displayed in the report. 7512 * 7513 * @param group Specifies the endpoint group to deliver the report to. 7514 * <BR /><B>OPTIONAL</B> 7515 * 7516 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7517 * {@link Ret0}></CODE> 7518 * 7519 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7520 * browser receives the invocation-request. 7521 * 7522 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7523 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7524 * {@code >} to ensure the Browser Function has run to completion. 7525 */ 7526 public static Script<String, JsonObject, Ret0> generateTestReport 7527 (String message, String group) 7528 { 7529 // Exception-Check(s) to ensure that if any parameters which are not declared as 7530 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7531 7532 if (message == null) THROWS.throwNPE("message"); 7533 7534 final int webSocketID = 32054000 + counter++; 7535 final boolean[] optionals = { false, true, }; 7536 7537 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7538 String requestJSON = WriteJSON.get( 7539 parameterTypes.get("generateTestReport"), 7540 parameterNames.get("generateTestReport"), 7541 optionals, webSocketID, 7542 "Page.generateTestReport", 7543 message, group 7544 ); 7545 7546 // This Remote Command does not have a Return-Value. 7547 return new Script<> 7548 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7549 } 7550 7551 /** 7552 * Pauses page execution. Can be resumed using generic RunTime.runIfWaitingForDebugger. 7553 * <BR /><B>EXPERIMENTAL</B> 7554 * 7555 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7556 * {@link Ret0}></CODE> 7557 * 7558 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7559 * browser receives the invocation-request. 7560 * 7561 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7562 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7563 * {@code >} to ensure the Browser Function has run to completion. 7564 */ 7565 public static Script<String, JsonObject, Ret0> waitForDebugger() 7566 { 7567 final int webSocketID = 32055000 + counter++; 7568 final boolean[] optionals = new boolean[0]; 7569 7570 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7571 String requestJSON = WriteJSON.get( 7572 parameterTypes.get("waitForDebugger"), 7573 parameterNames.get("waitForDebugger"), 7574 optionals, webSocketID, 7575 "Page.waitForDebugger" 7576 ); 7577 7578 // This Remote Command does not have a Return-Value. 7579 return new Script<> 7580 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7581 } 7582 7583 /** 7584 * Intercept file chooser requests and transfer control to protocol clients. 7585 * When file chooser interception is enabled, native file chooser dialog is not shown. 7586 * Instead, a protocol event <CODE>Page.fileChooserOpened</CODE> is emitted. 7587 * <BR /><B>EXPERIMENTAL</B> 7588 * 7589 * @param enabled - 7590 * 7591 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7592 * {@link Ret0}></CODE> 7593 * 7594 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7595 * browser receives the invocation-request. 7596 * 7597 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7598 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7599 * {@code >} to ensure the Browser Function has run to completion. 7600 */ 7601 public static Script<String, JsonObject, Ret0> setInterceptFileChooserDialog 7602 (boolean enabled) 7603 { 7604 final int webSocketID = 32056000 + counter++; 7605 final boolean[] optionals = { false, }; 7606 7607 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7608 String requestJSON = WriteJSON.get( 7609 parameterTypes.get("setInterceptFileChooserDialog"), 7610 parameterNames.get("setInterceptFileChooserDialog"), 7611 optionals, webSocketID, 7612 "Page.setInterceptFileChooserDialog", 7613 enabled 7614 ); 7615 7616 // This Remote Command does not have a Return-Value. 7617 return new Script<> 7618 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7619 } 7620 7621}