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