001package Torello.Browser.BrowserAPI; 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.Browser.BrowserEvent; 013import Torello.Browser.JavaScriptAPI.*; 014import Torello.Browser.helper.*; 015 016import Torello.Java.Additional.*; 017import Torello.Java.JSON.*; 018 019import static Torello.Java.JSON.JFlag.*; 020 021import Torello.Java.StrCmpr; 022import Torello.JavaDoc.StaticFunctional; 023import Torello.JavaDoc.JDHeaderBackgroundImg; 024import Torello.JavaDoc.Excuse; 025 026/** 027 * <SPAN CLASS=COPIEDJDK><B>Actions and events related to the inspected page belong to the page domain.</B></SPAN> 028 * 029 * <EMBED CLASS='external-html' DATA-FILE-ID=CODE_GEN_NOTE> 030 */ 031@StaticFunctional(Excused={"counter"}, Excuses={Excuse.CONFIGURATION}) 032@JDHeaderBackgroundImg(EmbedTagFileID="WOOD_PLANK_NOTE") 033public class Page 034{ 035 // ******************************************************************************************** 036 // ******************************************************************************************** 037 // Class Header Stuff 038 // ******************************************************************************************** 039 // ******************************************************************************************** 040 041 042 // No Pubic Constructors 043 private Page () { } 044 045 // These two Vector's are used by all the "Methods" exported by this class. java.lang.reflect 046 // is used to generate the JSON String's. It saves thousands of lines of Auto-Generated Code. 047 private static final Map<String, Vector<String>> parameterNames = new HashMap<>(); 048 private static final Map<String, Vector<Class<?>>> parameterTypes = new HashMap<>(); 049 050 // Some Methods do not take any parameters - for instance all the "enable()" and "disable()" 051 // I simply could not get ride of RAW-TYPES and UNCHECKED warnings... so there are now, 052 // offically, two empty-vectors. One for String's, and the other for Classes. 053 054 private static final Vector<String> EMPTY_VEC_STR = new Vector<>(); 055 private static final Vector<Class<?>> EMPTY_VEC_CLASS = new Vector<>(); 056 057 static 058 { 059 for (Method m : Page.class.getMethods()) 060 { 061 // This doesn't work! The parameter names are all "arg0" ... "argN" 062 // It works for java.lang.reflect.Field, BUT NOT java.lang.reflect.Parameter! 063 // 064 // Vector<String> parameterNamesList = new Vector<>(); -- NOPE! 065 066 Vector<Class<?>> parameterTypesList = new Vector<>(); 067 068 for (Parameter p : m.getParameters()) parameterTypesList.add(p.getType()); 069 070 parameterTypes.put( 071 m.getName(), 072 (parameterTypesList.size() > 0) ? parameterTypesList : EMPTY_VEC_CLASS 073 ); 074 } 075 } 076 077 static 078 { 079 Vector<String> v = null; 080 081 v = new Vector<String>(1); 082 parameterNames.put("addScriptToEvaluateOnLoad", v); 083 Collections.addAll(v, new String[] 084 { "scriptSource", }); 085 086 v = new Vector<String>(4); 087 parameterNames.put("addScriptToEvaluateOnNewDocument", v); 088 Collections.addAll(v, new String[] 089 { "source", "worldName", "includeCommandLineAPI", "runImmediately", }); 090 091 parameterNames.put("bringToFront", EMPTY_VEC_STR); 092 093 v = new Vector<String>(6); 094 parameterNames.put("captureScreenshot", v); 095 Collections.addAll(v, new String[] 096 { "format", "quality", "clip", "fromSurface", "captureBeyondViewport", "optimizeForSpeed", }); 097 098 v = new Vector<String>(1); 099 parameterNames.put("captureSnapshot", v); 100 Collections.addAll(v, new String[] 101 { "format", }); 102 103 parameterNames.put("clearDeviceMetricsOverride", EMPTY_VEC_STR); 104 105 parameterNames.put("clearDeviceOrientationOverride", EMPTY_VEC_STR); 106 107 parameterNames.put("clearGeolocationOverride", EMPTY_VEC_STR); 108 109 v = new Vector<String>(3); 110 parameterNames.put("createIsolatedWorld", v); 111 Collections.addAll(v, new String[] 112 { "frameId", "worldName", "grantUniveralAccess", }); 113 114 v = new Vector<String>(2); 115 parameterNames.put("deleteCookie", v); 116 Collections.addAll(v, new String[] 117 { "cookieName", "url", }); 118 119 parameterNames.put("disable", EMPTY_VEC_STR); 120 121 v = new Vector<String>(1); 122 parameterNames.put("enable", v); 123 Collections.addAll(v, new String[] 124 { "enableFileChooserOpenedEvent", }); 125 126 v = new Vector<String>(1); 127 parameterNames.put("getAppManifest", v); 128 Collections.addAll(v, new String[] 129 { "manifestId", }); 130 131 parameterNames.put("getInstallabilityErrors", EMPTY_VEC_STR); 132 133 parameterNames.put("getManifestIcons", EMPTY_VEC_STR); 134 135 parameterNames.put("getAppId", EMPTY_VEC_STR); 136 137 v = new Vector<String>(1); 138 parameterNames.put("getAdScriptAncestry", v); 139 Collections.addAll(v, new String[] 140 { "frameId", }); 141 142 parameterNames.put("getFrameTree", EMPTY_VEC_STR); 143 144 parameterNames.put("getLayoutMetrics", EMPTY_VEC_STR); 145 146 parameterNames.put("getNavigationHistory", EMPTY_VEC_STR); 147 148 parameterNames.put("resetNavigationHistory", EMPTY_VEC_STR); 149 150 v = new Vector<String>(2); 151 parameterNames.put("getResourceContent", v); 152 Collections.addAll(v, new String[] 153 { "frameId", "url", }); 154 155 parameterNames.put("getResourceTree", EMPTY_VEC_STR); 156 157 v = new Vector<String>(2); 158 parameterNames.put("handleJavaScriptDialog", v); 159 Collections.addAll(v, new String[] 160 { "accept", "promptText", }); 161 162 v = new Vector<String>(5); 163 parameterNames.put("navigate", v); 164 Collections.addAll(v, new String[] 165 { "url", "referrer", "transitionType", "frameId", "referrerPolicy", }); 166 167 v = new Vector<String>(1); 168 parameterNames.put("navigateToHistoryEntry", v); 169 Collections.addAll(v, new String[] 170 { "entryId", }); 171 172 v = new Vector<String>(17); 173 parameterNames.put("printToPDF", v); 174 Collections.addAll(v, new String[] 175 { "landscape", "displayHeaderFooter", "printBackground", "scale", "paperWidth", "paperHeight", "marginTop", "marginBottom", "marginLeft", "marginRight", "pageRanges", "headerTemplate", "footerTemplate", "preferCSSPageSize", "transferMode", "generateTaggedPDF", "generateDocumentOutline", }); 176 177 v = new Vector<String>(3); 178 parameterNames.put("reload", v); 179 Collections.addAll(v, new String[] 180 { "ignoreCache", "scriptToEvaluateOnLoad", "loaderId", }); 181 182 v = new Vector<String>(1); 183 parameterNames.put("removeScriptToEvaluateOnLoad", v); 184 Collections.addAll(v, new String[] 185 { "identifier", }); 186 187 v = new Vector<String>(1); 188 parameterNames.put("removeScriptToEvaluateOnNewDocument", v); 189 Collections.addAll(v, new String[] 190 { "identifier", }); 191 192 v = new Vector<String>(1); 193 parameterNames.put("screencastFrameAck", v); 194 Collections.addAll(v, new String[] 195 { "sessionId", }); 196 197 v = new Vector<String>(5); 198 parameterNames.put("searchInResource", v); 199 Collections.addAll(v, new String[] 200 { "frameId", "url", "query", "caseSensitive", "isRegex", }); 201 202 v = new Vector<String>(1); 203 parameterNames.put("setAdBlockingEnabled", v); 204 Collections.addAll(v, new String[] 205 { "enabled", }); 206 207 v = new Vector<String>(1); 208 parameterNames.put("setBypassCSP", v); 209 Collections.addAll(v, new String[] 210 { "enabled", }); 211 212 v = new Vector<String>(1); 213 parameterNames.put("getPermissionsPolicyState", v); 214 Collections.addAll(v, new String[] 215 { "frameId", }); 216 217 v = new Vector<String>(1); 218 parameterNames.put("getOriginTrials", v); 219 Collections.addAll(v, new String[] 220 { "frameId", }); 221 222 v = new Vector<String>(12); 223 parameterNames.put("setDeviceMetricsOverride", v); 224 Collections.addAll(v, new String[] 225 { "width", "height", "deviceScaleFactor", "mobile", "scale", "screenWidth", "screenHeight", "positionX", "positionY", "dontSetVisibleSize", "screenOrientation", "viewport", }); 226 227 v = new Vector<String>(3); 228 parameterNames.put("setDeviceOrientationOverride", v); 229 Collections.addAll(v, new String[] 230 { "alpha", "beta", "gamma", }); 231 232 v = new Vector<String>(2); 233 parameterNames.put("setFontFamilies", v); 234 Collections.addAll(v, new String[] 235 { "fontFamilies", "forScripts", }); 236 237 v = new Vector<String>(1); 238 parameterNames.put("setFontSizes", v); 239 Collections.addAll(v, new String[] 240 { "fontSizes", }); 241 242 v = new Vector<String>(2); 243 parameterNames.put("setDocumentContent", v); 244 Collections.addAll(v, new String[] 245 { "frameId", "html", }); 246 247 v = new Vector<String>(2); 248 parameterNames.put("setDownloadBehavior", v); 249 Collections.addAll(v, new String[] 250 { "behavior", "downloadPath", }); 251 252 v = new Vector<String>(3); 253 parameterNames.put("setGeolocationOverride", v); 254 Collections.addAll(v, new String[] 255 { "latitude", "longitude", "accuracy", }); 256 257 v = new Vector<String>(1); 258 parameterNames.put("setLifecycleEventsEnabled", v); 259 Collections.addAll(v, new String[] 260 { "enabled", }); 261 262 v = new Vector<String>(2); 263 parameterNames.put("setTouchEmulationEnabled", v); 264 Collections.addAll(v, new String[] 265 { "enabled", "configuration", }); 266 267 v = new Vector<String>(5); 268 parameterNames.put("startScreencast", v); 269 Collections.addAll(v, new String[] 270 { "format", "quality", "maxWidth", "maxHeight", "everyNthFrame", }); 271 272 parameterNames.put("stopLoading", EMPTY_VEC_STR); 273 274 parameterNames.put("crash", EMPTY_VEC_STR); 275 276 parameterNames.put("close", EMPTY_VEC_STR); 277 278 v = new Vector<String>(1); 279 parameterNames.put("setWebLifecycleState", v); 280 Collections.addAll(v, new String[] 281 { "state", }); 282 283 parameterNames.put("stopScreencast", EMPTY_VEC_STR); 284 285 v = new Vector<String>(1); 286 parameterNames.put("produceCompilationCache", v); 287 Collections.addAll(v, new String[] 288 { "scripts", }); 289 290 v = new Vector<String>(2); 291 parameterNames.put("addCompilationCache", v); 292 Collections.addAll(v, new String[] 293 { "url", "data", }); 294 295 parameterNames.put("clearCompilationCache", EMPTY_VEC_STR); 296 297 v = new Vector<String>(1); 298 parameterNames.put("setSPCTransactionMode", v); 299 Collections.addAll(v, new String[] 300 { "mode", }); 301 302 v = new Vector<String>(1); 303 parameterNames.put("setRPHRegistrationMode", v); 304 Collections.addAll(v, new String[] 305 { "mode", }); 306 307 v = new Vector<String>(2); 308 parameterNames.put("generateTestReport", v); 309 Collections.addAll(v, new String[] 310 { "message", "group", }); 311 312 parameterNames.put("waitForDebugger", EMPTY_VEC_STR); 313 314 v = new Vector<String>(2); 315 parameterNames.put("setInterceptFileChooserDialog", v); 316 Collections.addAll(v, new String[] 317 { "enabled", "cancel", }); 318 319 v = new Vector<String>(1); 320 parameterNames.put("setPrerenderingAllowed", v); 321 Collections.addAll(v, new String[] 322 { "isAllowed", }); 323 } 324 325 326 // ******************************************************************************************** 327 // ******************************************************************************************** 328 // Types - Static Inner Classes 329 // ******************************************************************************************** 330 // ******************************************************************************************** 331 332 // public static class FrameId => String 333 334 // public static class ScriptIdentifier => String 335 336 /** 337 * Indicates whether a frame has been identified as an ad. 338 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 339 */ 340 public static final String[] AdFrameType = 341 { "none", "child", "root", }; 342 343 /** 344 * <CODE>[No Description Provided by Google]</CODE> 345 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 346 */ 347 public static final String[] AdFrameExplanation = 348 { "ParentIsAd", "CreatedByAdScript", "MatchedBlockingRule", }; 349 350 /** 351 * Indicates whether the frame is a secure context and why it is the case. 352 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 353 */ 354 public static final String[] SecureContextType = 355 { "Secure", "SecureLocalhost", "InsecureScheme", "InsecureAncestor", }; 356 357 /** 358 * Indicates whether the frame is cross-origin isolated and why it is the case. 359 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 360 */ 361 public static final String[] CrossOriginIsolatedContextType = 362 { "Isolated", "NotIsolated", "NotIsolatedFeatureDisabled", }; 363 364 /** 365 * <CODE>[No Description Provided by Google]</CODE> 366 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 367 */ 368 public static final String[] GatedAPIFeatures = 369 { 370 "SharedArrayBuffers", "SharedArrayBuffersTransferAllowed", "PerformanceMeasureMemory", 371 "PerformanceProfile", 372 }; 373 374 /** 375 * All Permissions Policy features. This enum should match the one defined 376 * in services/network/public/cpp/permissions_policy/permissions_policy_features.json5. 377 * LINT.IfChange(PermissionsPolicyFeature) 378 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 379 */ 380 public static final String[] PermissionsPolicyFeature = 381 { 382 "accelerometer", "all-screens-capture", "ambient-light-sensor", "aria-notify", 383 "attribution-reporting", "autoplay", "bluetooth", "browsing-topics", "camera", 384 "captured-surface-control", "ch-dpr", "ch-device-memory", "ch-downlink", "ch-ect", 385 "ch-prefers-color-scheme", "ch-prefers-reduced-motion", "ch-prefers-reduced-transparency", 386 "ch-rtt", "ch-save-data", "ch-ua", "ch-ua-arch", "ch-ua-bitness", 387 "ch-ua-high-entropy-values", "ch-ua-platform", "ch-ua-model", "ch-ua-mobile", 388 "ch-ua-form-factors", "ch-ua-full-version", "ch-ua-full-version-list", 389 "ch-ua-platform-version", "ch-ua-wow64", "ch-viewport-height", "ch-viewport-width", 390 "ch-width", "clipboard-read", "clipboard-write", "compute-pressure", "controlled-frame", 391 "cross-origin-isolated", "deferred-fetch", "deferred-fetch-minimal", "device-attributes", 392 "digital-credentials-get", "direct-sockets", "direct-sockets-private", "display-capture", 393 "document-domain", "encrypted-media", "execution-while-out-of-viewport", 394 "execution-while-not-rendered", "fenced-unpartitioned-storage-read", 395 "focus-without-user-activation", "fullscreen", "frobulate", "gamepad", "geolocation", 396 "gyroscope", "hid", "identity-credentials-get", "idle-detection", "interest-cohort", 397 "join-ad-interest-group", "keyboard-map", "language-detector", "language-model", 398 "local-fonts", "local-network-access", "magnetometer", "media-playback-while-not-visible", 399 "microphone", "midi", "on-device-speech-recognition", "otp-credentials", "payment", 400 "picture-in-picture", "popins", "private-aggregation", "private-state-token-issuance", 401 "private-state-token-redemption", "publickey-credentials-create", 402 "publickey-credentials-get", "record-ad-auction-events", "rewriter", "run-ad-auction", 403 "screen-wake-lock", "serial", "shared-autofill", "shared-storage", 404 "shared-storage-select-url", "smart-card", "speaker-selection", "storage-access", 405 "sub-apps", "summarizer", "sync-xhr", "translator", "unload", "usb", "usb-unrestricted", 406 "vertical-scroll", "web-app-installation", "web-printing", "web-share", 407 "window-management", "writer", "xr-spatial-tracking", 408 }; 409 410 /** 411 * Reason for a permissions policy feature to be disabled. 412 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 413 */ 414 public static final String[] PermissionsPolicyBlockReason = 415 { "Header", "IframeAttribute", "InFencedFrameTree", "InIsolatedApp", }; 416 417 /** 418 * Origin Trial(https://www.chromium.org/blink/origin-trials) support. 419 * Status for an Origin Trial token. 420 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 421 */ 422 public static final String[] OriginTrialTokenStatus = 423 { 424 "Success", "NotSupported", "Insecure", "Expired", "WrongOrigin", "InvalidSignature", 425 "Malformed", "WrongVersion", "FeatureDisabled", "TokenDisabled", "FeatureDisabledForUser", 426 "UnknownTrial", 427 }; 428 429 /** 430 * Status for an Origin Trial. 431 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 432 */ 433 public static final String[] OriginTrialStatus = 434 { "Enabled", "ValidTokenNotProvided", "OSNotSupported", "TrialNotAllowed", }; 435 436 /** 437 * <CODE>[No Description Provided by Google]</CODE> 438 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 439 */ 440 public static final String[] OriginTrialUsageRestriction = 441 { "None", "Subset", }; 442 443 /** Transition type. */ 444 public static final String[] TransitionType = 445 { 446 "link", "typed", "address_bar", "auto_bookmark", "auto_subframe", "manual_subframe", 447 "generated", "auto_toplevel", "form_submit", "reload", "keyword", "keyword_generated", 448 "other", 449 }; 450 451 /** Javascript dialog type. */ 452 public static final String[] DialogType = 453 { "alert", "confirm", "prompt", "beforeunload", }; 454 455 /** 456 * <CODE>[No Description Provided by Google]</CODE> 457 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 458 */ 459 public static final String[] ClientNavigationReason = 460 { 461 "anchorClick", "formSubmissionGet", "formSubmissionPost", "httpHeaderRefresh", 462 "initialFrameNavigation", "metaTagRefresh", "other", "pageBlockInterstitial", "reload", 463 "scriptInitiated", 464 }; 465 466 /** 467 * <CODE>[No Description Provided by Google]</CODE> 468 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 469 */ 470 public static final String[] ClientNavigationDisposition = 471 { "currentTab", "newTab", "newWindow", "download", }; 472 473 /** 474 * The referring-policy used for the navigation. 475 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 476 */ 477 public static final String[] ReferrerPolicy = 478 { 479 "noReferrer", "noReferrerWhenDowngrade", "origin", "originWhenCrossOrigin", "sameOrigin", 480 "strictOrigin", "strictOriginWhenCrossOrigin", "unsafeUrl", 481 }; 482 483 /** 484 * The type of a frameNavigated event. 485 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 486 */ 487 public static final String[] NavigationType = 488 { "Navigation", "BackForwardCacheRestore", }; 489 490 /** 491 * List of not restored reasons for back-forward cache. 492 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 493 */ 494 public static final String[] BackForwardCacheNotRestoredReason = 495 { 496 "NotPrimaryMainFrame", "BackForwardCacheDisabled", "RelatedActiveContentsExist", 497 "HTTPStatusNotOK", "SchemeNotHTTPOrHTTPS", "Loading", "WasGrantedMediaAccess", 498 "DisableForRenderFrameHostCalled", "DomainNotAllowed", "HTTPMethodNotGET", 499 "SubframeIsNavigating", "Timeout", "CacheLimit", "JavaScriptExecution", 500 "RendererProcessKilled", "RendererProcessCrashed", "SchedulerTrackedFeatureUsed", 501 "ConflictingBrowsingInstance", "CacheFlushed", "ServiceWorkerVersionActivation", 502 "SessionRestored", "ServiceWorkerPostMessage", 503 "EnteredBackForwardCacheBeforeServiceWorkerHostAdded", "RenderFrameHostReused_SameSite", 504 "RenderFrameHostReused_CrossSite", "ServiceWorkerClaim", "IgnoreEventAndEvict", 505 "HaveInnerContents", "TimeoutPuttingInCache", "BackForwardCacheDisabledByLowMemory", 506 "BackForwardCacheDisabledByCommandLine", "NetworkRequestDatapipeDrainedAsBytesConsumer", 507 "NetworkRequestRedirected", "NetworkRequestTimeout", "NetworkExceedsBufferLimit", 508 "NavigationCancelledWhileRestoring", "NotMostRecentNavigationEntry", 509 "BackForwardCacheDisabledForPrerender", "UserAgentOverrideDiffers", "ForegroundCacheLimit", 510 "BrowsingInstanceNotSwapped", "BackForwardCacheDisabledForDelegate", 511 "UnloadHandlerExistsInMainFrame", "UnloadHandlerExistsInSubFrame", 512 "ServiceWorkerUnregistration", "CacheControlNoStore", "CacheControlNoStoreCookieModified", 513 "CacheControlNoStoreHTTPOnlyCookieModified", "NoResponseHead", "Unknown", 514 "ActivationNavigationsDisallowedForBug1234857", "ErrorDocument", "FencedFramesEmbedder", 515 "CookieDisabled", "HTTPAuthRequired", "CookieFlushed", "BroadcastChannelOnMessage", 516 "WebViewSettingsChanged", "WebViewJavaScriptObjectChanged", 517 "WebViewMessageListenerInjected", "WebViewSafeBrowsingAllowlistChanged", 518 "WebViewDocumentStartJavascriptChanged", "WebSocket", "WebTransport", "WebRTC", 519 "MainResourceHasCacheControlNoStore", "MainResourceHasCacheControlNoCache", 520 "SubresourceHasCacheControlNoStore", "SubresourceHasCacheControlNoCache", 521 "ContainsPlugins", "DocumentLoaded", "OutstandingNetworkRequestOthers", 522 "RequestedMIDIPermission", "RequestedAudioCapturePermission", 523 "RequestedVideoCapturePermission", "RequestedBackForwardCacheBlockedSensors", 524 "RequestedBackgroundWorkPermission", "BroadcastChannel", "WebXR", "SharedWorker", 525 "SharedWorkerMessage", "WebLocks", "WebHID", "WebShare", "RequestedStorageAccessGrant", 526 "WebNfc", "OutstandingNetworkRequestFetch", "OutstandingNetworkRequestXHR", "AppBanner", 527 "Printing", "WebDatabase", "PictureInPicture", "SpeechRecognizer", "IdleManager", 528 "PaymentManager", "SpeechSynthesis", "KeyboardLock", "WebOTPService", 529 "OutstandingNetworkRequestDirectSocket", "InjectedJavascript", "InjectedStyleSheet", 530 "KeepaliveRequest", "IndexedDBEvent", "Dummy", 531 "JsNetworkRequestReceivedCacheControlNoStoreResource", "WebRTCSticky", 532 "WebTransportSticky", "WebSocketSticky", "SmartCard", "LiveMediaStreamTrack", 533 "UnloadHandler", "ParserAborted", "ContentSecurityHandler", "ContentWebAuthenticationAPI", 534 "ContentFileChooser", "ContentSerial", "ContentFileSystemAccess", 535 "ContentMediaDevicesDispatcherHost", "ContentWebBluetooth", "ContentWebUSB", 536 "ContentMediaSessionService", "ContentScreenReader", "ContentDiscarded", 537 "EmbedderPopupBlockerTabHelper", "EmbedderSafeBrowsingTriggeredPopupBlocker", 538 "EmbedderSafeBrowsingThreatDetails", "EmbedderAppBannerManager", 539 "EmbedderDomDistillerViewerSource", "EmbedderDomDistillerSelfDeletingRequestDelegate", 540 "EmbedderOomInterventionTabHelper", "EmbedderOfflinePage", 541 "EmbedderChromePasswordManagerClientBindCredentialManager", 542 "EmbedderPermissionRequestManager", "EmbedderModalDialog", "EmbedderExtensions", 543 "EmbedderExtensionMessaging", "EmbedderExtensionMessagingForOpenPort", 544 "EmbedderExtensionSentMessageToCachedFrame", "RequestedByWebViewClient", 545 "PostMessageByWebViewClient", "CacheControlNoStoreDeviceBoundSessionTerminated", 546 "CacheLimitPrunedOnModerateMemoryPressure", "CacheLimitPrunedOnCriticalMemoryPressure", 547 }; 548 549 /** 550 * Types of not restored reasons for back-forward cache. 551 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 552 */ 553 public static final String[] BackForwardCacheNotRestoredReasonType = 554 { "SupportPending", "PageSupportNeeded", "Circumstantial", }; 555 556 /** 557 * Indicates whether a frame has been identified as an ad and why. 558 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 559 */ 560 public static class AdFrameStatus 561 extends BaseType 562 implements java.io.Serializable 563 { 564 /** For Object Serialization. java.io.Serializable */ 565 protected static final long serialVersionUID = 1; 566 567 public boolean[] optionals() 568 { return new boolean[] { false, true, }; } 569 570 /** <CODE>[No Description Provided by Google]</CODE> */ 571 public final String adFrameType; 572 573 /** 574 * <CODE>[No Description Provided by Google]</CODE> 575 * <BR /><B CLASS=Opt>OPTIONAL</B> 576 */ 577 public final String[] explanations; 578 579 /** 580 * Constructor 581 * 582 * @param adFrameType - 583 * 584 * @param explanations - 585 * <BR /><B CLASS=Opt>OPTIONAL</B> 586 */ 587 public AdFrameStatus(String adFrameType, String[] explanations) 588 { 589 // Exception-Check(s) to ensure that if any parameters which are not declared as 590 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 591 592 if (adFrameType == null) THROWS.throwNPE("adFrameType"); 593 594 // Exception-Check(s) to ensure that if any parameters which must adhere to a 595 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 596 597 THROWS.checkIAE("adFrameType", adFrameType, "Page.AdFrameType", Page.AdFrameType); 598 599 this.adFrameType = adFrameType; 600 this.explanations = explanations; 601 } 602 603 /** 604 * JSON Object Constructor 605 * @param jo A Json-Object having data about an instance of {@code 'AdFrameStatus'}. 606 */ 607 public AdFrameStatus (JsonObject jo) 608 { 609 this.adFrameType = ReadJSON.getString(jo, "adFrameType", false, true); 610 this.explanations = (jo.getJsonArray("explanations") == null) 611 ? null 612 : RJArrIntoStream.strArr(jo.getJsonArray("explanations"), null, 0).toArray(String[]::new); 613 614 } 615 616 617 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 618 public boolean equals(Object other) 619 { 620 if (this == other) return true; 621 if (other == null) return false; 622 if (other.getClass() != this.getClass()) return false; 623 624 AdFrameStatus o = (AdFrameStatus) other; 625 626 return 627 Objects.equals(this.adFrameType, o.adFrameType) 628 && Arrays.deepEquals(this.explanations, o.explanations); 629 } 630 631 /** Generates a Hash-Code for {@code 'this'} instance */ 632 public int hashCode() 633 { 634 return 635 Objects.hashCode(this.adFrameType) 636 + Arrays.deepHashCode(this.explanations); 637 } 638 } 639 640 /** 641 * Identifies the script which caused a script or frame to be labelled as an 642 * ad. 643 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 644 */ 645 public static class AdScriptId 646 extends BaseType 647 implements java.io.Serializable 648 { 649 /** For Object Serialization. java.io.Serializable */ 650 protected static final long serialVersionUID = 1; 651 652 public boolean[] optionals() 653 { return new boolean[] { false, false, }; } 654 655 /** 656 * Script Id of the script which caused a script or frame to be labelled as 657 * an ad. 658 */ 659 public final String scriptId; 660 661 /** Id of scriptId's debugger. */ 662 public final String debuggerId; 663 664 /** 665 * Constructor 666 * 667 * @param scriptId 668 * Script Id of the script which caused a script or frame to be labelled as 669 * an ad. 670 * 671 * @param debuggerId Id of scriptId's debugger. 672 */ 673 public AdScriptId(String scriptId, String debuggerId) 674 { 675 // Exception-Check(s) to ensure that if any parameters which are not declared as 676 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 677 678 if (scriptId == null) THROWS.throwNPE("scriptId"); 679 if (debuggerId == null) THROWS.throwNPE("debuggerId"); 680 681 this.scriptId = scriptId; 682 this.debuggerId = debuggerId; 683 } 684 685 /** 686 * JSON Object Constructor 687 * @param jo A Json-Object having data about an instance of {@code 'AdScriptId'}. 688 */ 689 public AdScriptId (JsonObject jo) 690 { 691 this.scriptId = ReadJSON.getString(jo, "scriptId", false, true); 692 this.debuggerId = ReadJSON.getString(jo, "debuggerId", false, true); 693 } 694 695 696 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 697 public boolean equals(Object other) 698 { 699 if (this == other) return true; 700 if (other == null) return false; 701 if (other.getClass() != this.getClass()) return false; 702 703 AdScriptId o = (AdScriptId) other; 704 705 return 706 Objects.equals(this.scriptId, o.scriptId) 707 && Objects.equals(this.debuggerId, o.debuggerId); 708 } 709 710 /** Generates a Hash-Code for {@code 'this'} instance */ 711 public int hashCode() 712 { 713 return 714 Objects.hashCode(this.scriptId) 715 + Objects.hashCode(this.debuggerId); 716 } 717 } 718 719 /** 720 * Encapsulates the script ancestry and the root script filterlist rule that 721 * caused the frame to be labelled as an ad. Only created when {@code ancestryChain} 722 * is not empty. 723 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 724 */ 725 public static class AdScriptAncestry 726 extends BaseType 727 implements java.io.Serializable 728 { 729 /** For Object Serialization. java.io.Serializable */ 730 protected static final long serialVersionUID = 1; 731 732 public boolean[] optionals() 733 { return new boolean[] { false, true, }; } 734 735 /** 736 * A chain of {@code AdScriptId}s representing the ancestry of an ad script that 737 * led to the creation of a frame. The chain is ordered from the script 738 * itself (lower level) up to its root ancestor that was flagged by 739 * filterlist. 740 */ 741 public final Page.AdScriptId[] ancestryChain; 742 743 /** 744 * The filterlist rule that caused the root (last) script in 745 * {@code ancestryChain} to be ad-tagged. Only populated if the rule is 746 * available. 747 * <BR /><B CLASS=Opt>OPTIONAL</B> 748 */ 749 public final String rootScriptFilterlistRule; 750 751 /** 752 * Constructor 753 * 754 * @param ancestryChain 755 * A chain of {@code AdScriptId}s representing the ancestry of an ad script that 756 * led to the creation of a frame. The chain is ordered from the script 757 * itself (lower level) up to its root ancestor that was flagged by 758 * filterlist. 759 * 760 * @param rootScriptFilterlistRule 761 * The filterlist rule that caused the root (last) script in 762 * {@code ancestryChain} to be ad-tagged. Only populated if the rule is 763 * available. 764 * <BR /><B CLASS=Opt>OPTIONAL</B> 765 */ 766 public AdScriptAncestry 767 (Page.AdScriptId[] ancestryChain, String rootScriptFilterlistRule) 768 { 769 // Exception-Check(s) to ensure that if any parameters which are not declared as 770 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 771 772 if (ancestryChain == null) THROWS.throwNPE("ancestryChain"); 773 774 this.ancestryChain = ancestryChain; 775 this.rootScriptFilterlistRule = rootScriptFilterlistRule; 776 } 777 778 /** 779 * JSON Object Constructor 780 * @param jo A Json-Object having data about an instance of {@code 'AdScriptAncestry'}. 781 */ 782 public AdScriptAncestry (JsonObject jo) 783 { 784 this.ancestryChain = (jo.getJsonArray("ancestryChain") == null) 785 ? null 786 : RJArrIntoStream.objArr(jo.getJsonArray("ancestryChain"), null, 0, Page.AdScriptId.class).toArray(Page.AdScriptId[]::new); 787 788 this.rootScriptFilterlistRule = ReadJSON.getString(jo, "rootScriptFilterlistRule", true, false); 789 } 790 791 792 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 793 public boolean equals(Object other) 794 { 795 if (this == other) return true; 796 if (other == null) return false; 797 if (other.getClass() != this.getClass()) return false; 798 799 AdScriptAncestry o = (AdScriptAncestry) other; 800 801 return 802 Arrays.deepEquals(this.ancestryChain, o.ancestryChain) 803 && Objects.equals(this.rootScriptFilterlistRule, o.rootScriptFilterlistRule); 804 } 805 806 /** Generates a Hash-Code for {@code 'this'} instance */ 807 public int hashCode() 808 { 809 return 810 Arrays.deepHashCode(this.ancestryChain) 811 + Objects.hashCode(this.rootScriptFilterlistRule); 812 } 813 } 814 815 /** 816 * <CODE>[No Description Provided by Google]</CODE> 817 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 818 */ 819 public static class PermissionsPolicyBlockLocator 820 extends BaseType 821 implements java.io.Serializable 822 { 823 /** For Object Serialization. java.io.Serializable */ 824 protected static final long serialVersionUID = 1; 825 826 public boolean[] optionals() 827 { return new boolean[] { false, false, }; } 828 829 /** <CODE>[No Description Provided by Google]</CODE> */ 830 public final String frameId; 831 832 /** <CODE>[No Description Provided by Google]</CODE> */ 833 public final String blockReason; 834 835 /** 836 * Constructor 837 * 838 * @param frameId - 839 * 840 * @param blockReason - 841 */ 842 public PermissionsPolicyBlockLocator(String frameId, String blockReason) 843 { 844 // Exception-Check(s) to ensure that if any parameters which are not declared as 845 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 846 847 if (frameId == null) THROWS.throwNPE("frameId"); 848 if (blockReason == null) THROWS.throwNPE("blockReason"); 849 850 // Exception-Check(s) to ensure that if any parameters which must adhere to a 851 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 852 853 THROWS.checkIAE("blockReason", blockReason, "Page.PermissionsPolicyBlockReason", Page.PermissionsPolicyBlockReason); 854 855 this.frameId = frameId; 856 this.blockReason = blockReason; 857 } 858 859 /** 860 * JSON Object Constructor 861 * @param jo A Json-Object having data about an instance of {@code 'PermissionsPolicyBlockLocator'}. 862 */ 863 public PermissionsPolicyBlockLocator (JsonObject jo) 864 { 865 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 866 this.blockReason = ReadJSON.getString(jo, "blockReason", false, true); 867 } 868 869 870 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 871 public boolean equals(Object other) 872 { 873 if (this == other) return true; 874 if (other == null) return false; 875 if (other.getClass() != this.getClass()) return false; 876 877 PermissionsPolicyBlockLocator o = (PermissionsPolicyBlockLocator) other; 878 879 return 880 Objects.equals(this.frameId, o.frameId) 881 && Objects.equals(this.blockReason, o.blockReason); 882 } 883 884 /** Generates a Hash-Code for {@code 'this'} instance */ 885 public int hashCode() 886 { 887 return 888 Objects.hashCode(this.frameId) 889 + Objects.hashCode(this.blockReason); 890 } 891 } 892 893 /** 894 * <CODE>[No Description Provided by Google]</CODE> 895 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 896 */ 897 public static class PermissionsPolicyFeatureState 898 extends BaseType 899 implements java.io.Serializable 900 { 901 /** For Object Serialization. java.io.Serializable */ 902 protected static final long serialVersionUID = 1; 903 904 public boolean[] optionals() 905 { return new boolean[] { false, false, true, }; } 906 907 /** <CODE>[No Description Provided by Google]</CODE> */ 908 public final String feature; 909 910 /** <CODE>[No Description Provided by Google]</CODE> */ 911 public final boolean allowed; 912 913 /** 914 * <CODE>[No Description Provided by Google]</CODE> 915 * <BR /><B CLASS=Opt>OPTIONAL</B> 916 */ 917 public final Page.PermissionsPolicyBlockLocator locator; 918 919 /** 920 * Constructor 921 * 922 * @param feature - 923 * 924 * @param allowed - 925 * 926 * @param locator - 927 * <BR /><B CLASS=Opt>OPTIONAL</B> 928 */ 929 public PermissionsPolicyFeatureState 930 (String feature, boolean allowed, Page.PermissionsPolicyBlockLocator locator) 931 { 932 // Exception-Check(s) to ensure that if any parameters which are not declared as 933 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 934 935 if (feature == null) THROWS.throwNPE("feature"); 936 937 // Exception-Check(s) to ensure that if any parameters which must adhere to a 938 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 939 940 THROWS.checkIAE("feature", feature, "Page.PermissionsPolicyFeature", Page.PermissionsPolicyFeature); 941 942 this.feature = feature; 943 this.allowed = allowed; 944 this.locator = locator; 945 } 946 947 /** 948 * JSON Object Constructor 949 * @param jo A Json-Object having data about an instance of {@code 'PermissionsPolicyFeatureState'}. 950 */ 951 public PermissionsPolicyFeatureState (JsonObject jo) 952 { 953 this.feature = ReadJSON.getString(jo, "feature", false, true); 954 this.allowed = ReadPrimJSON.getBoolean(jo, "allowed"); 955 this.locator = ReadJSON.getObject(jo, "locator", Page.PermissionsPolicyBlockLocator.class, true, false); 956 } 957 958 959 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 960 public boolean equals(Object other) 961 { 962 if (this == other) return true; 963 if (other == null) return false; 964 if (other.getClass() != this.getClass()) return false; 965 966 PermissionsPolicyFeatureState o = (PermissionsPolicyFeatureState) other; 967 968 return 969 Objects.equals(this.feature, o.feature) 970 && (this.allowed == o.allowed) 971 && Objects.equals(this.locator, o.locator); 972 } 973 974 /** Generates a Hash-Code for {@code 'this'} instance */ 975 public int hashCode() 976 { 977 return 978 Objects.hashCode(this.feature) 979 + (this.allowed ? 1 : 0) 980 + this.locator.hashCode(); 981 } 982 } 983 984 /** 985 * <CODE>[No Description Provided by Google]</CODE> 986 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 987 */ 988 public static class OriginTrialToken 989 extends BaseType 990 implements java.io.Serializable 991 { 992 /** For Object Serialization. java.io.Serializable */ 993 protected static final long serialVersionUID = 1; 994 995 public boolean[] optionals() 996 { return new boolean[] { false, false, false, false, false, false, }; } 997 998 /** <CODE>[No Description Provided by Google]</CODE> */ 999 public final String origin; 1000 1001 /** <CODE>[No Description Provided by Google]</CODE> */ 1002 public final boolean matchSubDomains; 1003 1004 /** <CODE>[No Description Provided by Google]</CODE> */ 1005 public final String trialName; 1006 1007 /** <CODE>[No Description Provided by Google]</CODE> */ 1008 public final Number expiryTime; 1009 1010 /** <CODE>[No Description Provided by Google]</CODE> */ 1011 public final boolean isThirdParty; 1012 1013 /** <CODE>[No Description Provided by Google]</CODE> */ 1014 public final String usageRestriction; 1015 1016 /** 1017 * Constructor 1018 * 1019 * @param origin - 1020 * 1021 * @param matchSubDomains - 1022 * 1023 * @param trialName - 1024 * 1025 * @param expiryTime - 1026 * 1027 * @param isThirdParty - 1028 * 1029 * @param usageRestriction - 1030 */ 1031 public OriginTrialToken( 1032 String origin, boolean matchSubDomains, String trialName, Number expiryTime, 1033 boolean isThirdParty, String usageRestriction 1034 ) 1035 { 1036 // Exception-Check(s) to ensure that if any parameters which are not declared as 1037 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1038 1039 if (origin == null) THROWS.throwNPE("origin"); 1040 if (trialName == null) THROWS.throwNPE("trialName"); 1041 if (expiryTime == null) THROWS.throwNPE("expiryTime"); 1042 if (usageRestriction == null) THROWS.throwNPE("usageRestriction"); 1043 1044 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1045 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1046 1047 THROWS.checkIAE("usageRestriction", usageRestriction, "Page.OriginTrialUsageRestriction", Page.OriginTrialUsageRestriction); 1048 1049 this.origin = origin; 1050 this.matchSubDomains = matchSubDomains; 1051 this.trialName = trialName; 1052 this.expiryTime = expiryTime; 1053 this.isThirdParty = isThirdParty; 1054 this.usageRestriction = usageRestriction; 1055 } 1056 1057 /** 1058 * JSON Object Constructor 1059 * @param jo A Json-Object having data about an instance of {@code 'OriginTrialToken'}. 1060 */ 1061 public OriginTrialToken (JsonObject jo) 1062 { 1063 this.origin = ReadJSON.getString(jo, "origin", false, true); 1064 this.matchSubDomains = ReadPrimJSON.getBoolean(jo, "matchSubDomains"); 1065 this.trialName = ReadJSON.getString(jo, "trialName", false, true); 1066 this.expiryTime = ReadNumberJSON.get(jo, "expiryTime", false, true); 1067 this.isThirdParty = ReadPrimJSON.getBoolean(jo, "isThirdParty"); 1068 this.usageRestriction = ReadJSON.getString(jo, "usageRestriction", false, true); 1069 } 1070 1071 1072 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1073 public boolean equals(Object other) 1074 { 1075 if (this == other) return true; 1076 if (other == null) return false; 1077 if (other.getClass() != this.getClass()) return false; 1078 1079 OriginTrialToken o = (OriginTrialToken) other; 1080 1081 return 1082 Objects.equals(this.origin, o.origin) 1083 && (this.matchSubDomains == o.matchSubDomains) 1084 && Objects.equals(this.trialName, o.trialName) 1085 && Objects.equals(this.expiryTime, o.expiryTime) 1086 && (this.isThirdParty == o.isThirdParty) 1087 && Objects.equals(this.usageRestriction, o.usageRestriction); 1088 } 1089 1090 /** Generates a Hash-Code for {@code 'this'} instance */ 1091 public int hashCode() 1092 { 1093 return 1094 Objects.hashCode(this.origin) 1095 + (this.matchSubDomains ? 1 : 0) 1096 + Objects.hashCode(this.trialName) 1097 + Objects.hashCode(this.expiryTime) 1098 + (this.isThirdParty ? 1 : 0) 1099 + Objects.hashCode(this.usageRestriction); 1100 } 1101 } 1102 1103 /** 1104 * <CODE>[No Description Provided by Google]</CODE> 1105 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1106 */ 1107 public static class OriginTrialTokenWithStatus 1108 extends BaseType 1109 implements java.io.Serializable 1110 { 1111 /** For Object Serialization. java.io.Serializable */ 1112 protected static final long serialVersionUID = 1; 1113 1114 public boolean[] optionals() 1115 { return new boolean[] { false, true, false, }; } 1116 1117 /** <CODE>[No Description Provided by Google]</CODE> */ 1118 public final String rawTokenText; 1119 1120 /** 1121 * {@code parsedToken} is present only when the token is extractable and 1122 * parsable. 1123 * <BR /><B CLASS=Opt>OPTIONAL</B> 1124 */ 1125 public final Page.OriginTrialToken parsedToken; 1126 1127 /** <CODE>[No Description Provided by Google]</CODE> */ 1128 public final String status; 1129 1130 /** 1131 * Constructor 1132 * 1133 * @param rawTokenText - 1134 * 1135 * @param parsedToken 1136 * {@code parsedToken} is present only when the token is extractable and 1137 * parsable. 1138 * <BR /><B CLASS=Opt>OPTIONAL</B> 1139 * 1140 * @param status - 1141 */ 1142 public OriginTrialTokenWithStatus 1143 (String rawTokenText, Page.OriginTrialToken parsedToken, String status) 1144 { 1145 // Exception-Check(s) to ensure that if any parameters which are not declared as 1146 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1147 1148 if (rawTokenText == null) THROWS.throwNPE("rawTokenText"); 1149 if (status == null) THROWS.throwNPE("status"); 1150 1151 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1152 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1153 1154 THROWS.checkIAE("status", status, "Page.OriginTrialTokenStatus", Page.OriginTrialTokenStatus); 1155 1156 this.rawTokenText = rawTokenText; 1157 this.parsedToken = parsedToken; 1158 this.status = status; 1159 } 1160 1161 /** 1162 * JSON Object Constructor 1163 * @param jo A Json-Object having data about an instance of {@code 'OriginTrialTokenWithStatus'}. 1164 */ 1165 public OriginTrialTokenWithStatus (JsonObject jo) 1166 { 1167 this.rawTokenText = ReadJSON.getString(jo, "rawTokenText", false, true); 1168 this.parsedToken = ReadJSON.getObject(jo, "parsedToken", Page.OriginTrialToken.class, true, false); 1169 this.status = ReadJSON.getString(jo, "status", false, true); 1170 } 1171 1172 1173 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1174 public boolean equals(Object other) 1175 { 1176 if (this == other) return true; 1177 if (other == null) return false; 1178 if (other.getClass() != this.getClass()) return false; 1179 1180 OriginTrialTokenWithStatus o = (OriginTrialTokenWithStatus) other; 1181 1182 return 1183 Objects.equals(this.rawTokenText, o.rawTokenText) 1184 && Objects.equals(this.parsedToken, o.parsedToken) 1185 && Objects.equals(this.status, o.status); 1186 } 1187 1188 /** Generates a Hash-Code for {@code 'this'} instance */ 1189 public int hashCode() 1190 { 1191 return 1192 Objects.hashCode(this.rawTokenText) 1193 + this.parsedToken.hashCode() 1194 + Objects.hashCode(this.status); 1195 } 1196 } 1197 1198 /** 1199 * <CODE>[No Description Provided by Google]</CODE> 1200 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1201 */ 1202 public static class OriginTrial 1203 extends BaseType 1204 implements java.io.Serializable 1205 { 1206 /** For Object Serialization. java.io.Serializable */ 1207 protected static final long serialVersionUID = 1; 1208 1209 public boolean[] optionals() 1210 { return new boolean[] { false, false, false, }; } 1211 1212 /** <CODE>[No Description Provided by Google]</CODE> */ 1213 public final String trialName; 1214 1215 /** <CODE>[No Description Provided by Google]</CODE> */ 1216 public final String status; 1217 1218 /** <CODE>[No Description Provided by Google]</CODE> */ 1219 public final Page.OriginTrialTokenWithStatus[] tokensWithStatus; 1220 1221 /** 1222 * Constructor 1223 * 1224 * @param trialName - 1225 * 1226 * @param status - 1227 * 1228 * @param tokensWithStatus - 1229 */ 1230 public OriginTrial 1231 (String trialName, String status, Page.OriginTrialTokenWithStatus[] tokensWithStatus) 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 (trialName == null) THROWS.throwNPE("trialName"); 1237 if (status == null) THROWS.throwNPE("status"); 1238 if (tokensWithStatus == null) THROWS.throwNPE("tokensWithStatus"); 1239 1240 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1241 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1242 1243 THROWS.checkIAE("status", status, "Page.OriginTrialStatus", Page.OriginTrialStatus); 1244 1245 this.trialName = trialName; 1246 this.status = status; 1247 this.tokensWithStatus = tokensWithStatus; 1248 } 1249 1250 /** 1251 * JSON Object Constructor 1252 * @param jo A Json-Object having data about an instance of {@code 'OriginTrial'}. 1253 */ 1254 public OriginTrial (JsonObject jo) 1255 { 1256 this.trialName = ReadJSON.getString(jo, "trialName", false, true); 1257 this.status = ReadJSON.getString(jo, "status", false, true); 1258 this.tokensWithStatus = (jo.getJsonArray("tokensWithStatus") == null) 1259 ? null 1260 : RJArrIntoStream.objArr(jo.getJsonArray("tokensWithStatus"), null, 0, Page.OriginTrialTokenWithStatus.class).toArray(Page.OriginTrialTokenWithStatus[]::new); 1261 1262 } 1263 1264 1265 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1266 public boolean equals(Object other) 1267 { 1268 if (this == other) return true; 1269 if (other == null) return false; 1270 if (other.getClass() != this.getClass()) return false; 1271 1272 OriginTrial o = (OriginTrial) other; 1273 1274 return 1275 Objects.equals(this.trialName, o.trialName) 1276 && Objects.equals(this.status, o.status) 1277 && Arrays.deepEquals(this.tokensWithStatus, o.tokensWithStatus); 1278 } 1279 1280 /** Generates a Hash-Code for {@code 'this'} instance */ 1281 public int hashCode() 1282 { 1283 return 1284 Objects.hashCode(this.trialName) 1285 + Objects.hashCode(this.status) 1286 + Arrays.deepHashCode(this.tokensWithStatus); 1287 } 1288 } 1289 1290 /** 1291 * Additional information about the frame document's security origin. 1292 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1293 */ 1294 public static class SecurityOriginDetails 1295 extends BaseType 1296 implements java.io.Serializable 1297 { 1298 /** For Object Serialization. java.io.Serializable */ 1299 protected static final long serialVersionUID = 1; 1300 1301 public boolean[] optionals() 1302 { return new boolean[] { false, }; } 1303 1304 /** 1305 * Indicates whether the frame document's security origin is one 1306 * of the local hostnames (e.g. "localhost") or IP addresses (IPv4 1307 * 127.0.0.0/8 or IPv6 ::1). 1308 */ 1309 public final boolean isLocalhost; 1310 1311 /** 1312 * Constructor 1313 * 1314 * @param isLocalhost 1315 * Indicates whether the frame document's security origin is one 1316 * of the local hostnames (e.g. "localhost") or IP addresses (IPv4 1317 * 127.0.0.0/8 or IPv6 ::1). 1318 */ 1319 public SecurityOriginDetails(boolean isLocalhost) 1320 { 1321 this.isLocalhost = isLocalhost; 1322 } 1323 1324 /** 1325 * JSON Object Constructor 1326 * @param jo A Json-Object having data about an instance of {@code 'SecurityOriginDetails'}. 1327 */ 1328 public SecurityOriginDetails (JsonObject jo) 1329 { 1330 this.isLocalhost = ReadPrimJSON.getBoolean(jo, "isLocalhost"); 1331 } 1332 1333 1334 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1335 public boolean equals(Object other) 1336 { 1337 if (this == other) return true; 1338 if (other == null) return false; 1339 if (other.getClass() != this.getClass()) return false; 1340 1341 SecurityOriginDetails o = (SecurityOriginDetails) other; 1342 1343 return 1344 (this.isLocalhost == o.isLocalhost); 1345 } 1346 1347 /** Generates a Hash-Code for {@code 'this'} instance */ 1348 public int hashCode() 1349 { 1350 return 1351 (this.isLocalhost ? 1 : 0); 1352 } 1353 } 1354 1355 /** Information about the Frame on the page. */ 1356 public static class Frame 1357 extends BaseType 1358 implements java.io.Serializable 1359 { 1360 /** For Object Serialization. java.io.Serializable */ 1361 protected static final long serialVersionUID = 1; 1362 1363 public boolean[] optionals() 1364 { return new boolean[] { false, true, false, true, false, true, false, false, true, false, true, true, false, false, false, }; } 1365 1366 /** Frame unique identifier. */ 1367 public final String id; 1368 1369 /** 1370 * Parent frame identifier. 1371 * <BR /><B CLASS=Opt>OPTIONAL</B> 1372 */ 1373 public final String parentId; 1374 1375 /** Identifier of the loader associated with this frame. */ 1376 public final String loaderId; 1377 1378 /** 1379 * Frame's name as specified in the tag. 1380 * <BR /><B CLASS=Opt>OPTIONAL</B> 1381 */ 1382 public final String name; 1383 1384 /** Frame document's URL without fragment. */ 1385 public final String url; 1386 1387 /** 1388 * Frame document's URL fragment including the '#'. 1389 * <BR /><B CLASS=Opt>OPTIONAL</B> 1390 <B CLASS=Exp>EXPERIMENTAL</B> 1391 */ 1392 public final String urlFragment; 1393 1394 /** 1395 * Frame document's registered domain, taking the public suffixes list into account. 1396 * Extracted from the Frame's url. 1397 * Example URLs: http://www.google.com/file.html -> "google.com" 1398 * http://a.b.co.uk/file.html -> "b.co.uk" 1399 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1400 */ 1401 public final String domainAndRegistry; 1402 1403 /** Frame document's security origin. */ 1404 public final String securityOrigin; 1405 1406 /** 1407 * Additional details about the frame document's security origin. 1408 * <BR /><B CLASS=Opt>OPTIONAL</B> 1409 <B CLASS=Exp>EXPERIMENTAL</B> 1410 */ 1411 public final Page.SecurityOriginDetails securityOriginDetails; 1412 1413 /** Frame document's mimeType as determined by the browser. */ 1414 public final String mimeType; 1415 1416 /** 1417 * 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. 1418 * <BR /><B CLASS=Opt>OPTIONAL</B> 1419 <B CLASS=Exp>EXPERIMENTAL</B> 1420 */ 1421 public final String unreachableUrl; 1422 1423 /** 1424 * Indicates whether this frame was tagged as an ad and why. 1425 * <BR /><B CLASS=Opt>OPTIONAL</B> 1426 <B CLASS=Exp>EXPERIMENTAL</B> 1427 */ 1428 public final Page.AdFrameStatus adFrameStatus; 1429 1430 /** 1431 * Indicates whether the main document is a secure context and explains why that is the case. 1432 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1433 */ 1434 public final String secureContextType; 1435 1436 /** 1437 * Indicates whether this is a cross origin isolated context. 1438 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1439 */ 1440 public final String crossOriginIsolatedContextType; 1441 1442 /** 1443 * Indicated which gated APIs / features are available. 1444 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1445 */ 1446 public final String[] gatedAPIFeatures; 1447 1448 /** 1449 * Constructor 1450 * 1451 * @param id Frame unique identifier. 1452 * 1453 * @param parentId Parent frame identifier. 1454 * <BR /><B CLASS=Opt>OPTIONAL</B> 1455 * 1456 * @param loaderId Identifier of the loader associated with this frame. 1457 * 1458 * @param name Frame's name as specified in the tag. 1459 * <BR /><B CLASS=Opt>OPTIONAL</B> 1460 * 1461 * @param url Frame document's URL without fragment. 1462 * 1463 * @param urlFragment Frame document's URL fragment including the '#'. 1464 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 1465 * 1466 * @param domainAndRegistry 1467 * Frame document's registered domain, taking the public suffixes list into account. 1468 * Extracted from the Frame's url. 1469 * Example URLs: http://www.google.com/file.html -> "google.com" 1470 * http://a.b.co.uk/file.html -> "b.co.uk" 1471 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1472 * 1473 * @param securityOrigin Frame document's security origin. 1474 * 1475 * @param securityOriginDetails Additional details about the frame document's security origin. 1476 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 1477 * 1478 * @param mimeType Frame document's mimeType as determined by the browser. 1479 * 1480 * @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. 1481 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 1482 * 1483 * @param adFrameStatus Indicates whether this frame was tagged as an ad and why. 1484 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 1485 * 1486 * @param secureContextType Indicates whether the main document is a secure context and explains why that is the case. 1487 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1488 * 1489 * @param crossOriginIsolatedContextType Indicates whether this is a cross origin isolated context. 1490 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1491 * 1492 * @param gatedAPIFeatures Indicated which gated APIs / features are available. 1493 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1494 */ 1495 public Frame( 1496 String id, String parentId, String loaderId, String name, String url, 1497 String urlFragment, String domainAndRegistry, String securityOrigin, 1498 Page.SecurityOriginDetails securityOriginDetails, String mimeType, 1499 String unreachableUrl, Page.AdFrameStatus adFrameStatus, String secureContextType, 1500 String crossOriginIsolatedContextType, String[] gatedAPIFeatures 1501 ) 1502 { 1503 // Exception-Check(s) to ensure that if any parameters which are not declared as 1504 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1505 1506 if (id == null) THROWS.throwNPE("id"); 1507 if (loaderId == null) THROWS.throwNPE("loaderId"); 1508 if (url == null) THROWS.throwNPE("url"); 1509 if (domainAndRegistry == null) THROWS.throwNPE("domainAndRegistry"); 1510 if (securityOrigin == null) THROWS.throwNPE("securityOrigin"); 1511 if (mimeType == null) THROWS.throwNPE("mimeType"); 1512 if (secureContextType == null) THROWS.throwNPE("secureContextType"); 1513 if (crossOriginIsolatedContextType == null) THROWS.throwNPE("crossOriginIsolatedContextType"); 1514 if (gatedAPIFeatures == null) THROWS.throwNPE("gatedAPIFeatures"); 1515 1516 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1517 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1518 1519 THROWS.checkIAE("secureContextType", secureContextType, "Page.SecureContextType", Page.SecureContextType); 1520 THROWS.checkIAE("crossOriginIsolatedContextType", crossOriginIsolatedContextType, "Page.CrossOriginIsolatedContextType", Page.CrossOriginIsolatedContextType); 1521 1522 this.id = id; 1523 this.parentId = parentId; 1524 this.loaderId = loaderId; 1525 this.name = name; 1526 this.url = url; 1527 this.urlFragment = urlFragment; 1528 this.domainAndRegistry = domainAndRegistry; 1529 this.securityOrigin = securityOrigin; 1530 this.securityOriginDetails = securityOriginDetails; 1531 this.mimeType = mimeType; 1532 this.unreachableUrl = unreachableUrl; 1533 this.adFrameStatus = adFrameStatus; 1534 this.secureContextType = secureContextType; 1535 this.crossOriginIsolatedContextType = crossOriginIsolatedContextType; 1536 this.gatedAPIFeatures = gatedAPIFeatures; 1537 } 1538 1539 /** 1540 * JSON Object Constructor 1541 * @param jo A Json-Object having data about an instance of {@code 'Frame'}. 1542 */ 1543 public Frame (JsonObject jo) 1544 { 1545 this.id = ReadJSON.getString(jo, "id", false, true); 1546 this.parentId = ReadJSON.getString(jo, "parentId", true, false); 1547 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 1548 this.name = ReadJSON.getString(jo, "name", true, false); 1549 this.url = ReadJSON.getString(jo, "url", false, true); 1550 this.urlFragment = ReadJSON.getString(jo, "urlFragment", true, false); 1551 this.domainAndRegistry = ReadJSON.getString(jo, "domainAndRegistry", false, true); 1552 this.securityOrigin = ReadJSON.getString(jo, "securityOrigin", false, true); 1553 this.securityOriginDetails = ReadJSON.getObject(jo, "securityOriginDetails", Page.SecurityOriginDetails.class, true, false); 1554 this.mimeType = ReadJSON.getString(jo, "mimeType", false, true); 1555 this.unreachableUrl = ReadJSON.getString(jo, "unreachableUrl", true, false); 1556 this.adFrameStatus = ReadJSON.getObject(jo, "adFrameStatus", Page.AdFrameStatus.class, true, false); 1557 this.secureContextType = ReadJSON.getString(jo, "secureContextType", false, true); 1558 this.crossOriginIsolatedContextType = ReadJSON.getString(jo, "crossOriginIsolatedContextType", false, true); 1559 this.gatedAPIFeatures = (jo.getJsonArray("gatedAPIFeatures") == null) 1560 ? null 1561 : RJArrIntoStream.strArr(jo.getJsonArray("gatedAPIFeatures"), null, 0).toArray(String[]::new); 1562 1563 } 1564 1565 1566 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1567 public boolean equals(Object other) 1568 { 1569 if (this == other) return true; 1570 if (other == null) return false; 1571 if (other.getClass() != this.getClass()) return false; 1572 1573 Frame o = (Frame) other; 1574 1575 return 1576 Objects.equals(this.id, o.id) 1577 && Objects.equals(this.parentId, o.parentId) 1578 && Objects.equals(this.loaderId, o.loaderId) 1579 && Objects.equals(this.name, o.name) 1580 && Objects.equals(this.url, o.url) 1581 && Objects.equals(this.urlFragment, o.urlFragment) 1582 && Objects.equals(this.domainAndRegistry, o.domainAndRegistry) 1583 && Objects.equals(this.securityOrigin, o.securityOrigin) 1584 && Objects.equals(this.securityOriginDetails, o.securityOriginDetails) 1585 && Objects.equals(this.mimeType, o.mimeType) 1586 && Objects.equals(this.unreachableUrl, o.unreachableUrl) 1587 && Objects.equals(this.adFrameStatus, o.adFrameStatus) 1588 && Objects.equals(this.secureContextType, o.secureContextType) 1589 && Objects.equals(this.crossOriginIsolatedContextType, o.crossOriginIsolatedContextType) 1590 && Arrays.deepEquals(this.gatedAPIFeatures, o.gatedAPIFeatures); 1591 } 1592 1593 /** Generates a Hash-Code for {@code 'this'} instance */ 1594 public int hashCode() 1595 { 1596 return 1597 Objects.hashCode(this.id) 1598 + Objects.hashCode(this.parentId) 1599 + Objects.hashCode(this.loaderId) 1600 + Objects.hashCode(this.name) 1601 + Objects.hashCode(this.url) 1602 + Objects.hashCode(this.urlFragment) 1603 + Objects.hashCode(this.domainAndRegistry) 1604 + Objects.hashCode(this.securityOrigin) 1605 + this.securityOriginDetails.hashCode() 1606 + Objects.hashCode(this.mimeType) 1607 + Objects.hashCode(this.unreachableUrl) 1608 + this.adFrameStatus.hashCode() 1609 + Objects.hashCode(this.secureContextType) 1610 + Objects.hashCode(this.crossOriginIsolatedContextType) 1611 + Arrays.deepHashCode(this.gatedAPIFeatures); 1612 } 1613 } 1614 1615 /** 1616 * Information about the Resource on the page. 1617 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1618 */ 1619 public static class FrameResource 1620 extends BaseType 1621 implements java.io.Serializable 1622 { 1623 /** For Object Serialization. java.io.Serializable */ 1624 protected static final long serialVersionUID = 1; 1625 1626 public boolean[] optionals() 1627 { return new boolean[] { false, false, false, true, true, true, true, }; } 1628 1629 /** Resource URL. */ 1630 public final String url; 1631 1632 /** Type of this resource. */ 1633 public final String type; 1634 1635 /** Resource mimeType as determined by the browser. */ 1636 public final String mimeType; 1637 1638 /** 1639 * last-modified timestamp as reported by server. 1640 * <BR /><B CLASS=Opt>OPTIONAL</B> 1641 */ 1642 public final Number lastModified; 1643 1644 /** 1645 * Resource content size. 1646 * <BR /><B CLASS=Opt>OPTIONAL</B> 1647 */ 1648 public final Number contentSize; 1649 1650 /** 1651 * True if the resource failed to load. 1652 * <BR /><B CLASS=Opt>OPTIONAL</B> 1653 */ 1654 public final Boolean failed; 1655 1656 /** 1657 * True if the resource was canceled during loading. 1658 * <BR /><B CLASS=Opt>OPTIONAL</B> 1659 */ 1660 public final Boolean canceled; 1661 1662 /** 1663 * Constructor 1664 * 1665 * @param url Resource URL. 1666 * 1667 * @param type Type of this resource. 1668 * 1669 * @param mimeType Resource mimeType as determined by the browser. 1670 * 1671 * @param lastModified last-modified timestamp as reported by server. 1672 * <BR /><B CLASS=Opt>OPTIONAL</B> 1673 * 1674 * @param contentSize Resource content size. 1675 * <BR /><B CLASS=Opt>OPTIONAL</B> 1676 * 1677 * @param failed True if the resource failed to load. 1678 * <BR /><B CLASS=Opt>OPTIONAL</B> 1679 * 1680 * @param canceled True if the resource was canceled during loading. 1681 * <BR /><B CLASS=Opt>OPTIONAL</B> 1682 */ 1683 public FrameResource( 1684 String url, String type, String mimeType, Number lastModified, Number contentSize, 1685 Boolean failed, Boolean canceled 1686 ) 1687 { 1688 // Exception-Check(s) to ensure that if any parameters which are not declared as 1689 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1690 1691 if (url == null) THROWS.throwNPE("url"); 1692 if (type == null) THROWS.throwNPE("type"); 1693 if (mimeType == null) THROWS.throwNPE("mimeType"); 1694 1695 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1696 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1697 1698 THROWS.checkIAE("type", type, "Network.ResourceType", Network.ResourceType); 1699 1700 this.url = url; 1701 this.type = type; 1702 this.mimeType = mimeType; 1703 this.lastModified = lastModified; 1704 this.contentSize = contentSize; 1705 this.failed = failed; 1706 this.canceled = canceled; 1707 } 1708 1709 /** 1710 * JSON Object Constructor 1711 * @param jo A Json-Object having data about an instance of {@code 'FrameResource'}. 1712 */ 1713 public FrameResource (JsonObject jo) 1714 { 1715 this.url = ReadJSON.getString(jo, "url", false, true); 1716 this.type = ReadJSON.getString(jo, "type", false, true); 1717 this.mimeType = ReadJSON.getString(jo, "mimeType", false, true); 1718 this.lastModified = ReadNumberJSON.get(jo, "lastModified", true, false); 1719 this.contentSize = ReadNumberJSON.get(jo, "contentSize", true, false); 1720 this.failed = ReadBoxedJSON.getBoolean(jo, "failed", true); 1721 this.canceled = ReadBoxedJSON.getBoolean(jo, "canceled", true); 1722 } 1723 1724 1725 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1726 public boolean equals(Object other) 1727 { 1728 if (this == other) return true; 1729 if (other == null) return false; 1730 if (other.getClass() != this.getClass()) return false; 1731 1732 FrameResource o = (FrameResource) other; 1733 1734 return 1735 Objects.equals(this.url, o.url) 1736 && Objects.equals(this.type, o.type) 1737 && Objects.equals(this.mimeType, o.mimeType) 1738 && Objects.equals(this.lastModified, o.lastModified) 1739 && Objects.equals(this.contentSize, o.contentSize) 1740 && Objects.equals(this.failed, o.failed) 1741 && Objects.equals(this.canceled, o.canceled); 1742 } 1743 1744 /** Generates a Hash-Code for {@code 'this'} instance */ 1745 public int hashCode() 1746 { 1747 return 1748 Objects.hashCode(this.url) 1749 + Objects.hashCode(this.type) 1750 + Objects.hashCode(this.mimeType) 1751 + Objects.hashCode(this.lastModified) 1752 + Objects.hashCode(this.contentSize) 1753 + Objects.hashCode(this.failed) 1754 + Objects.hashCode(this.canceled); 1755 } 1756 } 1757 1758 /** 1759 * Information about the Frame hierarchy along with their cached resources. 1760 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1761 */ 1762 public static class FrameResourceTree 1763 extends BaseType 1764 implements java.io.Serializable 1765 { 1766 /** For Object Serialization. java.io.Serializable */ 1767 protected static final long serialVersionUID = 1; 1768 1769 public boolean[] optionals() 1770 { return new boolean[] { false, true, false, }; } 1771 1772 /** Frame information for this tree item. */ 1773 public final Page.Frame frame; 1774 1775 /** 1776 * Child frames. 1777 * <BR /><B CLASS=Opt>OPTIONAL</B> 1778 */ 1779 public final Page.FrameResourceTree[] childFrames; 1780 1781 /** Information about frame resources. */ 1782 public final Page.FrameResource[] resources; 1783 1784 /** 1785 * Constructor 1786 * 1787 * @param frame Frame information for this tree item. 1788 * 1789 * @param childFrames Child frames. 1790 * <BR /><B CLASS=Opt>OPTIONAL</B> 1791 * 1792 * @param resources Information about frame resources. 1793 */ 1794 public FrameResourceTree 1795 (Page.Frame frame, Page.FrameResourceTree[] childFrames, Page.FrameResource[] resources) 1796 { 1797 // Exception-Check(s) to ensure that if any parameters which are not declared as 1798 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1799 1800 if (frame == null) THROWS.throwNPE("frame"); 1801 if (resources == null) THROWS.throwNPE("resources"); 1802 1803 this.frame = frame; 1804 this.childFrames = childFrames; 1805 this.resources = resources; 1806 } 1807 1808 /** 1809 * JSON Object Constructor 1810 * @param jo A Json-Object having data about an instance of {@code 'FrameResourceTree'}. 1811 */ 1812 public FrameResourceTree (JsonObject jo) 1813 { 1814 this.frame = ReadJSON.getObject(jo, "frame", Page.Frame.class, false, true); 1815 this.childFrames = (jo.getJsonArray("childFrames") == null) 1816 ? null 1817 : RJArrIntoStream.objArr(jo.getJsonArray("childFrames"), null, 0, Page.FrameResourceTree.class).toArray(Page.FrameResourceTree[]::new); 1818 1819 this.resources = (jo.getJsonArray("resources") == null) 1820 ? null 1821 : RJArrIntoStream.objArr(jo.getJsonArray("resources"), null, 0, Page.FrameResource.class).toArray(Page.FrameResource[]::new); 1822 1823 } 1824 1825 1826 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1827 public boolean equals(Object other) 1828 { 1829 if (this == other) return true; 1830 if (other == null) return false; 1831 if (other.getClass() != this.getClass()) return false; 1832 1833 FrameResourceTree o = (FrameResourceTree) other; 1834 1835 return 1836 Objects.equals(this.frame, o.frame) 1837 && Arrays.deepEquals(this.childFrames, o.childFrames) 1838 && Arrays.deepEquals(this.resources, o.resources); 1839 } 1840 1841 /** Generates a Hash-Code for {@code 'this'} instance */ 1842 public int hashCode() 1843 { 1844 return 1845 this.frame.hashCode() 1846 + Arrays.deepHashCode(this.childFrames) 1847 + Arrays.deepHashCode(this.resources); 1848 } 1849 } 1850 1851 /** Information about the Frame hierarchy. */ 1852 public static class FrameTree 1853 extends BaseType 1854 implements java.io.Serializable 1855 { 1856 /** For Object Serialization. java.io.Serializable */ 1857 protected static final long serialVersionUID = 1; 1858 1859 public boolean[] optionals() 1860 { return new boolean[] { false, true, }; } 1861 1862 /** Frame information for this tree item. */ 1863 public final Page.Frame frame; 1864 1865 /** 1866 * Child frames. 1867 * <BR /><B CLASS=Opt>OPTIONAL</B> 1868 */ 1869 public final Page.FrameTree[] childFrames; 1870 1871 /** 1872 * Constructor 1873 * 1874 * @param frame Frame information for this tree item. 1875 * 1876 * @param childFrames Child frames. 1877 * <BR /><B CLASS=Opt>OPTIONAL</B> 1878 */ 1879 public FrameTree(Page.Frame frame, Page.FrameTree[] childFrames) 1880 { 1881 // Exception-Check(s) to ensure that if any parameters which are not declared as 1882 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1883 1884 if (frame == null) THROWS.throwNPE("frame"); 1885 1886 this.frame = frame; 1887 this.childFrames = childFrames; 1888 } 1889 1890 /** 1891 * JSON Object Constructor 1892 * @param jo A Json-Object having data about an instance of {@code 'FrameTree'}. 1893 */ 1894 public FrameTree (JsonObject jo) 1895 { 1896 this.frame = ReadJSON.getObject(jo, "frame", Page.Frame.class, false, true); 1897 this.childFrames = (jo.getJsonArray("childFrames") == null) 1898 ? null 1899 : RJArrIntoStream.objArr(jo.getJsonArray("childFrames"), null, 0, Page.FrameTree.class).toArray(Page.FrameTree[]::new); 1900 1901 } 1902 1903 1904 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1905 public boolean equals(Object other) 1906 { 1907 if (this == other) return true; 1908 if (other == null) return false; 1909 if (other.getClass() != this.getClass()) return false; 1910 1911 FrameTree o = (FrameTree) other; 1912 1913 return 1914 Objects.equals(this.frame, o.frame) 1915 && Arrays.deepEquals(this.childFrames, o.childFrames); 1916 } 1917 1918 /** Generates a Hash-Code for {@code 'this'} instance */ 1919 public int hashCode() 1920 { 1921 return 1922 this.frame.hashCode() 1923 + Arrays.deepHashCode(this.childFrames); 1924 } 1925 } 1926 1927 /** Navigation history entry. */ 1928 public static class NavigationEntry 1929 extends BaseType 1930 implements java.io.Serializable 1931 { 1932 /** For Object Serialization. java.io.Serializable */ 1933 protected static final long serialVersionUID = 1; 1934 1935 public boolean[] optionals() 1936 { return new boolean[] { false, false, false, false, false, }; } 1937 1938 /** Unique id of the navigation history entry. */ 1939 public final int id; 1940 1941 /** URL of the navigation history entry. */ 1942 public final String url; 1943 1944 /** URL that the user typed in the url bar. */ 1945 public final String userTypedURL; 1946 1947 /** Title of the navigation history entry. */ 1948 public final String title; 1949 1950 /** Transition type. */ 1951 public final String transitionType; 1952 1953 /** 1954 * Constructor 1955 * 1956 * @param id Unique id of the navigation history entry. 1957 * 1958 * @param url URL of the navigation history entry. 1959 * 1960 * @param userTypedURL URL that the user typed in the url bar. 1961 * 1962 * @param title Title of the navigation history entry. 1963 * 1964 * @param transitionType Transition type. 1965 */ 1966 public NavigationEntry 1967 (int id, String url, String userTypedURL, String title, String transitionType) 1968 { 1969 // Exception-Check(s) to ensure that if any parameters which are not declared as 1970 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1971 1972 if (url == null) THROWS.throwNPE("url"); 1973 if (userTypedURL == null) THROWS.throwNPE("userTypedURL"); 1974 if (title == null) THROWS.throwNPE("title"); 1975 if (transitionType == null) THROWS.throwNPE("transitionType"); 1976 1977 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1978 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1979 1980 THROWS.checkIAE("transitionType", transitionType, "Page.TransitionType", Page.TransitionType); 1981 1982 this.id = id; 1983 this.url = url; 1984 this.userTypedURL = userTypedURL; 1985 this.title = title; 1986 this.transitionType = transitionType; 1987 } 1988 1989 /** 1990 * JSON Object Constructor 1991 * @param jo A Json-Object having data about an instance of {@code 'NavigationEntry'}. 1992 */ 1993 public NavigationEntry (JsonObject jo) 1994 { 1995 this.id = ReadPrimJSON.getInt(jo, "id"); 1996 this.url = ReadJSON.getString(jo, "url", false, true); 1997 this.userTypedURL = ReadJSON.getString(jo, "userTypedURL", false, true); 1998 this.title = ReadJSON.getString(jo, "title", false, true); 1999 this.transitionType = ReadJSON.getString(jo, "transitionType", false, true); 2000 } 2001 2002 2003 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2004 public boolean equals(Object other) 2005 { 2006 if (this == other) return true; 2007 if (other == null) return false; 2008 if (other.getClass() != this.getClass()) return false; 2009 2010 NavigationEntry o = (NavigationEntry) other; 2011 2012 return 2013 (this.id == o.id) 2014 && Objects.equals(this.url, o.url) 2015 && Objects.equals(this.userTypedURL, o.userTypedURL) 2016 && Objects.equals(this.title, o.title) 2017 && Objects.equals(this.transitionType, o.transitionType); 2018 } 2019 2020 /** Generates a Hash-Code for {@code 'this'} instance */ 2021 public int hashCode() 2022 { 2023 return 2024 this.id 2025 + Objects.hashCode(this.url) 2026 + Objects.hashCode(this.userTypedURL) 2027 + Objects.hashCode(this.title) 2028 + Objects.hashCode(this.transitionType); 2029 } 2030 } 2031 2032 /** 2033 * Screencast frame metadata. 2034 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2035 */ 2036 public static class ScreencastFrameMetadata 2037 extends BaseType 2038 implements java.io.Serializable 2039 { 2040 /** For Object Serialization. java.io.Serializable */ 2041 protected static final long serialVersionUID = 1; 2042 2043 public boolean[] optionals() 2044 { return new boolean[] { false, false, false, false, false, false, true, }; } 2045 2046 /** Top offset in DIP. */ 2047 public final Number offsetTop; 2048 2049 /** Page scale factor. */ 2050 public final Number pageScaleFactor; 2051 2052 /** Device screen width in DIP. */ 2053 public final Number deviceWidth; 2054 2055 /** Device screen height in DIP. */ 2056 public final Number deviceHeight; 2057 2058 /** Position of horizontal scroll in CSS pixels. */ 2059 public final Number scrollOffsetX; 2060 2061 /** Position of vertical scroll in CSS pixels. */ 2062 public final Number scrollOffsetY; 2063 2064 /** 2065 * Frame swap timestamp. 2066 * <BR /><B CLASS=Opt>OPTIONAL</B> 2067 */ 2068 public final Number timestamp; 2069 2070 /** 2071 * Constructor 2072 * 2073 * @param offsetTop Top offset in DIP. 2074 * 2075 * @param pageScaleFactor Page scale factor. 2076 * 2077 * @param deviceWidth Device screen width in DIP. 2078 * 2079 * @param deviceHeight Device screen height in DIP. 2080 * 2081 * @param scrollOffsetX Position of horizontal scroll in CSS pixels. 2082 * 2083 * @param scrollOffsetY Position of vertical scroll in CSS pixels. 2084 * 2085 * @param timestamp Frame swap timestamp. 2086 * <BR /><B CLASS=Opt>OPTIONAL</B> 2087 */ 2088 public ScreencastFrameMetadata( 2089 Number offsetTop, Number pageScaleFactor, Number deviceWidth, Number deviceHeight, 2090 Number scrollOffsetX, Number scrollOffsetY, Number timestamp 2091 ) 2092 { 2093 // Exception-Check(s) to ensure that if any parameters which are not declared as 2094 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2095 2096 if (offsetTop == null) THROWS.throwNPE("offsetTop"); 2097 if (pageScaleFactor == null) THROWS.throwNPE("pageScaleFactor"); 2098 if (deviceWidth == null) THROWS.throwNPE("deviceWidth"); 2099 if (deviceHeight == null) THROWS.throwNPE("deviceHeight"); 2100 if (scrollOffsetX == null) THROWS.throwNPE("scrollOffsetX"); 2101 if (scrollOffsetY == null) THROWS.throwNPE("scrollOffsetY"); 2102 2103 this.offsetTop = offsetTop; 2104 this.pageScaleFactor = pageScaleFactor; 2105 this.deviceWidth = deviceWidth; 2106 this.deviceHeight = deviceHeight; 2107 this.scrollOffsetX = scrollOffsetX; 2108 this.scrollOffsetY = scrollOffsetY; 2109 this.timestamp = timestamp; 2110 } 2111 2112 /** 2113 * JSON Object Constructor 2114 * @param jo A Json-Object having data about an instance of {@code 'ScreencastFrameMetadata'}. 2115 */ 2116 public ScreencastFrameMetadata (JsonObject jo) 2117 { 2118 this.offsetTop = ReadNumberJSON.get(jo, "offsetTop", false, true); 2119 this.pageScaleFactor = ReadNumberJSON.get(jo, "pageScaleFactor", false, true); 2120 this.deviceWidth = ReadNumberJSON.get(jo, "deviceWidth", false, true); 2121 this.deviceHeight = ReadNumberJSON.get(jo, "deviceHeight", false, true); 2122 this.scrollOffsetX = ReadNumberJSON.get(jo, "scrollOffsetX", false, true); 2123 this.scrollOffsetY = ReadNumberJSON.get(jo, "scrollOffsetY", false, true); 2124 this.timestamp = ReadNumberJSON.get(jo, "timestamp", true, false); 2125 } 2126 2127 2128 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2129 public boolean equals(Object other) 2130 { 2131 if (this == other) return true; 2132 if (other == null) return false; 2133 if (other.getClass() != this.getClass()) return false; 2134 2135 ScreencastFrameMetadata o = (ScreencastFrameMetadata) other; 2136 2137 return 2138 Objects.equals(this.offsetTop, o.offsetTop) 2139 && Objects.equals(this.pageScaleFactor, o.pageScaleFactor) 2140 && Objects.equals(this.deviceWidth, o.deviceWidth) 2141 && Objects.equals(this.deviceHeight, o.deviceHeight) 2142 && Objects.equals(this.scrollOffsetX, o.scrollOffsetX) 2143 && Objects.equals(this.scrollOffsetY, o.scrollOffsetY) 2144 && Objects.equals(this.timestamp, o.timestamp); 2145 } 2146 2147 /** Generates a Hash-Code for {@code 'this'} instance */ 2148 public int hashCode() 2149 { 2150 return 2151 Objects.hashCode(this.offsetTop) 2152 + Objects.hashCode(this.pageScaleFactor) 2153 + Objects.hashCode(this.deviceWidth) 2154 + Objects.hashCode(this.deviceHeight) 2155 + Objects.hashCode(this.scrollOffsetX) 2156 + Objects.hashCode(this.scrollOffsetY) 2157 + Objects.hashCode(this.timestamp); 2158 } 2159 } 2160 2161 /** Error while paring app manifest. */ 2162 public static class AppManifestError 2163 extends BaseType 2164 implements java.io.Serializable 2165 { 2166 /** For Object Serialization. java.io.Serializable */ 2167 protected static final long serialVersionUID = 1; 2168 2169 public boolean[] optionals() 2170 { return new boolean[] { false, false, false, false, }; } 2171 2172 /** Error message. */ 2173 public final String message; 2174 2175 /** If critical, this is a non-recoverable parse error. */ 2176 public final int critical; 2177 2178 /** Error line. */ 2179 public final int line; 2180 2181 /** Error column. */ 2182 public final int column; 2183 2184 /** 2185 * Constructor 2186 * 2187 * @param message Error message. 2188 * 2189 * @param critical If critical, this is a non-recoverable parse error. 2190 * 2191 * @param line Error line. 2192 * 2193 * @param column Error column. 2194 */ 2195 public AppManifestError(String message, int critical, int line, int column) 2196 { 2197 // Exception-Check(s) to ensure that if any parameters which are not declared as 2198 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2199 2200 if (message == null) THROWS.throwNPE("message"); 2201 2202 this.message = message; 2203 this.critical = critical; 2204 this.line = line; 2205 this.column = column; 2206 } 2207 2208 /** 2209 * JSON Object Constructor 2210 * @param jo A Json-Object having data about an instance of {@code 'AppManifestError'}. 2211 */ 2212 public AppManifestError (JsonObject jo) 2213 { 2214 this.message = ReadJSON.getString(jo, "message", false, true); 2215 this.critical = ReadPrimJSON.getInt(jo, "critical"); 2216 this.line = ReadPrimJSON.getInt(jo, "line"); 2217 this.column = ReadPrimJSON.getInt(jo, "column"); 2218 } 2219 2220 2221 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2222 public boolean equals(Object other) 2223 { 2224 if (this == other) return true; 2225 if (other == null) return false; 2226 if (other.getClass() != this.getClass()) return false; 2227 2228 AppManifestError o = (AppManifestError) other; 2229 2230 return 2231 Objects.equals(this.message, o.message) 2232 && (this.critical == o.critical) 2233 && (this.line == o.line) 2234 && (this.column == o.column); 2235 } 2236 2237 /** Generates a Hash-Code for {@code 'this'} instance */ 2238 public int hashCode() 2239 { 2240 return 2241 Objects.hashCode(this.message) 2242 + this.critical 2243 + this.line 2244 + this.column; 2245 } 2246 } 2247 2248 /** 2249 * Parsed app manifest properties. 2250 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2251 */ 2252 public static class AppManifestParsedProperties 2253 extends BaseType 2254 implements java.io.Serializable 2255 { 2256 /** For Object Serialization. java.io.Serializable */ 2257 protected static final long serialVersionUID = 1; 2258 2259 public boolean[] optionals() 2260 { return new boolean[] { false, }; } 2261 2262 /** Computed scope value */ 2263 public final String scope; 2264 2265 /** 2266 * Constructor 2267 * 2268 * @param scope Computed scope value 2269 */ 2270 public AppManifestParsedProperties(String scope) 2271 { 2272 // Exception-Check(s) to ensure that if any parameters which are not declared as 2273 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2274 2275 if (scope == null) THROWS.throwNPE("scope"); 2276 2277 this.scope = scope; 2278 } 2279 2280 /** 2281 * JSON Object Constructor 2282 * @param jo A Json-Object having data about an instance of {@code 'AppManifestParsedProperties'}. 2283 */ 2284 public AppManifestParsedProperties (JsonObject jo) 2285 { 2286 this.scope = ReadJSON.getString(jo, "scope", false, true); 2287 } 2288 2289 2290 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2291 public boolean equals(Object other) 2292 { 2293 if (this == other) return true; 2294 if (other == null) return false; 2295 if (other.getClass() != this.getClass()) return false; 2296 2297 AppManifestParsedProperties o = (AppManifestParsedProperties) other; 2298 2299 return 2300 Objects.equals(this.scope, o.scope); 2301 } 2302 2303 /** Generates a Hash-Code for {@code 'this'} instance */ 2304 public int hashCode() 2305 { 2306 return 2307 Objects.hashCode(this.scope); 2308 } 2309 } 2310 2311 /** Layout viewport position and dimensions. */ 2312 public static class LayoutViewport 2313 extends BaseType 2314 implements java.io.Serializable 2315 { 2316 /** For Object Serialization. java.io.Serializable */ 2317 protected static final long serialVersionUID = 1; 2318 2319 public boolean[] optionals() 2320 { return new boolean[] { false, false, false, false, }; } 2321 2322 /** Horizontal offset relative to the document (CSS pixels). */ 2323 public final int pageX; 2324 2325 /** Vertical offset relative to the document (CSS pixels). */ 2326 public final int pageY; 2327 2328 /** Width (CSS pixels), excludes scrollbar if present. */ 2329 public final int clientWidth; 2330 2331 /** Height (CSS pixels), excludes scrollbar if present. */ 2332 public final int clientHeight; 2333 2334 /** 2335 * Constructor 2336 * 2337 * @param pageX Horizontal offset relative to the document (CSS pixels). 2338 * 2339 * @param pageY Vertical offset relative to the document (CSS pixels). 2340 * 2341 * @param clientWidth Width (CSS pixels), excludes scrollbar if present. 2342 * 2343 * @param clientHeight Height (CSS pixels), excludes scrollbar if present. 2344 */ 2345 public LayoutViewport(int pageX, int pageY, int clientWidth, int clientHeight) 2346 { 2347 this.pageX = pageX; 2348 this.pageY = pageY; 2349 this.clientWidth = clientWidth; 2350 this.clientHeight = clientHeight; 2351 } 2352 2353 /** 2354 * JSON Object Constructor 2355 * @param jo A Json-Object having data about an instance of {@code 'LayoutViewport'}. 2356 */ 2357 public LayoutViewport (JsonObject jo) 2358 { 2359 this.pageX = ReadPrimJSON.getInt(jo, "pageX"); 2360 this.pageY = ReadPrimJSON.getInt(jo, "pageY"); 2361 this.clientWidth = ReadPrimJSON.getInt(jo, "clientWidth"); 2362 this.clientHeight = ReadPrimJSON.getInt(jo, "clientHeight"); 2363 } 2364 2365 2366 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2367 public boolean equals(Object other) 2368 { 2369 if (this == other) return true; 2370 if (other == null) return false; 2371 if (other.getClass() != this.getClass()) return false; 2372 2373 LayoutViewport o = (LayoutViewport) other; 2374 2375 return 2376 (this.pageX == o.pageX) 2377 && (this.pageY == o.pageY) 2378 && (this.clientWidth == o.clientWidth) 2379 && (this.clientHeight == o.clientHeight); 2380 } 2381 2382 /** Generates a Hash-Code for {@code 'this'} instance */ 2383 public int hashCode() 2384 { 2385 return 2386 this.pageX 2387 + this.pageY 2388 + this.clientWidth 2389 + this.clientHeight; 2390 } 2391 } 2392 2393 /** Visual viewport position, dimensions, and scale. */ 2394 public static class VisualViewport 2395 extends BaseType 2396 implements java.io.Serializable 2397 { 2398 /** For Object Serialization. java.io.Serializable */ 2399 protected static final long serialVersionUID = 1; 2400 2401 public boolean[] optionals() 2402 { return new boolean[] { false, false, false, false, false, false, false, true, }; } 2403 2404 /** Horizontal offset relative to the layout viewport (CSS pixels). */ 2405 public final Number offsetX; 2406 2407 /** Vertical offset relative to the layout viewport (CSS pixels). */ 2408 public final Number offsetY; 2409 2410 /** Horizontal offset relative to the document (CSS pixels). */ 2411 public final Number pageX; 2412 2413 /** Vertical offset relative to the document (CSS pixels). */ 2414 public final Number pageY; 2415 2416 /** Width (CSS pixels), excludes scrollbar if present. */ 2417 public final Number clientWidth; 2418 2419 /** Height (CSS pixels), excludes scrollbar if present. */ 2420 public final Number clientHeight; 2421 2422 /** Scale relative to the ideal viewport (size at width=device-width). */ 2423 public final Number scale; 2424 2425 /** 2426 * Page zoom factor (CSS to device independent pixels ratio). 2427 * <BR /><B CLASS=Opt>OPTIONAL</B> 2428 */ 2429 public final Number zoom; 2430 2431 /** 2432 * Constructor 2433 * 2434 * @param offsetX Horizontal offset relative to the layout viewport (CSS pixels). 2435 * 2436 * @param offsetY Vertical offset relative to the layout viewport (CSS pixels). 2437 * 2438 * @param pageX Horizontal offset relative to the document (CSS pixels). 2439 * 2440 * @param pageY Vertical offset relative to the document (CSS pixels). 2441 * 2442 * @param clientWidth Width (CSS pixels), excludes scrollbar if present. 2443 * 2444 * @param clientHeight Height (CSS pixels), excludes scrollbar if present. 2445 * 2446 * @param scale Scale relative to the ideal viewport (size at width=device-width). 2447 * 2448 * @param zoom Page zoom factor (CSS to device independent pixels ratio). 2449 * <BR /><B CLASS=Opt>OPTIONAL</B> 2450 */ 2451 public VisualViewport( 2452 Number offsetX, Number offsetY, Number pageX, Number pageY, Number clientWidth, 2453 Number clientHeight, Number scale, Number zoom 2454 ) 2455 { 2456 // Exception-Check(s) to ensure that if any parameters which are not declared as 2457 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2458 2459 if (offsetX == null) THROWS.throwNPE("offsetX"); 2460 if (offsetY == null) THROWS.throwNPE("offsetY"); 2461 if (pageX == null) THROWS.throwNPE("pageX"); 2462 if (pageY == null) THROWS.throwNPE("pageY"); 2463 if (clientWidth == null) THROWS.throwNPE("clientWidth"); 2464 if (clientHeight == null) THROWS.throwNPE("clientHeight"); 2465 if (scale == null) THROWS.throwNPE("scale"); 2466 2467 this.offsetX = offsetX; 2468 this.offsetY = offsetY; 2469 this.pageX = pageX; 2470 this.pageY = pageY; 2471 this.clientWidth = clientWidth; 2472 this.clientHeight = clientHeight; 2473 this.scale = scale; 2474 this.zoom = zoom; 2475 } 2476 2477 /** 2478 * JSON Object Constructor 2479 * @param jo A Json-Object having data about an instance of {@code 'VisualViewport'}. 2480 */ 2481 public VisualViewport (JsonObject jo) 2482 { 2483 this.offsetX = ReadNumberJSON.get(jo, "offsetX", false, true); 2484 this.offsetY = ReadNumberJSON.get(jo, "offsetY", false, true); 2485 this.pageX = ReadNumberJSON.get(jo, "pageX", false, true); 2486 this.pageY = ReadNumberJSON.get(jo, "pageY", false, true); 2487 this.clientWidth = ReadNumberJSON.get(jo, "clientWidth", false, true); 2488 this.clientHeight = ReadNumberJSON.get(jo, "clientHeight", false, true); 2489 this.scale = ReadNumberJSON.get(jo, "scale", false, true); 2490 this.zoom = ReadNumberJSON.get(jo, "zoom", true, false); 2491 } 2492 2493 2494 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2495 public boolean equals(Object other) 2496 { 2497 if (this == other) return true; 2498 if (other == null) return false; 2499 if (other.getClass() != this.getClass()) return false; 2500 2501 VisualViewport o = (VisualViewport) other; 2502 2503 return 2504 Objects.equals(this.offsetX, o.offsetX) 2505 && Objects.equals(this.offsetY, o.offsetY) 2506 && Objects.equals(this.pageX, o.pageX) 2507 && Objects.equals(this.pageY, o.pageY) 2508 && Objects.equals(this.clientWidth, o.clientWidth) 2509 && Objects.equals(this.clientHeight, o.clientHeight) 2510 && Objects.equals(this.scale, o.scale) 2511 && Objects.equals(this.zoom, o.zoom); 2512 } 2513 2514 /** Generates a Hash-Code for {@code 'this'} instance */ 2515 public int hashCode() 2516 { 2517 return 2518 Objects.hashCode(this.offsetX) 2519 + Objects.hashCode(this.offsetY) 2520 + Objects.hashCode(this.pageX) 2521 + Objects.hashCode(this.pageY) 2522 + Objects.hashCode(this.clientWidth) 2523 + Objects.hashCode(this.clientHeight) 2524 + Objects.hashCode(this.scale) 2525 + Objects.hashCode(this.zoom); 2526 } 2527 } 2528 2529 /** Viewport for capturing screenshot. */ 2530 public static class Viewport 2531 extends BaseType 2532 implements java.io.Serializable 2533 { 2534 /** For Object Serialization. java.io.Serializable */ 2535 protected static final long serialVersionUID = 1; 2536 2537 public boolean[] optionals() 2538 { return new boolean[] { false, false, false, false, false, }; } 2539 2540 /** X offset in device independent pixels (dip). */ 2541 public final Number x; 2542 2543 /** Y offset in device independent pixels (dip). */ 2544 public final Number y; 2545 2546 /** Rectangle width in device independent pixels (dip). */ 2547 public final Number width; 2548 2549 /** Rectangle height in device independent pixels (dip). */ 2550 public final Number height; 2551 2552 /** Page scale factor. */ 2553 public final Number scale; 2554 2555 /** 2556 * Constructor 2557 * 2558 * @param x X offset in device independent pixels (dip). 2559 * 2560 * @param y Y offset in device independent pixels (dip). 2561 * 2562 * @param width Rectangle width in device independent pixels (dip). 2563 * 2564 * @param height Rectangle height in device independent pixels (dip). 2565 * 2566 * @param scale Page scale factor. 2567 */ 2568 public Viewport(Number x, Number y, Number width, Number height, Number scale) 2569 { 2570 // Exception-Check(s) to ensure that if any parameters which are not declared as 2571 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2572 2573 if (x == null) THROWS.throwNPE("x"); 2574 if (y == null) THROWS.throwNPE("y"); 2575 if (width == null) THROWS.throwNPE("width"); 2576 if (height == null) THROWS.throwNPE("height"); 2577 if (scale == null) THROWS.throwNPE("scale"); 2578 2579 this.x = x; 2580 this.y = y; 2581 this.width = width; 2582 this.height = height; 2583 this.scale = scale; 2584 } 2585 2586 /** 2587 * JSON Object Constructor 2588 * @param jo A Json-Object having data about an instance of {@code 'Viewport'}. 2589 */ 2590 public Viewport (JsonObject jo) 2591 { 2592 this.x = ReadNumberJSON.get(jo, "x", false, true); 2593 this.y = ReadNumberJSON.get(jo, "y", false, true); 2594 this.width = ReadNumberJSON.get(jo, "width", false, true); 2595 this.height = ReadNumberJSON.get(jo, "height", false, true); 2596 this.scale = ReadNumberJSON.get(jo, "scale", false, true); 2597 } 2598 2599 2600 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2601 public boolean equals(Object other) 2602 { 2603 if (this == other) return true; 2604 if (other == null) return false; 2605 if (other.getClass() != this.getClass()) return false; 2606 2607 Viewport o = (Viewport) other; 2608 2609 return 2610 Objects.equals(this.x, o.x) 2611 && Objects.equals(this.y, o.y) 2612 && Objects.equals(this.width, o.width) 2613 && Objects.equals(this.height, o.height) 2614 && Objects.equals(this.scale, o.scale); 2615 } 2616 2617 /** Generates a Hash-Code for {@code 'this'} instance */ 2618 public int hashCode() 2619 { 2620 return 2621 Objects.hashCode(this.x) 2622 + Objects.hashCode(this.y) 2623 + Objects.hashCode(this.width) 2624 + Objects.hashCode(this.height) 2625 + Objects.hashCode(this.scale); 2626 } 2627 } 2628 2629 /** 2630 * Generic font families collection. 2631 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2632 */ 2633 public static class FontFamilies 2634 extends BaseType 2635 implements java.io.Serializable 2636 { 2637 /** For Object Serialization. java.io.Serializable */ 2638 protected static final long serialVersionUID = 1; 2639 2640 public boolean[] optionals() 2641 { return new boolean[] { true, true, true, true, true, true, true, }; } 2642 2643 /** 2644 * The standard font-family. 2645 * <BR /><B CLASS=Opt>OPTIONAL</B> 2646 */ 2647 public final String standard; 2648 2649 /** 2650 * The fixed font-family. 2651 * <BR /><B CLASS=Opt>OPTIONAL</B> 2652 */ 2653 public final String fixed; 2654 2655 /** 2656 * The serif font-family. 2657 * <BR /><B CLASS=Opt>OPTIONAL</B> 2658 */ 2659 public final String serif; 2660 2661 /** 2662 * The sansSerif font-family. 2663 * <BR /><B CLASS=Opt>OPTIONAL</B> 2664 */ 2665 public final String sansSerif; 2666 2667 /** 2668 * The cursive font-family. 2669 * <BR /><B CLASS=Opt>OPTIONAL</B> 2670 */ 2671 public final String cursive; 2672 2673 /** 2674 * The fantasy font-family. 2675 * <BR /><B CLASS=Opt>OPTIONAL</B> 2676 */ 2677 public final String fantasy; 2678 2679 /** 2680 * The math font-family. 2681 * <BR /><B CLASS=Opt>OPTIONAL</B> 2682 */ 2683 public final String math; 2684 2685 /** 2686 * Constructor 2687 * 2688 * @param standard The standard font-family. 2689 * <BR /><B CLASS=Opt>OPTIONAL</B> 2690 * 2691 * @param fixed The fixed font-family. 2692 * <BR /><B CLASS=Opt>OPTIONAL</B> 2693 * 2694 * @param serif The serif font-family. 2695 * <BR /><B CLASS=Opt>OPTIONAL</B> 2696 * 2697 * @param sansSerif The sansSerif font-family. 2698 * <BR /><B CLASS=Opt>OPTIONAL</B> 2699 * 2700 * @param cursive The cursive font-family. 2701 * <BR /><B CLASS=Opt>OPTIONAL</B> 2702 * 2703 * @param fantasy The fantasy font-family. 2704 * <BR /><B CLASS=Opt>OPTIONAL</B> 2705 * 2706 * @param math The math font-family. 2707 * <BR /><B CLASS=Opt>OPTIONAL</B> 2708 */ 2709 public FontFamilies( 2710 String standard, String fixed, String serif, String sansSerif, String cursive, 2711 String fantasy, String math 2712 ) 2713 { 2714 this.standard = standard; 2715 this.fixed = fixed; 2716 this.serif = serif; 2717 this.sansSerif = sansSerif; 2718 this.cursive = cursive; 2719 this.fantasy = fantasy; 2720 this.math = math; 2721 } 2722 2723 /** 2724 * JSON Object Constructor 2725 * @param jo A Json-Object having data about an instance of {@code 'FontFamilies'}. 2726 */ 2727 public FontFamilies (JsonObject jo) 2728 { 2729 this.standard = ReadJSON.getString(jo, "standard", true, false); 2730 this.fixed = ReadJSON.getString(jo, "fixed", true, false); 2731 this.serif = ReadJSON.getString(jo, "serif", true, false); 2732 this.sansSerif = ReadJSON.getString(jo, "sansSerif", true, false); 2733 this.cursive = ReadJSON.getString(jo, "cursive", true, false); 2734 this.fantasy = ReadJSON.getString(jo, "fantasy", true, false); 2735 this.math = ReadJSON.getString(jo, "math", true, false); 2736 } 2737 2738 2739 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2740 public boolean equals(Object other) 2741 { 2742 if (this == other) return true; 2743 if (other == null) return false; 2744 if (other.getClass() != this.getClass()) return false; 2745 2746 FontFamilies o = (FontFamilies) other; 2747 2748 return 2749 Objects.equals(this.standard, o.standard) 2750 && Objects.equals(this.fixed, o.fixed) 2751 && Objects.equals(this.serif, o.serif) 2752 && Objects.equals(this.sansSerif, o.sansSerif) 2753 && Objects.equals(this.cursive, o.cursive) 2754 && Objects.equals(this.fantasy, o.fantasy) 2755 && Objects.equals(this.math, o.math); 2756 } 2757 2758 /** Generates a Hash-Code for {@code 'this'} instance */ 2759 public int hashCode() 2760 { 2761 return 2762 Objects.hashCode(this.standard) 2763 + Objects.hashCode(this.fixed) 2764 + Objects.hashCode(this.serif) 2765 + Objects.hashCode(this.sansSerif) 2766 + Objects.hashCode(this.cursive) 2767 + Objects.hashCode(this.fantasy) 2768 + Objects.hashCode(this.math); 2769 } 2770 } 2771 2772 /** 2773 * Font families collection for a script. 2774 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2775 */ 2776 public static class ScriptFontFamilies 2777 extends BaseType 2778 implements java.io.Serializable 2779 { 2780 /** For Object Serialization. java.io.Serializable */ 2781 protected static final long serialVersionUID = 1; 2782 2783 public boolean[] optionals() 2784 { return new boolean[] { false, false, }; } 2785 2786 /** Name of the script which these font families are defined for. */ 2787 public final String script; 2788 2789 /** Generic font families collection for the script. */ 2790 public final Page.FontFamilies fontFamilies; 2791 2792 /** 2793 * Constructor 2794 * 2795 * @param script Name of the script which these font families are defined for. 2796 * 2797 * @param fontFamilies Generic font families collection for the script. 2798 */ 2799 public ScriptFontFamilies(String script, Page.FontFamilies fontFamilies) 2800 { 2801 // Exception-Check(s) to ensure that if any parameters which are not declared as 2802 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2803 2804 if (script == null) THROWS.throwNPE("script"); 2805 if (fontFamilies == null) THROWS.throwNPE("fontFamilies"); 2806 2807 this.script = script; 2808 this.fontFamilies = fontFamilies; 2809 } 2810 2811 /** 2812 * JSON Object Constructor 2813 * @param jo A Json-Object having data about an instance of {@code 'ScriptFontFamilies'}. 2814 */ 2815 public ScriptFontFamilies (JsonObject jo) 2816 { 2817 this.script = ReadJSON.getString(jo, "script", false, true); 2818 this.fontFamilies = ReadJSON.getObject(jo, "fontFamilies", Page.FontFamilies.class, false, true); 2819 } 2820 2821 2822 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2823 public boolean equals(Object other) 2824 { 2825 if (this == other) return true; 2826 if (other == null) return false; 2827 if (other.getClass() != this.getClass()) return false; 2828 2829 ScriptFontFamilies o = (ScriptFontFamilies) other; 2830 2831 return 2832 Objects.equals(this.script, o.script) 2833 && Objects.equals(this.fontFamilies, o.fontFamilies); 2834 } 2835 2836 /** Generates a Hash-Code for {@code 'this'} instance */ 2837 public int hashCode() 2838 { 2839 return 2840 Objects.hashCode(this.script) 2841 + this.fontFamilies.hashCode(); 2842 } 2843 } 2844 2845 /** 2846 * Default font sizes. 2847 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2848 */ 2849 public static class FontSizes 2850 extends BaseType 2851 implements java.io.Serializable 2852 { 2853 /** For Object Serialization. java.io.Serializable */ 2854 protected static final long serialVersionUID = 1; 2855 2856 public boolean[] optionals() 2857 { return new boolean[] { true, true, }; } 2858 2859 /** 2860 * Default standard font size. 2861 * <BR /><B CLASS=Opt>OPTIONAL</B> 2862 */ 2863 public final Integer standard; 2864 2865 /** 2866 * Default fixed font size. 2867 * <BR /><B CLASS=Opt>OPTIONAL</B> 2868 */ 2869 public final Integer fixed; 2870 2871 /** 2872 * Constructor 2873 * 2874 * @param standard Default standard font size. 2875 * <BR /><B CLASS=Opt>OPTIONAL</B> 2876 * 2877 * @param fixed Default fixed font size. 2878 * <BR /><B CLASS=Opt>OPTIONAL</B> 2879 */ 2880 public FontSizes(Integer standard, Integer fixed) 2881 { 2882 this.standard = standard; 2883 this.fixed = fixed; 2884 } 2885 2886 /** 2887 * JSON Object Constructor 2888 * @param jo A Json-Object having data about an instance of {@code 'FontSizes'}. 2889 */ 2890 public FontSizes (JsonObject jo) 2891 { 2892 this.standard = ReadBoxedJSON.getInteger(jo, "standard", true); 2893 this.fixed = ReadBoxedJSON.getInteger(jo, "fixed", true); 2894 } 2895 2896 2897 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2898 public boolean equals(Object other) 2899 { 2900 if (this == other) return true; 2901 if (other == null) return false; 2902 if (other.getClass() != this.getClass()) return false; 2903 2904 FontSizes o = (FontSizes) other; 2905 2906 return 2907 Objects.equals(this.standard, o.standard) 2908 && Objects.equals(this.fixed, o.fixed); 2909 } 2910 2911 /** Generates a Hash-Code for {@code 'this'} instance */ 2912 public int hashCode() 2913 { 2914 return 2915 Objects.hashCode(this.standard) 2916 + Objects.hashCode(this.fixed); 2917 } 2918 } 2919 2920 /** 2921 * <CODE>[No Description Provided by Google]</CODE> 2922 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2923 */ 2924 public static class InstallabilityErrorArgument 2925 extends BaseType 2926 implements java.io.Serializable 2927 { 2928 /** For Object Serialization. java.io.Serializable */ 2929 protected static final long serialVersionUID = 1; 2930 2931 public boolean[] optionals() 2932 { return new boolean[] { false, false, }; } 2933 2934 /** Argument name (e.g. name:'minimum-icon-size-in-pixels'). */ 2935 public final String name; 2936 2937 /** Argument value (e.g. value:'64'). */ 2938 public final String value; 2939 2940 /** 2941 * Constructor 2942 * 2943 * @param name Argument name (e.g. name:'minimum-icon-size-in-pixels'). 2944 * 2945 * @param value Argument value (e.g. value:'64'). 2946 */ 2947 public InstallabilityErrorArgument(String name, String value) 2948 { 2949 // Exception-Check(s) to ensure that if any parameters which are not declared as 2950 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2951 2952 if (name == null) THROWS.throwNPE("name"); 2953 if (value == null) THROWS.throwNPE("value"); 2954 2955 this.name = name; 2956 this.value = value; 2957 } 2958 2959 /** 2960 * JSON Object Constructor 2961 * @param jo A Json-Object having data about an instance of {@code 'InstallabilityErrorArgument'}. 2962 */ 2963 public InstallabilityErrorArgument (JsonObject jo) 2964 { 2965 this.name = ReadJSON.getString(jo, "name", false, true); 2966 this.value = ReadJSON.getString(jo, "value", false, true); 2967 } 2968 2969 2970 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2971 public boolean equals(Object other) 2972 { 2973 if (this == other) return true; 2974 if (other == null) return false; 2975 if (other.getClass() != this.getClass()) return false; 2976 2977 InstallabilityErrorArgument o = (InstallabilityErrorArgument) other; 2978 2979 return 2980 Objects.equals(this.name, o.name) 2981 && Objects.equals(this.value, o.value); 2982 } 2983 2984 /** Generates a Hash-Code for {@code 'this'} instance */ 2985 public int hashCode() 2986 { 2987 return 2988 Objects.hashCode(this.name) 2989 + Objects.hashCode(this.value); 2990 } 2991 } 2992 2993 /** 2994 * The installability error 2995 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2996 */ 2997 public static class InstallabilityError 2998 extends BaseType 2999 implements java.io.Serializable 3000 { 3001 /** For Object Serialization. java.io.Serializable */ 3002 protected static final long serialVersionUID = 1; 3003 3004 public boolean[] optionals() 3005 { return new boolean[] { false, false, }; } 3006 3007 /** The error id (e.g. 'manifest-missing-suitable-icon'). */ 3008 public final String errorId; 3009 3010 /** The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels', value:'64'}). */ 3011 public final Page.InstallabilityErrorArgument[] errorArguments; 3012 3013 /** 3014 * Constructor 3015 * 3016 * @param errorId The error id (e.g. 'manifest-missing-suitable-icon'). 3017 * 3018 * @param errorArguments The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels', value:'64'}). 3019 */ 3020 public InstallabilityError 3021 (String errorId, Page.InstallabilityErrorArgument[] errorArguments) 3022 { 3023 // Exception-Check(s) to ensure that if any parameters which are not declared as 3024 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3025 3026 if (errorId == null) THROWS.throwNPE("errorId"); 3027 if (errorArguments == null) THROWS.throwNPE("errorArguments"); 3028 3029 this.errorId = errorId; 3030 this.errorArguments = errorArguments; 3031 } 3032 3033 /** 3034 * JSON Object Constructor 3035 * @param jo A Json-Object having data about an instance of {@code 'InstallabilityError'}. 3036 */ 3037 public InstallabilityError (JsonObject jo) 3038 { 3039 this.errorId = ReadJSON.getString(jo, "errorId", false, true); 3040 this.errorArguments = (jo.getJsonArray("errorArguments") == null) 3041 ? null 3042 : RJArrIntoStream.objArr(jo.getJsonArray("errorArguments"), null, 0, Page.InstallabilityErrorArgument.class).toArray(Page.InstallabilityErrorArgument[]::new); 3043 3044 } 3045 3046 3047 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3048 public boolean equals(Object other) 3049 { 3050 if (this == other) return true; 3051 if (other == null) return false; 3052 if (other.getClass() != this.getClass()) return false; 3053 3054 InstallabilityError o = (InstallabilityError) other; 3055 3056 return 3057 Objects.equals(this.errorId, o.errorId) 3058 && Arrays.deepEquals(this.errorArguments, o.errorArguments); 3059 } 3060 3061 /** Generates a Hash-Code for {@code 'this'} instance */ 3062 public int hashCode() 3063 { 3064 return 3065 Objects.hashCode(this.errorId) 3066 + Arrays.deepHashCode(this.errorArguments); 3067 } 3068 } 3069 3070 /** 3071 * Per-script compilation cache parameters for {@code Page.produceCompilationCache} 3072 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3073 */ 3074 public static class CompilationCacheParams 3075 extends BaseType 3076 implements java.io.Serializable 3077 { 3078 /** For Object Serialization. java.io.Serializable */ 3079 protected static final long serialVersionUID = 1; 3080 3081 public boolean[] optionals() 3082 { return new boolean[] { false, true, }; } 3083 3084 /** The URL of the script to produce a compilation cache entry for. */ 3085 public final String url; 3086 3087 /** 3088 * A hint to the backend whether eager compilation is recommended. 3089 * (the actual compilation mode used is upon backend discretion). 3090 * <BR /><B CLASS=Opt>OPTIONAL</B> 3091 */ 3092 public final Boolean eager; 3093 3094 /** 3095 * Constructor 3096 * 3097 * @param url The URL of the script to produce a compilation cache entry for. 3098 * 3099 * @param eager 3100 * A hint to the backend whether eager compilation is recommended. 3101 * (the actual compilation mode used is upon backend discretion). 3102 * <BR /><B CLASS=Opt>OPTIONAL</B> 3103 */ 3104 public CompilationCacheParams(String url, Boolean eager) 3105 { 3106 // Exception-Check(s) to ensure that if any parameters which are not declared as 3107 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3108 3109 if (url == null) THROWS.throwNPE("url"); 3110 3111 this.url = url; 3112 this.eager = eager; 3113 } 3114 3115 /** 3116 * JSON Object Constructor 3117 * @param jo A Json-Object having data about an instance of {@code 'CompilationCacheParams'}. 3118 */ 3119 public CompilationCacheParams (JsonObject jo) 3120 { 3121 this.url = ReadJSON.getString(jo, "url", false, true); 3122 this.eager = ReadBoxedJSON.getBoolean(jo, "eager", true); 3123 } 3124 3125 3126 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3127 public boolean equals(Object other) 3128 { 3129 if (this == other) return true; 3130 if (other == null) return false; 3131 if (other.getClass() != this.getClass()) return false; 3132 3133 CompilationCacheParams o = (CompilationCacheParams) other; 3134 3135 return 3136 Objects.equals(this.url, o.url) 3137 && Objects.equals(this.eager, o.eager); 3138 } 3139 3140 /** Generates a Hash-Code for {@code 'this'} instance */ 3141 public int hashCode() 3142 { 3143 return 3144 Objects.hashCode(this.url) 3145 + Objects.hashCode(this.eager); 3146 } 3147 } 3148 3149 /** 3150 * <CODE>[No Description Provided by Google]</CODE> 3151 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3152 */ 3153 public static class FileFilter 3154 extends BaseType 3155 implements java.io.Serializable 3156 { 3157 /** For Object Serialization. java.io.Serializable */ 3158 protected static final long serialVersionUID = 1; 3159 3160 public boolean[] optionals() 3161 { return new boolean[] { true, true, }; } 3162 3163 /** 3164 * <CODE>[No Description Provided by Google]</CODE> 3165 * <BR /><B CLASS=Opt>OPTIONAL</B> 3166 */ 3167 public final String name; 3168 3169 /** 3170 * <CODE>[No Description Provided by Google]</CODE> 3171 * <BR /><B CLASS=Opt>OPTIONAL</B> 3172 */ 3173 public final String[] accepts; 3174 3175 /** 3176 * Constructor 3177 * 3178 * @param name - 3179 * <BR /><B CLASS=Opt>OPTIONAL</B> 3180 * 3181 * @param accepts - 3182 * <BR /><B CLASS=Opt>OPTIONAL</B> 3183 */ 3184 public FileFilter(String name, String[] accepts) 3185 { 3186 this.name = name; 3187 this.accepts = accepts; 3188 } 3189 3190 /** 3191 * JSON Object Constructor 3192 * @param jo A Json-Object having data about an instance of {@code 'FileFilter'}. 3193 */ 3194 public FileFilter (JsonObject jo) 3195 { 3196 this.name = ReadJSON.getString(jo, "name", true, false); 3197 this.accepts = (jo.getJsonArray("accepts") == null) 3198 ? null 3199 : RJArrIntoStream.strArr(jo.getJsonArray("accepts"), null, 0).toArray(String[]::new); 3200 3201 } 3202 3203 3204 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3205 public boolean equals(Object other) 3206 { 3207 if (this == other) return true; 3208 if (other == null) return false; 3209 if (other.getClass() != this.getClass()) return false; 3210 3211 FileFilter o = (FileFilter) other; 3212 3213 return 3214 Objects.equals(this.name, o.name) 3215 && Arrays.deepEquals(this.accepts, o.accepts); 3216 } 3217 3218 /** Generates a Hash-Code for {@code 'this'} instance */ 3219 public int hashCode() 3220 { 3221 return 3222 Objects.hashCode(this.name) 3223 + Arrays.deepHashCode(this.accepts); 3224 } 3225 } 3226 3227 /** 3228 * <CODE>[No Description Provided by Google]</CODE> 3229 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3230 */ 3231 public static class FileHandler 3232 extends BaseType 3233 implements java.io.Serializable 3234 { 3235 /** For Object Serialization. java.io.Serializable */ 3236 protected static final long serialVersionUID = 1; 3237 3238 public boolean[] optionals() 3239 { return new boolean[] { false, false, true, true, false, }; } 3240 3241 /** <CODE>[No Description Provided by Google]</CODE> */ 3242 public final String action; 3243 3244 /** <CODE>[No Description Provided by Google]</CODE> */ 3245 public final String name; 3246 3247 /** 3248 * <CODE>[No Description Provided by Google]</CODE> 3249 * <BR /><B CLASS=Opt>OPTIONAL</B> 3250 */ 3251 public final Page.ImageResource[] icons; 3252 3253 /** 3254 * Mimic a map, name is the key, accepts is the value. 3255 * <BR /><B CLASS=Opt>OPTIONAL</B> 3256 */ 3257 public final Page.FileFilter[] accepts; 3258 3259 /** 3260 * Won't repeat the enums, using string for easy comparison. Same as the 3261 * other enums below. 3262 */ 3263 public final String launchType; 3264 3265 /** 3266 * Constructor 3267 * 3268 * @param action - 3269 * 3270 * @param name - 3271 * 3272 * @param icons - 3273 * <BR /><B CLASS=Opt>OPTIONAL</B> 3274 * 3275 * @param accepts Mimic a map, name is the key, accepts is the value. 3276 * <BR /><B CLASS=Opt>OPTIONAL</B> 3277 * 3278 * @param launchType 3279 * Won't repeat the enums, using string for easy comparison. Same as the 3280 * other enums below. 3281 */ 3282 public FileHandler( 3283 String action, String name, Page.ImageResource[] icons, Page.FileFilter[] accepts, 3284 String launchType 3285 ) 3286 { 3287 // Exception-Check(s) to ensure that if any parameters which are not declared as 3288 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3289 3290 if (action == null) THROWS.throwNPE("action"); 3291 if (name == null) THROWS.throwNPE("name"); 3292 if (launchType == null) THROWS.throwNPE("launchType"); 3293 3294 this.action = action; 3295 this.name = name; 3296 this.icons = icons; 3297 this.accepts = accepts; 3298 this.launchType = launchType; 3299 } 3300 3301 /** 3302 * JSON Object Constructor 3303 * @param jo A Json-Object having data about an instance of {@code 'FileHandler'}. 3304 */ 3305 public FileHandler (JsonObject jo) 3306 { 3307 this.action = ReadJSON.getString(jo, "action", false, true); 3308 this.name = ReadJSON.getString(jo, "name", false, true); 3309 this.icons = (jo.getJsonArray("icons") == null) 3310 ? null 3311 : RJArrIntoStream.objArr(jo.getJsonArray("icons"), null, 0, Page.ImageResource.class).toArray(Page.ImageResource[]::new); 3312 3313 this.accepts = (jo.getJsonArray("accepts") == null) 3314 ? null 3315 : RJArrIntoStream.objArr(jo.getJsonArray("accepts"), null, 0, Page.FileFilter.class).toArray(Page.FileFilter[]::new); 3316 3317 this.launchType = ReadJSON.getString(jo, "launchType", false, true); 3318 } 3319 3320 3321 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3322 public boolean equals(Object other) 3323 { 3324 if (this == other) return true; 3325 if (other == null) return false; 3326 if (other.getClass() != this.getClass()) return false; 3327 3328 FileHandler o = (FileHandler) other; 3329 3330 return 3331 Objects.equals(this.action, o.action) 3332 && Objects.equals(this.name, o.name) 3333 && Arrays.deepEquals(this.icons, o.icons) 3334 && Arrays.deepEquals(this.accepts, o.accepts) 3335 && Objects.equals(this.launchType, o.launchType); 3336 } 3337 3338 /** Generates a Hash-Code for {@code 'this'} instance */ 3339 public int hashCode() 3340 { 3341 return 3342 Objects.hashCode(this.action) 3343 + Objects.hashCode(this.name) 3344 + Arrays.deepHashCode(this.icons) 3345 + Arrays.deepHashCode(this.accepts) 3346 + Objects.hashCode(this.launchType); 3347 } 3348 } 3349 3350 /** 3351 * The image definition used in both icon and screenshot. 3352 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3353 */ 3354 public static class ImageResource 3355 extends BaseType 3356 implements java.io.Serializable 3357 { 3358 /** For Object Serialization. java.io.Serializable */ 3359 protected static final long serialVersionUID = 1; 3360 3361 public boolean[] optionals() 3362 { return new boolean[] { false, true, true, }; } 3363 3364 /** 3365 * The src field in the definition, but changing to url in favor of 3366 * consistency. 3367 */ 3368 public final String url; 3369 3370 /** 3371 * <CODE>[No Description Provided by Google]</CODE> 3372 * <BR /><B CLASS=Opt>OPTIONAL</B> 3373 */ 3374 public final String sizes; 3375 3376 /** 3377 * <CODE>[No Description Provided by Google]</CODE> 3378 * <BR /><B CLASS=Opt>OPTIONAL</B> 3379 */ 3380 public final String type; 3381 3382 /** 3383 * Constructor 3384 * 3385 * @param url 3386 * The src field in the definition, but changing to url in favor of 3387 * consistency. 3388 * 3389 * @param sizes - 3390 * <BR /><B CLASS=Opt>OPTIONAL</B> 3391 * 3392 * @param type - 3393 * <BR /><B CLASS=Opt>OPTIONAL</B> 3394 */ 3395 public ImageResource(String url, String sizes, String type) 3396 { 3397 // Exception-Check(s) to ensure that if any parameters which are not declared as 3398 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3399 3400 if (url == null) THROWS.throwNPE("url"); 3401 3402 this.url = url; 3403 this.sizes = sizes; 3404 this.type = type; 3405 } 3406 3407 /** 3408 * JSON Object Constructor 3409 * @param jo A Json-Object having data about an instance of {@code 'ImageResource'}. 3410 */ 3411 public ImageResource (JsonObject jo) 3412 { 3413 this.url = ReadJSON.getString(jo, "url", false, true); 3414 this.sizes = ReadJSON.getString(jo, "sizes", true, false); 3415 this.type = ReadJSON.getString(jo, "type", true, false); 3416 } 3417 3418 3419 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3420 public boolean equals(Object other) 3421 { 3422 if (this == other) return true; 3423 if (other == null) return false; 3424 if (other.getClass() != this.getClass()) return false; 3425 3426 ImageResource o = (ImageResource) other; 3427 3428 return 3429 Objects.equals(this.url, o.url) 3430 && Objects.equals(this.sizes, o.sizes) 3431 && Objects.equals(this.type, o.type); 3432 } 3433 3434 /** Generates a Hash-Code for {@code 'this'} instance */ 3435 public int hashCode() 3436 { 3437 return 3438 Objects.hashCode(this.url) 3439 + Objects.hashCode(this.sizes) 3440 + Objects.hashCode(this.type); 3441 } 3442 } 3443 3444 /** 3445 * <CODE>[No Description Provided by Google]</CODE> 3446 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3447 */ 3448 public static class LaunchHandler 3449 extends BaseType 3450 implements java.io.Serializable 3451 { 3452 /** For Object Serialization. java.io.Serializable */ 3453 protected static final long serialVersionUID = 1; 3454 3455 public boolean[] optionals() 3456 { return new boolean[] { false, }; } 3457 3458 /** <CODE>[No Description Provided by Google]</CODE> */ 3459 public final String clientMode; 3460 3461 /** 3462 * Constructor 3463 * 3464 * @param clientMode - 3465 */ 3466 public LaunchHandler(String clientMode) 3467 { 3468 // Exception-Check(s) to ensure that if any parameters which are not declared as 3469 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3470 3471 if (clientMode == null) THROWS.throwNPE("clientMode"); 3472 3473 this.clientMode = clientMode; 3474 } 3475 3476 /** 3477 * JSON Object Constructor 3478 * @param jo A Json-Object having data about an instance of {@code 'LaunchHandler'}. 3479 */ 3480 public LaunchHandler (JsonObject jo) 3481 { 3482 this.clientMode = ReadJSON.getString(jo, "clientMode", false, true); 3483 } 3484 3485 3486 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3487 public boolean equals(Object other) 3488 { 3489 if (this == other) return true; 3490 if (other == null) return false; 3491 if (other.getClass() != this.getClass()) return false; 3492 3493 LaunchHandler o = (LaunchHandler) other; 3494 3495 return 3496 Objects.equals(this.clientMode, o.clientMode); 3497 } 3498 3499 /** Generates a Hash-Code for {@code 'this'} instance */ 3500 public int hashCode() 3501 { 3502 return 3503 Objects.hashCode(this.clientMode); 3504 } 3505 } 3506 3507 /** 3508 * <CODE>[No Description Provided by Google]</CODE> 3509 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3510 */ 3511 public static class ProtocolHandler 3512 extends BaseType 3513 implements java.io.Serializable 3514 { 3515 /** For Object Serialization. java.io.Serializable */ 3516 protected static final long serialVersionUID = 1; 3517 3518 public boolean[] optionals() 3519 { return new boolean[] { false, false, }; } 3520 3521 /** <CODE>[No Description Provided by Google]</CODE> */ 3522 public final String protocol; 3523 3524 /** <CODE>[No Description Provided by Google]</CODE> */ 3525 public final String url; 3526 3527 /** 3528 * Constructor 3529 * 3530 * @param protocol - 3531 * 3532 * @param url - 3533 */ 3534 public ProtocolHandler(String protocol, String url) 3535 { 3536 // Exception-Check(s) to ensure that if any parameters which are not declared as 3537 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3538 3539 if (protocol == null) THROWS.throwNPE("protocol"); 3540 if (url == null) THROWS.throwNPE("url"); 3541 3542 this.protocol = protocol; 3543 this.url = url; 3544 } 3545 3546 /** 3547 * JSON Object Constructor 3548 * @param jo A Json-Object having data about an instance of {@code 'ProtocolHandler'}. 3549 */ 3550 public ProtocolHandler (JsonObject jo) 3551 { 3552 this.protocol = ReadJSON.getString(jo, "protocol", false, true); 3553 this.url = ReadJSON.getString(jo, "url", false, true); 3554 } 3555 3556 3557 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3558 public boolean equals(Object other) 3559 { 3560 if (this == other) return true; 3561 if (other == null) return false; 3562 if (other.getClass() != this.getClass()) return false; 3563 3564 ProtocolHandler o = (ProtocolHandler) other; 3565 3566 return 3567 Objects.equals(this.protocol, o.protocol) 3568 && Objects.equals(this.url, o.url); 3569 } 3570 3571 /** Generates a Hash-Code for {@code 'this'} instance */ 3572 public int hashCode() 3573 { 3574 return 3575 Objects.hashCode(this.protocol) 3576 + Objects.hashCode(this.url); 3577 } 3578 } 3579 3580 /** 3581 * <CODE>[No Description Provided by Google]</CODE> 3582 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3583 */ 3584 public static class RelatedApplication 3585 extends BaseType 3586 implements java.io.Serializable 3587 { 3588 /** For Object Serialization. java.io.Serializable */ 3589 protected static final long serialVersionUID = 1; 3590 3591 public boolean[] optionals() 3592 { return new boolean[] { true, false, }; } 3593 3594 /** 3595 * <CODE>[No Description Provided by Google]</CODE> 3596 * <BR /><B CLASS=Opt>OPTIONAL</B> 3597 */ 3598 public final String id; 3599 3600 /** <CODE>[No Description Provided by Google]</CODE> */ 3601 public final String url; 3602 3603 /** 3604 * Constructor 3605 * 3606 * @param id - 3607 * <BR /><B CLASS=Opt>OPTIONAL</B> 3608 * 3609 * @param url - 3610 */ 3611 public RelatedApplication(String id, String url) 3612 { 3613 // Exception-Check(s) to ensure that if any parameters which are not declared as 3614 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3615 3616 if (url == null) THROWS.throwNPE("url"); 3617 3618 this.id = id; 3619 this.url = url; 3620 } 3621 3622 /** 3623 * JSON Object Constructor 3624 * @param jo A Json-Object having data about an instance of {@code 'RelatedApplication'}. 3625 */ 3626 public RelatedApplication (JsonObject jo) 3627 { 3628 this.id = ReadJSON.getString(jo, "id", true, false); 3629 this.url = ReadJSON.getString(jo, "url", false, true); 3630 } 3631 3632 3633 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3634 public boolean equals(Object other) 3635 { 3636 if (this == other) return true; 3637 if (other == null) return false; 3638 if (other.getClass() != this.getClass()) return false; 3639 3640 RelatedApplication o = (RelatedApplication) other; 3641 3642 return 3643 Objects.equals(this.id, o.id) 3644 && Objects.equals(this.url, o.url); 3645 } 3646 3647 /** Generates a Hash-Code for {@code 'this'} instance */ 3648 public int hashCode() 3649 { 3650 return 3651 Objects.hashCode(this.id) 3652 + Objects.hashCode(this.url); 3653 } 3654 } 3655 3656 /** 3657 * <CODE>[No Description Provided by Google]</CODE> 3658 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3659 */ 3660 public static class ScopeExtension 3661 extends BaseType 3662 implements java.io.Serializable 3663 { 3664 /** For Object Serialization. java.io.Serializable */ 3665 protected static final long serialVersionUID = 1; 3666 3667 public boolean[] optionals() 3668 { return new boolean[] { false, false, }; } 3669 3670 /** 3671 * Instead of using tuple, this field always returns the serialized string 3672 * for easy understanding and comparison. 3673 */ 3674 public final String origin; 3675 3676 /** <CODE>[No Description Provided by Google]</CODE> */ 3677 public final boolean hasOriginWildcard; 3678 3679 /** 3680 * Constructor 3681 * 3682 * @param origin 3683 * Instead of using tuple, this field always returns the serialized string 3684 * for easy understanding and comparison. 3685 * 3686 * @param hasOriginWildcard - 3687 */ 3688 public ScopeExtension(String origin, boolean hasOriginWildcard) 3689 { 3690 // Exception-Check(s) to ensure that if any parameters which are not declared as 3691 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3692 3693 if (origin == null) THROWS.throwNPE("origin"); 3694 3695 this.origin = origin; 3696 this.hasOriginWildcard = hasOriginWildcard; 3697 } 3698 3699 /** 3700 * JSON Object Constructor 3701 * @param jo A Json-Object having data about an instance of {@code 'ScopeExtension'}. 3702 */ 3703 public ScopeExtension (JsonObject jo) 3704 { 3705 this.origin = ReadJSON.getString(jo, "origin", false, true); 3706 this.hasOriginWildcard = ReadPrimJSON.getBoolean(jo, "hasOriginWildcard"); 3707 } 3708 3709 3710 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3711 public boolean equals(Object other) 3712 { 3713 if (this == other) return true; 3714 if (other == null) return false; 3715 if (other.getClass() != this.getClass()) return false; 3716 3717 ScopeExtension o = (ScopeExtension) other; 3718 3719 return 3720 Objects.equals(this.origin, o.origin) 3721 && (this.hasOriginWildcard == o.hasOriginWildcard); 3722 } 3723 3724 /** Generates a Hash-Code for {@code 'this'} instance */ 3725 public int hashCode() 3726 { 3727 return 3728 Objects.hashCode(this.origin) 3729 + (this.hasOriginWildcard ? 1 : 0); 3730 } 3731 } 3732 3733 /** 3734 * <CODE>[No Description Provided by Google]</CODE> 3735 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3736 */ 3737 public static class Screenshot 3738 extends BaseType 3739 implements java.io.Serializable 3740 { 3741 /** For Object Serialization. java.io.Serializable */ 3742 protected static final long serialVersionUID = 1; 3743 3744 public boolean[] optionals() 3745 { return new boolean[] { false, false, true, }; } 3746 3747 /** <CODE>[No Description Provided by Google]</CODE> */ 3748 public final Page.ImageResource image; 3749 3750 /** <CODE>[No Description Provided by Google]</CODE> */ 3751 public final String formFactor; 3752 3753 /** 3754 * <CODE>[No Description Provided by Google]</CODE> 3755 * <BR /><B CLASS=Opt>OPTIONAL</B> 3756 */ 3757 public final String label; 3758 3759 /** 3760 * Constructor 3761 * 3762 * @param image - 3763 * 3764 * @param formFactor - 3765 * 3766 * @param label - 3767 * <BR /><B CLASS=Opt>OPTIONAL</B> 3768 */ 3769 public Screenshot(Page.ImageResource image, String formFactor, String label) 3770 { 3771 // Exception-Check(s) to ensure that if any parameters which are not declared as 3772 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3773 3774 if (image == null) THROWS.throwNPE("image"); 3775 if (formFactor == null) THROWS.throwNPE("formFactor"); 3776 3777 this.image = image; 3778 this.formFactor = formFactor; 3779 this.label = label; 3780 } 3781 3782 /** 3783 * JSON Object Constructor 3784 * @param jo A Json-Object having data about an instance of {@code 'Screenshot'}. 3785 */ 3786 public Screenshot (JsonObject jo) 3787 { 3788 this.image = ReadJSON.getObject(jo, "image", Page.ImageResource.class, false, true); 3789 this.formFactor = ReadJSON.getString(jo, "formFactor", false, true); 3790 this.label = ReadJSON.getString(jo, "label", true, false); 3791 } 3792 3793 3794 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3795 public boolean equals(Object other) 3796 { 3797 if (this == other) return true; 3798 if (other == null) return false; 3799 if (other.getClass() != this.getClass()) return false; 3800 3801 Screenshot o = (Screenshot) other; 3802 3803 return 3804 Objects.equals(this.image, o.image) 3805 && Objects.equals(this.formFactor, o.formFactor) 3806 && Objects.equals(this.label, o.label); 3807 } 3808 3809 /** Generates a Hash-Code for {@code 'this'} instance */ 3810 public int hashCode() 3811 { 3812 return 3813 this.image.hashCode() 3814 + Objects.hashCode(this.formFactor) 3815 + Objects.hashCode(this.label); 3816 } 3817 } 3818 3819 /** 3820 * <CODE>[No Description Provided by Google]</CODE> 3821 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3822 */ 3823 public static class ShareTarget 3824 extends BaseType 3825 implements java.io.Serializable 3826 { 3827 /** For Object Serialization. java.io.Serializable */ 3828 protected static final long serialVersionUID = 1; 3829 3830 public boolean[] optionals() 3831 { return new boolean[] { false, false, false, true, true, true, true, }; } 3832 3833 /** <CODE>[No Description Provided by Google]</CODE> */ 3834 public final String action; 3835 3836 /** <CODE>[No Description Provided by Google]</CODE> */ 3837 public final String method; 3838 3839 /** <CODE>[No Description Provided by Google]</CODE> */ 3840 public final String enctype; 3841 3842 /** 3843 * Embed the ShareTargetParams 3844 * <BR /><B CLASS=Opt>OPTIONAL</B> 3845 */ 3846 public final String title; 3847 3848 /** 3849 * <CODE>[No Description Provided by Google]</CODE> 3850 * <BR /><B CLASS=Opt>OPTIONAL</B> 3851 */ 3852 public final String text; 3853 3854 /** 3855 * <CODE>[No Description Provided by Google]</CODE> 3856 * <BR /><B CLASS=Opt>OPTIONAL</B> 3857 */ 3858 public final String url; 3859 3860 /** 3861 * <CODE>[No Description Provided by Google]</CODE> 3862 * <BR /><B CLASS=Opt>OPTIONAL</B> 3863 */ 3864 public final Page.FileFilter[] files; 3865 3866 /** 3867 * Constructor 3868 * 3869 * @param action - 3870 * 3871 * @param method - 3872 * 3873 * @param enctype - 3874 * 3875 * @param title Embed the ShareTargetParams 3876 * <BR /><B CLASS=Opt>OPTIONAL</B> 3877 * 3878 * @param text - 3879 * <BR /><B CLASS=Opt>OPTIONAL</B> 3880 * 3881 * @param url - 3882 * <BR /><B CLASS=Opt>OPTIONAL</B> 3883 * 3884 * @param files - 3885 * <BR /><B CLASS=Opt>OPTIONAL</B> 3886 */ 3887 public ShareTarget( 3888 String action, String method, String enctype, String title, String text, String url, 3889 Page.FileFilter[] files 3890 ) 3891 { 3892 // Exception-Check(s) to ensure that if any parameters which are not declared as 3893 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3894 3895 if (action == null) THROWS.throwNPE("action"); 3896 if (method == null) THROWS.throwNPE("method"); 3897 if (enctype == null) THROWS.throwNPE("enctype"); 3898 3899 this.action = action; 3900 this.method = method; 3901 this.enctype = enctype; 3902 this.title = title; 3903 this.text = text; 3904 this.url = url; 3905 this.files = files; 3906 } 3907 3908 /** 3909 * JSON Object Constructor 3910 * @param jo A Json-Object having data about an instance of {@code 'ShareTarget'}. 3911 */ 3912 public ShareTarget (JsonObject jo) 3913 { 3914 this.action = ReadJSON.getString(jo, "action", false, true); 3915 this.method = ReadJSON.getString(jo, "method", false, true); 3916 this.enctype = ReadJSON.getString(jo, "enctype", false, true); 3917 this.title = ReadJSON.getString(jo, "title", true, false); 3918 this.text = ReadJSON.getString(jo, "text", true, false); 3919 this.url = ReadJSON.getString(jo, "url", true, false); 3920 this.files = (jo.getJsonArray("files") == null) 3921 ? null 3922 : RJArrIntoStream.objArr(jo.getJsonArray("files"), null, 0, Page.FileFilter.class).toArray(Page.FileFilter[]::new); 3923 3924 } 3925 3926 3927 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3928 public boolean equals(Object other) 3929 { 3930 if (this == other) return true; 3931 if (other == null) return false; 3932 if (other.getClass() != this.getClass()) return false; 3933 3934 ShareTarget o = (ShareTarget) other; 3935 3936 return 3937 Objects.equals(this.action, o.action) 3938 && Objects.equals(this.method, o.method) 3939 && Objects.equals(this.enctype, o.enctype) 3940 && Objects.equals(this.title, o.title) 3941 && Objects.equals(this.text, o.text) 3942 && Objects.equals(this.url, o.url) 3943 && Arrays.deepEquals(this.files, o.files); 3944 } 3945 3946 /** Generates a Hash-Code for {@code 'this'} instance */ 3947 public int hashCode() 3948 { 3949 return 3950 Objects.hashCode(this.action) 3951 + Objects.hashCode(this.method) 3952 + Objects.hashCode(this.enctype) 3953 + Objects.hashCode(this.title) 3954 + Objects.hashCode(this.text) 3955 + Objects.hashCode(this.url) 3956 + Arrays.deepHashCode(this.files); 3957 } 3958 } 3959 3960 /** 3961 * <CODE>[No Description Provided by Google]</CODE> 3962 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3963 */ 3964 public static class Shortcut 3965 extends BaseType 3966 implements java.io.Serializable 3967 { 3968 /** For Object Serialization. java.io.Serializable */ 3969 protected static final long serialVersionUID = 1; 3970 3971 public boolean[] optionals() 3972 { return new boolean[] { false, false, }; } 3973 3974 /** <CODE>[No Description Provided by Google]</CODE> */ 3975 public final String name; 3976 3977 /** <CODE>[No Description Provided by Google]</CODE> */ 3978 public final String url; 3979 3980 /** 3981 * Constructor 3982 * 3983 * @param name - 3984 * 3985 * @param url - 3986 */ 3987 public Shortcut(String name, String url) 3988 { 3989 // Exception-Check(s) to ensure that if any parameters which are not declared as 3990 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3991 3992 if (name == null) THROWS.throwNPE("name"); 3993 if (url == null) THROWS.throwNPE("url"); 3994 3995 this.name = name; 3996 this.url = url; 3997 } 3998 3999 /** 4000 * JSON Object Constructor 4001 * @param jo A Json-Object having data about an instance of {@code 'Shortcut'}. 4002 */ 4003 public Shortcut (JsonObject jo) 4004 { 4005 this.name = ReadJSON.getString(jo, "name", false, true); 4006 this.url = ReadJSON.getString(jo, "url", false, true); 4007 } 4008 4009 4010 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4011 public boolean equals(Object other) 4012 { 4013 if (this == other) return true; 4014 if (other == null) return false; 4015 if (other.getClass() != this.getClass()) return false; 4016 4017 Shortcut o = (Shortcut) other; 4018 4019 return 4020 Objects.equals(this.name, o.name) 4021 && Objects.equals(this.url, o.url); 4022 } 4023 4024 /** Generates a Hash-Code for {@code 'this'} instance */ 4025 public int hashCode() 4026 { 4027 return 4028 Objects.hashCode(this.name) 4029 + Objects.hashCode(this.url); 4030 } 4031 } 4032 4033 /** 4034 * <CODE>[No Description Provided by Google]</CODE> 4035 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4036 */ 4037 public static class WebAppManifest 4038 extends BaseType 4039 implements java.io.Serializable 4040 { 4041 /** For Object Serialization. java.io.Serializable */ 4042 protected static final long serialVersionUID = 1; 4043 4044 public boolean[] optionals() 4045 { return new boolean[] { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, }; } 4046 4047 /** 4048 * <CODE>[No Description Provided by Google]</CODE> 4049 * <BR /><B CLASS=Opt>OPTIONAL</B> 4050 */ 4051 public final String backgroundColor; 4052 4053 /** 4054 * The extra description provided by the manifest. 4055 * <BR /><B CLASS=Opt>OPTIONAL</B> 4056 */ 4057 public final String description; 4058 4059 /** 4060 * <CODE>[No Description Provided by Google]</CODE> 4061 * <BR /><B CLASS=Opt>OPTIONAL</B> 4062 */ 4063 public final String dir; 4064 4065 /** 4066 * <CODE>[No Description Provided by Google]</CODE> 4067 * <BR /><B CLASS=Opt>OPTIONAL</B> 4068 */ 4069 public final String display; 4070 4071 /** 4072 * The overrided display mode controlled by the user. 4073 * <BR /><B CLASS=Opt>OPTIONAL</B> 4074 */ 4075 public final String[] displayOverrides; 4076 4077 /** 4078 * The handlers to open files. 4079 * <BR /><B CLASS=Opt>OPTIONAL</B> 4080 */ 4081 public final Page.FileHandler[] fileHandlers; 4082 4083 /** 4084 * <CODE>[No Description Provided by Google]</CODE> 4085 * <BR /><B CLASS=Opt>OPTIONAL</B> 4086 */ 4087 public final Page.ImageResource[] icons; 4088 4089 /** 4090 * <CODE>[No Description Provided by Google]</CODE> 4091 * <BR /><B CLASS=Opt>OPTIONAL</B> 4092 */ 4093 public final String id; 4094 4095 /** 4096 * <CODE>[No Description Provided by Google]</CODE> 4097 * <BR /><B CLASS=Opt>OPTIONAL</B> 4098 */ 4099 public final String lang; 4100 4101 /** 4102 * TODO(crbug.com/1231886): This field is non-standard and part of a Chrome 4103 * experiment. See: 4104 * https://github.com/WICG/web-app-launch/blob/main/launch_handler.md 4105 * <BR /><B CLASS=Opt>OPTIONAL</B> 4106 */ 4107 public final Page.LaunchHandler launchHandler; 4108 4109 /** 4110 * <CODE>[No Description Provided by Google]</CODE> 4111 * <BR /><B CLASS=Opt>OPTIONAL</B> 4112 */ 4113 public final String name; 4114 4115 /** 4116 * <CODE>[No Description Provided by Google]</CODE> 4117 * <BR /><B CLASS=Opt>OPTIONAL</B> 4118 */ 4119 public final String orientation; 4120 4121 /** 4122 * <CODE>[No Description Provided by Google]</CODE> 4123 * <BR /><B CLASS=Opt>OPTIONAL</B> 4124 */ 4125 public final Boolean preferRelatedApplications; 4126 4127 /** 4128 * The handlers to open protocols. 4129 * <BR /><B CLASS=Opt>OPTIONAL</B> 4130 */ 4131 public final Page.ProtocolHandler[] protocolHandlers; 4132 4133 /** 4134 * <CODE>[No Description Provided by Google]</CODE> 4135 * <BR /><B CLASS=Opt>OPTIONAL</B> 4136 */ 4137 public final Page.RelatedApplication[] relatedApplications; 4138 4139 /** 4140 * <CODE>[No Description Provided by Google]</CODE> 4141 * <BR /><B CLASS=Opt>OPTIONAL</B> 4142 */ 4143 public final String scope; 4144 4145 /** 4146 * Non-standard, see 4147 * https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md 4148 * <BR /><B CLASS=Opt>OPTIONAL</B> 4149 */ 4150 public final Page.ScopeExtension[] scopeExtensions; 4151 4152 /** 4153 * The screenshots used by chromium. 4154 * <BR /><B CLASS=Opt>OPTIONAL</B> 4155 */ 4156 public final Page.Screenshot[] screenshots; 4157 4158 /** 4159 * <CODE>[No Description Provided by Google]</CODE> 4160 * <BR /><B CLASS=Opt>OPTIONAL</B> 4161 */ 4162 public final Page.ShareTarget shareTarget; 4163 4164 /** 4165 * <CODE>[No Description Provided by Google]</CODE> 4166 * <BR /><B CLASS=Opt>OPTIONAL</B> 4167 */ 4168 public final String shortName; 4169 4170 /** 4171 * <CODE>[No Description Provided by Google]</CODE> 4172 * <BR /><B CLASS=Opt>OPTIONAL</B> 4173 */ 4174 public final Page.Shortcut[] shortcuts; 4175 4176 /** 4177 * <CODE>[No Description Provided by Google]</CODE> 4178 * <BR /><B CLASS=Opt>OPTIONAL</B> 4179 */ 4180 public final String startUrl; 4181 4182 /** 4183 * <CODE>[No Description Provided by Google]</CODE> 4184 * <BR /><B CLASS=Opt>OPTIONAL</B> 4185 */ 4186 public final String themeColor; 4187 4188 /** 4189 * Constructor 4190 * 4191 * @param backgroundColor - 4192 * <BR /><B CLASS=Opt>OPTIONAL</B> 4193 * 4194 * @param description The extra description provided by the manifest. 4195 * <BR /><B CLASS=Opt>OPTIONAL</B> 4196 * 4197 * @param dir - 4198 * <BR /><B CLASS=Opt>OPTIONAL</B> 4199 * 4200 * @param display - 4201 * <BR /><B CLASS=Opt>OPTIONAL</B> 4202 * 4203 * @param displayOverrides The overrided display mode controlled by the user. 4204 * <BR /><B CLASS=Opt>OPTIONAL</B> 4205 * 4206 * @param fileHandlers The handlers to open files. 4207 * <BR /><B CLASS=Opt>OPTIONAL</B> 4208 * 4209 * @param icons - 4210 * <BR /><B CLASS=Opt>OPTIONAL</B> 4211 * 4212 * @param id - 4213 * <BR /><B CLASS=Opt>OPTIONAL</B> 4214 * 4215 * @param lang - 4216 * <BR /><B CLASS=Opt>OPTIONAL</B> 4217 * 4218 * @param launchHandler 4219 * TODO(crbug.com/1231886): This field is non-standard and part of a Chrome 4220 * experiment. See: 4221 * https://github.com/WICG/web-app-launch/blob/main/launch_handler.md 4222 * <BR /><B CLASS=Opt>OPTIONAL</B> 4223 * 4224 * @param name - 4225 * <BR /><B CLASS=Opt>OPTIONAL</B> 4226 * 4227 * @param orientation - 4228 * <BR /><B CLASS=Opt>OPTIONAL</B> 4229 * 4230 * @param preferRelatedApplications - 4231 * <BR /><B CLASS=Opt>OPTIONAL</B> 4232 * 4233 * @param protocolHandlers The handlers to open protocols. 4234 * <BR /><B CLASS=Opt>OPTIONAL</B> 4235 * 4236 * @param relatedApplications - 4237 * <BR /><B CLASS=Opt>OPTIONAL</B> 4238 * 4239 * @param scope - 4240 * <BR /><B CLASS=Opt>OPTIONAL</B> 4241 * 4242 * @param scopeExtensions 4243 * Non-standard, see 4244 * https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md 4245 * <BR /><B CLASS=Opt>OPTIONAL</B> 4246 * 4247 * @param screenshots The screenshots used by chromium. 4248 * <BR /><B CLASS=Opt>OPTIONAL</B> 4249 * 4250 * @param shareTarget - 4251 * <BR /><B CLASS=Opt>OPTIONAL</B> 4252 * 4253 * @param shortName - 4254 * <BR /><B CLASS=Opt>OPTIONAL</B> 4255 * 4256 * @param shortcuts - 4257 * <BR /><B CLASS=Opt>OPTIONAL</B> 4258 * 4259 * @param startUrl - 4260 * <BR /><B CLASS=Opt>OPTIONAL</B> 4261 * 4262 * @param themeColor - 4263 * <BR /><B CLASS=Opt>OPTIONAL</B> 4264 */ 4265 public WebAppManifest( 4266 String backgroundColor, String description, String dir, String display, 4267 String[] displayOverrides, Page.FileHandler[] fileHandlers, 4268 Page.ImageResource[] icons, String id, String lang, 4269 Page.LaunchHandler launchHandler, String name, String orientation, 4270 Boolean preferRelatedApplications, Page.ProtocolHandler[] protocolHandlers, 4271 Page.RelatedApplication[] relatedApplications, String scope, 4272 Page.ScopeExtension[] scopeExtensions, Page.Screenshot[] screenshots, 4273 Page.ShareTarget shareTarget, String shortName, Page.Shortcut[] shortcuts, 4274 String startUrl, String themeColor 4275 ) 4276 { 4277 this.backgroundColor = backgroundColor; 4278 this.description = description; 4279 this.dir = dir; 4280 this.display = display; 4281 this.displayOverrides = displayOverrides; 4282 this.fileHandlers = fileHandlers; 4283 this.icons = icons; 4284 this.id = id; 4285 this.lang = lang; 4286 this.launchHandler = launchHandler; 4287 this.name = name; 4288 this.orientation = orientation; 4289 this.preferRelatedApplications = preferRelatedApplications; 4290 this.protocolHandlers = protocolHandlers; 4291 this.relatedApplications = relatedApplications; 4292 this.scope = scope; 4293 this.scopeExtensions = scopeExtensions; 4294 this.screenshots = screenshots; 4295 this.shareTarget = shareTarget; 4296 this.shortName = shortName; 4297 this.shortcuts = shortcuts; 4298 this.startUrl = startUrl; 4299 this.themeColor = themeColor; 4300 } 4301 4302 /** 4303 * JSON Object Constructor 4304 * @param jo A Json-Object having data about an instance of {@code 'WebAppManifest'}. 4305 */ 4306 public WebAppManifest (JsonObject jo) 4307 { 4308 this.backgroundColor = ReadJSON.getString(jo, "backgroundColor", true, false); 4309 this.description = ReadJSON.getString(jo, "description", true, false); 4310 this.dir = ReadJSON.getString(jo, "dir", true, false); 4311 this.display = ReadJSON.getString(jo, "display", true, false); 4312 this.displayOverrides = (jo.getJsonArray("displayOverrides") == null) 4313 ? null 4314 : RJArrIntoStream.strArr(jo.getJsonArray("displayOverrides"), null, 0).toArray(String[]::new); 4315 4316 this.fileHandlers = (jo.getJsonArray("fileHandlers") == null) 4317 ? null 4318 : RJArrIntoStream.objArr(jo.getJsonArray("fileHandlers"), null, 0, Page.FileHandler.class).toArray(Page.FileHandler[]::new); 4319 4320 this.icons = (jo.getJsonArray("icons") == null) 4321 ? null 4322 : RJArrIntoStream.objArr(jo.getJsonArray("icons"), null, 0, Page.ImageResource.class).toArray(Page.ImageResource[]::new); 4323 4324 this.id = ReadJSON.getString(jo, "id", true, false); 4325 this.lang = ReadJSON.getString(jo, "lang", true, false); 4326 this.launchHandler = ReadJSON.getObject(jo, "launchHandler", Page.LaunchHandler.class, true, false); 4327 this.name = ReadJSON.getString(jo, "name", true, false); 4328 this.orientation = ReadJSON.getString(jo, "orientation", true, false); 4329 this.preferRelatedApplications = ReadBoxedJSON.getBoolean(jo, "preferRelatedApplications", true); 4330 this.protocolHandlers = (jo.getJsonArray("protocolHandlers") == null) 4331 ? null 4332 : RJArrIntoStream.objArr(jo.getJsonArray("protocolHandlers"), null, 0, Page.ProtocolHandler.class).toArray(Page.ProtocolHandler[]::new); 4333 4334 this.relatedApplications = (jo.getJsonArray("relatedApplications") == null) 4335 ? null 4336 : RJArrIntoStream.objArr(jo.getJsonArray("relatedApplications"), null, 0, Page.RelatedApplication.class).toArray(Page.RelatedApplication[]::new); 4337 4338 this.scope = ReadJSON.getString(jo, "scope", true, false); 4339 this.scopeExtensions = (jo.getJsonArray("scopeExtensions") == null) 4340 ? null 4341 : RJArrIntoStream.objArr(jo.getJsonArray("scopeExtensions"), null, 0, Page.ScopeExtension.class).toArray(Page.ScopeExtension[]::new); 4342 4343 this.screenshots = (jo.getJsonArray("screenshots") == null) 4344 ? null 4345 : RJArrIntoStream.objArr(jo.getJsonArray("screenshots"), null, 0, Page.Screenshot.class).toArray(Page.Screenshot[]::new); 4346 4347 this.shareTarget = ReadJSON.getObject(jo, "shareTarget", Page.ShareTarget.class, true, false); 4348 this.shortName = ReadJSON.getString(jo, "shortName", true, false); 4349 this.shortcuts = (jo.getJsonArray("shortcuts") == null) 4350 ? null 4351 : RJArrIntoStream.objArr(jo.getJsonArray("shortcuts"), null, 0, Page.Shortcut.class).toArray(Page.Shortcut[]::new); 4352 4353 this.startUrl = ReadJSON.getString(jo, "startUrl", true, false); 4354 this.themeColor = ReadJSON.getString(jo, "themeColor", true, false); 4355 } 4356 4357 4358 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4359 public boolean equals(Object other) 4360 { 4361 if (this == other) return true; 4362 if (other == null) return false; 4363 if (other.getClass() != this.getClass()) return false; 4364 4365 WebAppManifest o = (WebAppManifest) other; 4366 4367 return 4368 Objects.equals(this.backgroundColor, o.backgroundColor) 4369 && Objects.equals(this.description, o.description) 4370 && Objects.equals(this.dir, o.dir) 4371 && Objects.equals(this.display, o.display) 4372 && Arrays.deepEquals(this.displayOverrides, o.displayOverrides) 4373 && Arrays.deepEquals(this.fileHandlers, o.fileHandlers) 4374 && Arrays.deepEquals(this.icons, o.icons) 4375 && Objects.equals(this.id, o.id) 4376 && Objects.equals(this.lang, o.lang) 4377 && Objects.equals(this.launchHandler, o.launchHandler) 4378 && Objects.equals(this.name, o.name) 4379 && Objects.equals(this.orientation, o.orientation) 4380 && Objects.equals(this.preferRelatedApplications, o.preferRelatedApplications) 4381 && Arrays.deepEquals(this.protocolHandlers, o.protocolHandlers) 4382 && Arrays.deepEquals(this.relatedApplications, o.relatedApplications) 4383 && Objects.equals(this.scope, o.scope) 4384 && Arrays.deepEquals(this.scopeExtensions, o.scopeExtensions) 4385 && Arrays.deepEquals(this.screenshots, o.screenshots) 4386 && Objects.equals(this.shareTarget, o.shareTarget) 4387 && Objects.equals(this.shortName, o.shortName) 4388 && Arrays.deepEquals(this.shortcuts, o.shortcuts) 4389 && Objects.equals(this.startUrl, o.startUrl) 4390 && Objects.equals(this.themeColor, o.themeColor); 4391 } 4392 4393 /** Generates a Hash-Code for {@code 'this'} instance */ 4394 public int hashCode() 4395 { 4396 return 4397 Objects.hashCode(this.backgroundColor) 4398 + Objects.hashCode(this.description) 4399 + Objects.hashCode(this.dir) 4400 + Objects.hashCode(this.display) 4401 + Arrays.deepHashCode(this.displayOverrides) 4402 + Arrays.deepHashCode(this.fileHandlers) 4403 + Arrays.deepHashCode(this.icons) 4404 + Objects.hashCode(this.id) 4405 + Objects.hashCode(this.lang) 4406 + this.launchHandler.hashCode() 4407 + Objects.hashCode(this.name) 4408 + Objects.hashCode(this.orientation) 4409 + Objects.hashCode(this.preferRelatedApplications) 4410 + Arrays.deepHashCode(this.protocolHandlers) 4411 + Arrays.deepHashCode(this.relatedApplications) 4412 + Objects.hashCode(this.scope) 4413 + Arrays.deepHashCode(this.scopeExtensions) 4414 + Arrays.deepHashCode(this.screenshots) 4415 + this.shareTarget.hashCode() 4416 + Objects.hashCode(this.shortName) 4417 + Arrays.deepHashCode(this.shortcuts) 4418 + Objects.hashCode(this.startUrl) 4419 + Objects.hashCode(this.themeColor); 4420 } 4421 } 4422 4423 /** 4424 * <CODE>[No Description Provided by Google]</CODE> 4425 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4426 */ 4427 public static class BackForwardCacheBlockingDetails 4428 extends BaseType 4429 implements java.io.Serializable 4430 { 4431 /** For Object Serialization. java.io.Serializable */ 4432 protected static final long serialVersionUID = 1; 4433 4434 public boolean[] optionals() 4435 { return new boolean[] { true, true, false, false, }; } 4436 4437 /** 4438 * Url of the file where blockage happened. Optional because of tests. 4439 * <BR /><B CLASS=Opt>OPTIONAL</B> 4440 */ 4441 public final String url; 4442 4443 /** 4444 * Function name where blockage happened. Optional because of anonymous functions and tests. 4445 * <BR /><B CLASS=Opt>OPTIONAL</B> 4446 */ 4447 public final String function; 4448 4449 /** Line number in the script (0-based). */ 4450 public final int lineNumber; 4451 4452 /** Column number in the script (0-based). */ 4453 public final int columnNumber; 4454 4455 /** 4456 * Constructor 4457 * 4458 * @param url Url of the file where blockage happened. Optional because of tests. 4459 * <BR /><B CLASS=Opt>OPTIONAL</B> 4460 * 4461 * @param function Function name where blockage happened. Optional because of anonymous functions and tests. 4462 * <BR /><B CLASS=Opt>OPTIONAL</B> 4463 * 4464 * @param lineNumber Line number in the script (0-based). 4465 * 4466 * @param columnNumber Column number in the script (0-based). 4467 */ 4468 public BackForwardCacheBlockingDetails 4469 (String url, String function, int lineNumber, int columnNumber) 4470 { 4471 this.url = url; 4472 this.function = function; 4473 this.lineNumber = lineNumber; 4474 this.columnNumber = columnNumber; 4475 } 4476 4477 /** 4478 * JSON Object Constructor 4479 * @param jo A Json-Object having data about an instance of {@code 'BackForwardCacheBlockingDetails'}. 4480 */ 4481 public BackForwardCacheBlockingDetails (JsonObject jo) 4482 { 4483 this.url = ReadJSON.getString(jo, "url", true, false); 4484 this.function = ReadJSON.getString(jo, "function", true, false); 4485 this.lineNumber = ReadPrimJSON.getInt(jo, "lineNumber"); 4486 this.columnNumber = ReadPrimJSON.getInt(jo, "columnNumber"); 4487 } 4488 4489 4490 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4491 public boolean equals(Object other) 4492 { 4493 if (this == other) return true; 4494 if (other == null) return false; 4495 if (other.getClass() != this.getClass()) return false; 4496 4497 BackForwardCacheBlockingDetails o = (BackForwardCacheBlockingDetails) other; 4498 4499 return 4500 Objects.equals(this.url, o.url) 4501 && Objects.equals(this.function, o.function) 4502 && (this.lineNumber == o.lineNumber) 4503 && (this.columnNumber == o.columnNumber); 4504 } 4505 4506 /** Generates a Hash-Code for {@code 'this'} instance */ 4507 public int hashCode() 4508 { 4509 return 4510 Objects.hashCode(this.url) 4511 + Objects.hashCode(this.function) 4512 + this.lineNumber 4513 + this.columnNumber; 4514 } 4515 } 4516 4517 /** 4518 * <CODE>[No Description Provided by Google]</CODE> 4519 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4520 */ 4521 public static class BackForwardCacheNotRestoredExplanation 4522 extends BaseType 4523 implements java.io.Serializable 4524 { 4525 /** For Object Serialization. java.io.Serializable */ 4526 protected static final long serialVersionUID = 1; 4527 4528 public boolean[] optionals() 4529 { return new boolean[] { false, false, true, true, }; } 4530 4531 /** Type of the reason */ 4532 public final String type; 4533 4534 /** Not restored reason */ 4535 public final String reason; 4536 4537 /** 4538 * Context associated with the reason. The meaning of this context is 4539 * dependent on the reason: 4540 * - EmbedderExtensionSentMessageToCachedFrame: the extension ID. 4541 * <BR /><B CLASS=Opt>OPTIONAL</B> 4542 */ 4543 public final String context; 4544 4545 /** 4546 * <CODE>[No Description Provided by Google]</CODE> 4547 * <BR /><B CLASS=Opt>OPTIONAL</B> 4548 */ 4549 public final Page.BackForwardCacheBlockingDetails[] details; 4550 4551 /** 4552 * Constructor 4553 * 4554 * @param type Type of the reason 4555 * 4556 * @param reason Not restored reason 4557 * 4558 * @param context 4559 * Context associated with the reason. The meaning of this context is 4560 * dependent on the reason: 4561 * - EmbedderExtensionSentMessageToCachedFrame: the extension ID. 4562 * <BR /><B CLASS=Opt>OPTIONAL</B> 4563 * 4564 * @param details - 4565 * <BR /><B CLASS=Opt>OPTIONAL</B> 4566 */ 4567 public BackForwardCacheNotRestoredExplanation( 4568 String type, String reason, String context, 4569 Page.BackForwardCacheBlockingDetails[] details 4570 ) 4571 { 4572 // Exception-Check(s) to ensure that if any parameters which are not declared as 4573 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4574 4575 if (type == null) THROWS.throwNPE("type"); 4576 if (reason == null) THROWS.throwNPE("reason"); 4577 4578 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4579 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4580 4581 THROWS.checkIAE("type", type, "Page.BackForwardCacheNotRestoredReasonType", Page.BackForwardCacheNotRestoredReasonType); 4582 THROWS.checkIAE("reason", reason, "Page.BackForwardCacheNotRestoredReason", Page.BackForwardCacheNotRestoredReason); 4583 4584 this.type = type; 4585 this.reason = reason; 4586 this.context = context; 4587 this.details = details; 4588 } 4589 4590 /** 4591 * JSON Object Constructor 4592 * @param jo A Json-Object having data about an instance of {@code 'BackForwardCacheNotRestoredExplanation'}. 4593 */ 4594 public BackForwardCacheNotRestoredExplanation (JsonObject jo) 4595 { 4596 this.type = ReadJSON.getString(jo, "type", false, true); 4597 this.reason = ReadJSON.getString(jo, "reason", false, true); 4598 this.context = ReadJSON.getString(jo, "context", true, false); 4599 this.details = (jo.getJsonArray("details") == null) 4600 ? null 4601 : RJArrIntoStream.objArr(jo.getJsonArray("details"), null, 0, Page.BackForwardCacheBlockingDetails.class).toArray(Page.BackForwardCacheBlockingDetails[]::new); 4602 4603 } 4604 4605 4606 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4607 public boolean equals(Object other) 4608 { 4609 if (this == other) return true; 4610 if (other == null) return false; 4611 if (other.getClass() != this.getClass()) return false; 4612 4613 BackForwardCacheNotRestoredExplanation o = (BackForwardCacheNotRestoredExplanation) other; 4614 4615 return 4616 Objects.equals(this.type, o.type) 4617 && Objects.equals(this.reason, o.reason) 4618 && Objects.equals(this.context, o.context) 4619 && Arrays.deepEquals(this.details, o.details); 4620 } 4621 4622 /** Generates a Hash-Code for {@code 'this'} instance */ 4623 public int hashCode() 4624 { 4625 return 4626 Objects.hashCode(this.type) 4627 + Objects.hashCode(this.reason) 4628 + Objects.hashCode(this.context) 4629 + Arrays.deepHashCode(this.details); 4630 } 4631 } 4632 4633 /** 4634 * <CODE>[No Description Provided by Google]</CODE> 4635 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4636 */ 4637 public static class BackForwardCacheNotRestoredExplanationTree 4638 extends BaseType 4639 implements java.io.Serializable 4640 { 4641 /** For Object Serialization. java.io.Serializable */ 4642 protected static final long serialVersionUID = 1; 4643 4644 public boolean[] optionals() 4645 { return new boolean[] { false, false, false, }; } 4646 4647 /** URL of each frame */ 4648 public final String url; 4649 4650 /** Not restored reasons of each frame */ 4651 public final Page.BackForwardCacheNotRestoredExplanation[] explanations; 4652 4653 /** Array of children frame */ 4654 public final Page.BackForwardCacheNotRestoredExplanationTree[] children; 4655 4656 /** 4657 * Constructor 4658 * 4659 * @param url URL of each frame 4660 * 4661 * @param explanations Not restored reasons of each frame 4662 * 4663 * @param children Array of children frame 4664 */ 4665 public BackForwardCacheNotRestoredExplanationTree( 4666 String url, Page.BackForwardCacheNotRestoredExplanation[] explanations, 4667 Page.BackForwardCacheNotRestoredExplanationTree[] children 4668 ) 4669 { 4670 // Exception-Check(s) to ensure that if any parameters which are not declared as 4671 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4672 4673 if (url == null) THROWS.throwNPE("url"); 4674 if (explanations == null) THROWS.throwNPE("explanations"); 4675 if (children == null) THROWS.throwNPE("children"); 4676 4677 this.url = url; 4678 this.explanations = explanations; 4679 this.children = children; 4680 } 4681 4682 /** 4683 * JSON Object Constructor 4684 * @param jo A Json-Object having data about an instance of {@code 'BackForwardCacheNotRestoredExplanationTree'}. 4685 */ 4686 public BackForwardCacheNotRestoredExplanationTree (JsonObject jo) 4687 { 4688 this.url = ReadJSON.getString(jo, "url", false, true); 4689 this.explanations = (jo.getJsonArray("explanations") == null) 4690 ? null 4691 : RJArrIntoStream.objArr(jo.getJsonArray("explanations"), null, 0, Page.BackForwardCacheNotRestoredExplanation.class).toArray(Page.BackForwardCacheNotRestoredExplanation[]::new); 4692 4693 this.children = (jo.getJsonArray("children") == null) 4694 ? null 4695 : RJArrIntoStream.objArr(jo.getJsonArray("children"), null, 0, Page.BackForwardCacheNotRestoredExplanationTree.class).toArray(Page.BackForwardCacheNotRestoredExplanationTree[]::new); 4696 4697 } 4698 4699 4700 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4701 public boolean equals(Object other) 4702 { 4703 if (this == other) return true; 4704 if (other == null) return false; 4705 if (other.getClass() != this.getClass()) return false; 4706 4707 BackForwardCacheNotRestoredExplanationTree o = (BackForwardCacheNotRestoredExplanationTree) other; 4708 4709 return 4710 Objects.equals(this.url, o.url) 4711 && Arrays.deepEquals(this.explanations, o.explanations) 4712 && Arrays.deepEquals(this.children, o.children); 4713 } 4714 4715 /** Generates a Hash-Code for {@code 'this'} instance */ 4716 public int hashCode() 4717 { 4718 return 4719 Objects.hashCode(this.url) 4720 + Arrays.deepHashCode(this.explanations) 4721 + Arrays.deepHashCode(this.children); 4722 } 4723 } 4724 4725 /** 4726 * - 4727 * <BR /> 4728 * <BR /><B>EXPERIMENTAL</B> 4729 * 4730 * <BR /><BR />This is Marker-Event. Marker-Event's are Events that do not posses 4731 * any data, fields or state. When they are fired, only the event name is supplied. 4732 */ 4733 public static class frameResized 4734 extends BrowserEvent 4735 implements java.io.Serializable 4736 { 4737 /** For Object Serialization. java.io.Serializable */ 4738 protected static final long serialVersionUID = 1; 4739 4740 public boolean[] optionals() { return new boolean[0]; } 4741 4742 /** JSON Object Constructor */ 4743 public frameResized(JsonObject jo) 4744 { super("Page", "frameResized", 0); } 4745 4746 @Override 4747 public String toString() { return "Page.frameResized Marker Event\n"; } 4748 } 4749 4750 /** 4751 * Fired when interstitial page was hidden 4752 * 4753 * <BR /><BR />This is Marker-Event. Marker-Event's are Events that do not posses 4754 * any data, fields or state. When they are fired, only the event name is supplied. 4755 */ 4756 public static class interstitialHidden 4757 extends BrowserEvent 4758 implements java.io.Serializable 4759 { 4760 /** For Object Serialization. java.io.Serializable */ 4761 protected static final long serialVersionUID = 1; 4762 4763 public boolean[] optionals() { return new boolean[0]; } 4764 4765 /** JSON Object Constructor */ 4766 public interstitialHidden(JsonObject jo) 4767 { super("Page", "interstitialHidden", 0); } 4768 4769 @Override 4770 public String toString() { return "Page.interstitialHidden Marker Event\n"; } 4771 } 4772 4773 /** 4774 * Fired when interstitial page was shown 4775 * 4776 * <BR /><BR />This is Marker-Event. Marker-Event's are Events that do not posses 4777 * any data, fields or state. When they are fired, only the event name is supplied. 4778 */ 4779 public static class interstitialShown 4780 extends BrowserEvent 4781 implements java.io.Serializable 4782 { 4783 /** For Object Serialization. java.io.Serializable */ 4784 protected static final long serialVersionUID = 1; 4785 4786 public boolean[] optionals() { return new boolean[0]; } 4787 4788 /** JSON Object Constructor */ 4789 public interstitialShown(JsonObject jo) 4790 { super("Page", "interstitialShown", 0); } 4791 4792 @Override 4793 public String toString() { return "Page.interstitialShown Marker Event\n"; } 4794 } 4795 4796 /** <CODE>[No Description Provided by Google]</CODE> */ 4797 public static class domContentEventFired 4798 extends BrowserEvent 4799 implements java.io.Serializable 4800 { 4801 /** For Object Serialization. java.io.Serializable */ 4802 protected static final long serialVersionUID = 1; 4803 4804 public boolean[] optionals() 4805 { return new boolean[] { false, }; } 4806 4807 /** <CODE>[No Description Provided by Google]</CODE> */ 4808 public final Number timestamp; 4809 4810 /** 4811 * Constructor 4812 * 4813 * @param timestamp - 4814 */ 4815 public domContentEventFired(Number timestamp) 4816 { 4817 super("Page", "domContentEventFired", 1); 4818 4819 // Exception-Check(s) to ensure that if any parameters which are not declared as 4820 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4821 4822 if (timestamp == null) THROWS.throwNPE("timestamp"); 4823 4824 this.timestamp = timestamp; 4825 } 4826 4827 /** 4828 * JSON Object Constructor 4829 * @param jo A Json-Object having data about an instance of {@code 'domContentEventFired'}. 4830 */ 4831 public domContentEventFired (JsonObject jo) 4832 { 4833 super("Page", "domContentEventFired", 1); 4834 4835 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 4836 } 4837 4838 4839 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4840 public boolean equals(Object other) 4841 { 4842 if (this == other) return true; 4843 if (other == null) return false; 4844 if (other.getClass() != this.getClass()) return false; 4845 4846 domContentEventFired o = (domContentEventFired) other; 4847 4848 return 4849 Objects.equals(this.timestamp, o.timestamp); 4850 } 4851 4852 /** Generates a Hash-Code for {@code 'this'} instance */ 4853 public int hashCode() 4854 { 4855 return 4856 Objects.hashCode(this.timestamp); 4857 } 4858 } 4859 4860 /** Emitted only when {@code page.interceptFileChooser} is enabled. */ 4861 public static class fileChooserOpened 4862 extends BrowserEvent 4863 implements java.io.Serializable 4864 { 4865 /** For Object Serialization. java.io.Serializable */ 4866 protected static final long serialVersionUID = 1; 4867 4868 public boolean[] optionals() 4869 { return new boolean[] { false, false, true, }; } 4870 4871 /** 4872 * Id of the frame containing input node. 4873 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4874 */ 4875 public final String frameId; 4876 4877 /** Input mode. */ 4878 public final String mode; 4879 4880 /** 4881 * Input node id. Only present for file choosers opened via an {@code <input type="file">} element. 4882 * <BR /><B CLASS=Opt>OPTIONAL</B> 4883 <B CLASS=Exp>EXPERIMENTAL</B> 4884 */ 4885 public final Integer backendNodeId; 4886 4887 /** 4888 * Constructor 4889 * 4890 * @param frameId Id of the frame containing input node. 4891 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4892 * 4893 * @param mode Input mode. 4894 * <BR />Acceptable Values: ["selectSingle", "selectMultiple"] 4895 * 4896 * @param backendNodeId Input node id. Only present for file choosers opened via an {@code <input type="file">} element. 4897 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 4898 */ 4899 public fileChooserOpened(String frameId, String mode, Integer backendNodeId) 4900 { 4901 super("Page", "fileChooserOpened", 3); 4902 4903 // Exception-Check(s) to ensure that if any parameters which are not declared as 4904 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4905 4906 if (frameId == null) THROWS.throwNPE("frameId"); 4907 if (mode == null) THROWS.throwNPE("mode"); 4908 4909 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4910 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4911 4912 THROWS.checkIAE( 4913 "mode", mode, 4914 "selectSingle", "selectMultiple" 4915 ); 4916 4917 this.frameId = frameId; 4918 this.mode = mode; 4919 this.backendNodeId = backendNodeId; 4920 } 4921 4922 /** 4923 * JSON Object Constructor 4924 * @param jo A Json-Object having data about an instance of {@code 'fileChooserOpened'}. 4925 */ 4926 public fileChooserOpened (JsonObject jo) 4927 { 4928 super("Page", "fileChooserOpened", 3); 4929 4930 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 4931 this.mode = ReadJSON.getString(jo, "mode", false, true); 4932 this.backendNodeId = ReadBoxedJSON.getInteger(jo, "backendNodeId", true); 4933 } 4934 4935 4936 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4937 public boolean equals(Object other) 4938 { 4939 if (this == other) return true; 4940 if (other == null) return false; 4941 if (other.getClass() != this.getClass()) return false; 4942 4943 fileChooserOpened o = (fileChooserOpened) other; 4944 4945 return 4946 Objects.equals(this.frameId, o.frameId) 4947 && Objects.equals(this.mode, o.mode) 4948 && Objects.equals(this.backendNodeId, o.backendNodeId); 4949 } 4950 4951 /** Generates a Hash-Code for {@code 'this'} instance */ 4952 public int hashCode() 4953 { 4954 return 4955 Objects.hashCode(this.frameId) 4956 + Objects.hashCode(this.mode) 4957 + Objects.hashCode(this.backendNodeId); 4958 } 4959 } 4960 4961 /** Fired when frame has been attached to its parent. */ 4962 public static class frameAttached 4963 extends BrowserEvent 4964 implements java.io.Serializable 4965 { 4966 /** For Object Serialization. java.io.Serializable */ 4967 protected static final long serialVersionUID = 1; 4968 4969 public boolean[] optionals() 4970 { return new boolean[] { false, false, true, }; } 4971 4972 /** Id of the frame that has been attached. */ 4973 public final String frameId; 4974 4975 /** Parent frame identifier. */ 4976 public final String parentFrameId; 4977 4978 /** 4979 * JavaScript stack trace of when frame was attached, only set if frame initiated from script. 4980 * <BR /><B CLASS=Opt>OPTIONAL</B> 4981 */ 4982 public final RunTime.StackTrace stack; 4983 4984 /** 4985 * Constructor 4986 * 4987 * @param frameId Id of the frame that has been attached. 4988 * 4989 * @param parentFrameId Parent frame identifier. 4990 * 4991 * @param stack JavaScript stack trace of when frame was attached, only set if frame initiated from script. 4992 * <BR /><B CLASS=Opt>OPTIONAL</B> 4993 */ 4994 public frameAttached(String frameId, String parentFrameId, RunTime.StackTrace stack) 4995 { 4996 super("Page", "frameAttached", 3); 4997 4998 // Exception-Check(s) to ensure that if any parameters which are not declared as 4999 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5000 5001 if (frameId == null) THROWS.throwNPE("frameId"); 5002 if (parentFrameId == null) THROWS.throwNPE("parentFrameId"); 5003 5004 this.frameId = frameId; 5005 this.parentFrameId = parentFrameId; 5006 this.stack = stack; 5007 } 5008 5009 /** 5010 * JSON Object Constructor 5011 * @param jo A Json-Object having data about an instance of {@code 'frameAttached'}. 5012 */ 5013 public frameAttached (JsonObject jo) 5014 { 5015 super("Page", "frameAttached", 3); 5016 5017 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5018 this.parentFrameId = ReadJSON.getString(jo, "parentFrameId", false, true); 5019 this.stack = ReadJSON.getObject(jo, "stack", RunTime.StackTrace.class, true, false); 5020 } 5021 5022 5023 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5024 public boolean equals(Object other) 5025 { 5026 if (this == other) return true; 5027 if (other == null) return false; 5028 if (other.getClass() != this.getClass()) return false; 5029 5030 frameAttached o = (frameAttached) other; 5031 5032 return 5033 Objects.equals(this.frameId, o.frameId) 5034 && Objects.equals(this.parentFrameId, o.parentFrameId) 5035 && Objects.equals(this.stack, o.stack); 5036 } 5037 5038 /** Generates a Hash-Code for {@code 'this'} instance */ 5039 public int hashCode() 5040 { 5041 return 5042 Objects.hashCode(this.frameId) 5043 + Objects.hashCode(this.parentFrameId) 5044 + this.stack.hashCode(); 5045 } 5046 } 5047 5048 /** 5049 * Fired when frame no longer has a scheduled navigation. 5050 * <BR /><B CLASS=Dep>DEPRECATED</B> 5051 */ 5052 public static class frameClearedScheduledNavigation 5053 extends BrowserEvent 5054 implements java.io.Serializable 5055 { 5056 /** For Object Serialization. java.io.Serializable */ 5057 protected static final long serialVersionUID = 1; 5058 5059 public boolean[] optionals() 5060 { return new boolean[] { false, }; } 5061 5062 /** Id of the frame that has cleared its scheduled navigation. */ 5063 public final String frameId; 5064 5065 /** 5066 * Constructor 5067 * 5068 * @param frameId Id of the frame that has cleared its scheduled navigation. 5069 */ 5070 public frameClearedScheduledNavigation(String frameId) 5071 { 5072 super("Page", "frameClearedScheduledNavigation", 1); 5073 5074 // Exception-Check(s) to ensure that if any parameters which are not declared as 5075 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5076 5077 if (frameId == null) THROWS.throwNPE("frameId"); 5078 5079 this.frameId = frameId; 5080 } 5081 5082 /** 5083 * JSON Object Constructor 5084 * @param jo A Json-Object having data about an instance of {@code 'frameClearedScheduledNavigation'}. 5085 */ 5086 public frameClearedScheduledNavigation (JsonObject jo) 5087 { 5088 super("Page", "frameClearedScheduledNavigation", 1); 5089 5090 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5091 } 5092 5093 5094 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5095 public boolean equals(Object other) 5096 { 5097 if (this == other) return true; 5098 if (other == null) return false; 5099 if (other.getClass() != this.getClass()) return false; 5100 5101 frameClearedScheduledNavigation o = (frameClearedScheduledNavigation) other; 5102 5103 return 5104 Objects.equals(this.frameId, o.frameId); 5105 } 5106 5107 /** Generates a Hash-Code for {@code 'this'} instance */ 5108 public int hashCode() 5109 { 5110 return 5111 Objects.hashCode(this.frameId); 5112 } 5113 } 5114 5115 /** Fired when frame has been detached from its parent. */ 5116 public static class frameDetached 5117 extends BrowserEvent 5118 implements java.io.Serializable 5119 { 5120 /** For Object Serialization. java.io.Serializable */ 5121 protected static final long serialVersionUID = 1; 5122 5123 public boolean[] optionals() 5124 { return new boolean[] { false, false, }; } 5125 5126 /** Id of the frame that has been detached. */ 5127 public final String frameId; 5128 5129 /** 5130 * <CODE>[No Description Provided by Google]</CODE> 5131 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5132 */ 5133 public final String reason; 5134 5135 /** 5136 * Constructor 5137 * 5138 * @param frameId Id of the frame that has been detached. 5139 * 5140 * @param reason - 5141 * <BR />Acceptable Values: ["remove", "swap"] 5142 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5143 */ 5144 public frameDetached(String frameId, String reason) 5145 { 5146 super("Page", "frameDetached", 2); 5147 5148 // Exception-Check(s) to ensure that if any parameters which are not declared as 5149 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5150 5151 if (frameId == null) THROWS.throwNPE("frameId"); 5152 if (reason == null) THROWS.throwNPE("reason"); 5153 5154 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5155 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5156 5157 THROWS.checkIAE( 5158 "reason", reason, 5159 "remove", "swap" 5160 ); 5161 5162 this.frameId = frameId; 5163 this.reason = reason; 5164 } 5165 5166 /** 5167 * JSON Object Constructor 5168 * @param jo A Json-Object having data about an instance of {@code 'frameDetached'}. 5169 */ 5170 public frameDetached (JsonObject jo) 5171 { 5172 super("Page", "frameDetached", 2); 5173 5174 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5175 this.reason = ReadJSON.getString(jo, "reason", false, true); 5176 } 5177 5178 5179 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5180 public boolean equals(Object other) 5181 { 5182 if (this == other) return true; 5183 if (other == null) return false; 5184 if (other.getClass() != this.getClass()) return false; 5185 5186 frameDetached o = (frameDetached) other; 5187 5188 return 5189 Objects.equals(this.frameId, o.frameId) 5190 && Objects.equals(this.reason, o.reason); 5191 } 5192 5193 /** Generates a Hash-Code for {@code 'this'} instance */ 5194 public int hashCode() 5195 { 5196 return 5197 Objects.hashCode(this.frameId) 5198 + Objects.hashCode(this.reason); 5199 } 5200 } 5201 5202 /** 5203 * Fired before frame subtree is detached. Emitted before any frame of the 5204 * subtree is actually detached. 5205 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5206 */ 5207 public static class frameSubtreeWillBeDetached 5208 extends BrowserEvent 5209 implements java.io.Serializable 5210 { 5211 /** For Object Serialization. java.io.Serializable */ 5212 protected static final long serialVersionUID = 1; 5213 5214 public boolean[] optionals() 5215 { return new boolean[] { false, }; } 5216 5217 /** Id of the frame that is the root of the subtree that will be detached. */ 5218 public final String frameId; 5219 5220 /** 5221 * Constructor 5222 * 5223 * @param frameId Id of the frame that is the root of the subtree that will be detached. 5224 */ 5225 public frameSubtreeWillBeDetached(String frameId) 5226 { 5227 super("Page", "frameSubtreeWillBeDetached", 1); 5228 5229 // Exception-Check(s) to ensure that if any parameters which are not declared as 5230 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5231 5232 if (frameId == null) THROWS.throwNPE("frameId"); 5233 5234 this.frameId = frameId; 5235 } 5236 5237 /** 5238 * JSON Object Constructor 5239 * @param jo A Json-Object having data about an instance of {@code 'frameSubtreeWillBeDetached'}. 5240 */ 5241 public frameSubtreeWillBeDetached (JsonObject jo) 5242 { 5243 super("Page", "frameSubtreeWillBeDetached", 1); 5244 5245 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5246 } 5247 5248 5249 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5250 public boolean equals(Object other) 5251 { 5252 if (this == other) return true; 5253 if (other == null) return false; 5254 if (other.getClass() != this.getClass()) return false; 5255 5256 frameSubtreeWillBeDetached o = (frameSubtreeWillBeDetached) other; 5257 5258 return 5259 Objects.equals(this.frameId, o.frameId); 5260 } 5261 5262 /** Generates a Hash-Code for {@code 'this'} instance */ 5263 public int hashCode() 5264 { 5265 return 5266 Objects.hashCode(this.frameId); 5267 } 5268 } 5269 5270 /** Fired once navigation of the frame has completed. Frame is now associated with the new loader. */ 5271 public static class frameNavigated 5272 extends BrowserEvent 5273 implements java.io.Serializable 5274 { 5275 /** For Object Serialization. java.io.Serializable */ 5276 protected static final long serialVersionUID = 1; 5277 5278 public boolean[] optionals() 5279 { return new boolean[] { false, false, }; } 5280 5281 /** Frame object. */ 5282 public final Page.Frame frame; 5283 5284 /** 5285 * <CODE>[No Description Provided by Google]</CODE> 5286 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5287 */ 5288 public final String type; 5289 5290 /** 5291 * Constructor 5292 * 5293 * @param frame Frame object. 5294 * 5295 * @param type - 5296 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5297 */ 5298 public frameNavigated(Page.Frame frame, String type) 5299 { 5300 super("Page", "frameNavigated", 2); 5301 5302 // Exception-Check(s) to ensure that if any parameters which are not declared as 5303 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5304 5305 if (frame == null) THROWS.throwNPE("frame"); 5306 if (type == null) THROWS.throwNPE("type"); 5307 5308 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5309 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5310 5311 THROWS.checkIAE("type", type, "Page.NavigationType", Page.NavigationType); 5312 5313 this.frame = frame; 5314 this.type = type; 5315 } 5316 5317 /** 5318 * JSON Object Constructor 5319 * @param jo A Json-Object having data about an instance of {@code 'frameNavigated'}. 5320 */ 5321 public frameNavigated (JsonObject jo) 5322 { 5323 super("Page", "frameNavigated", 2); 5324 5325 this.frame = ReadJSON.getObject(jo, "frame", Page.Frame.class, false, true); 5326 this.type = ReadJSON.getString(jo, "type", false, true); 5327 } 5328 5329 5330 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5331 public boolean equals(Object other) 5332 { 5333 if (this == other) return true; 5334 if (other == null) return false; 5335 if (other.getClass() != this.getClass()) return false; 5336 5337 frameNavigated o = (frameNavigated) other; 5338 5339 return 5340 Objects.equals(this.frame, o.frame) 5341 && Objects.equals(this.type, o.type); 5342 } 5343 5344 /** Generates a Hash-Code for {@code 'this'} instance */ 5345 public int hashCode() 5346 { 5347 return 5348 this.frame.hashCode() 5349 + Objects.hashCode(this.type); 5350 } 5351 } 5352 5353 /** 5354 * Fired when opening document to write to. 5355 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5356 */ 5357 public static class documentOpened 5358 extends BrowserEvent 5359 implements java.io.Serializable 5360 { 5361 /** For Object Serialization. java.io.Serializable */ 5362 protected static final long serialVersionUID = 1; 5363 5364 public boolean[] optionals() 5365 { return new boolean[] { false, }; } 5366 5367 /** Frame object. */ 5368 public final Page.Frame frame; 5369 5370 /** 5371 * Constructor 5372 * 5373 * @param frame Frame object. 5374 */ 5375 public documentOpened(Page.Frame frame) 5376 { 5377 super("Page", "documentOpened", 1); 5378 5379 // Exception-Check(s) to ensure that if any parameters which are not declared as 5380 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5381 5382 if (frame == null) THROWS.throwNPE("frame"); 5383 5384 this.frame = frame; 5385 } 5386 5387 /** 5388 * JSON Object Constructor 5389 * @param jo A Json-Object having data about an instance of {@code 'documentOpened'}. 5390 */ 5391 public documentOpened (JsonObject jo) 5392 { 5393 super("Page", "documentOpened", 1); 5394 5395 this.frame = ReadJSON.getObject(jo, "frame", Page.Frame.class, false, true); 5396 } 5397 5398 5399 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5400 public boolean equals(Object other) 5401 { 5402 if (this == other) return true; 5403 if (other == null) return false; 5404 if (other.getClass() != this.getClass()) return false; 5405 5406 documentOpened o = (documentOpened) other; 5407 5408 return 5409 Objects.equals(this.frame, o.frame); 5410 } 5411 5412 /** Generates a Hash-Code for {@code 'this'} instance */ 5413 public int hashCode() 5414 { 5415 return 5416 this.frame.hashCode(); 5417 } 5418 } 5419 5420 /** 5421 * Fired when a navigation starts. This event is fired for both 5422 * renderer-initiated and browser-initiated navigations. For renderer-initiated 5423 * navigations, the event is fired after {@code frameRequestedNavigation}. 5424 * Navigation may still be cancelled after the event is issued. Multiple events 5425 * can be fired for a single navigation, for example, when a same-document 5426 * navigation becomes a cross-document navigation (such as in the case of a 5427 * frameset). 5428 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5429 */ 5430 public static class frameStartedNavigating 5431 extends BrowserEvent 5432 implements java.io.Serializable 5433 { 5434 /** For Object Serialization. java.io.Serializable */ 5435 protected static final long serialVersionUID = 1; 5436 5437 public boolean[] optionals() 5438 { return new boolean[] { false, false, false, false, }; } 5439 5440 /** ID of the frame that is being navigated. */ 5441 public final String frameId; 5442 5443 /** The URL the navigation started with. The final URL can be different. */ 5444 public final String url; 5445 5446 /** 5447 * Loader identifier. Even though it is present in case of same-document 5448 * navigation, the previously committed loaderId would not change unless 5449 * the navigation changes from a same-document to a cross-document 5450 * navigation. 5451 */ 5452 public final String loaderId; 5453 5454 /** <CODE>[No Description Provided by Google]</CODE> */ 5455 public final String navigationType; 5456 5457 /** 5458 * Constructor 5459 * 5460 * @param frameId ID of the frame that is being navigated. 5461 * 5462 * @param url The URL the navigation started with. The final URL can be different. 5463 * 5464 * @param loaderId 5465 * Loader identifier. Even though it is present in case of same-document 5466 * navigation, the previously committed loaderId would not change unless 5467 * the navigation changes from a same-document to a cross-document 5468 * navigation. 5469 * 5470 * @param navigationType - 5471 * <BR />Acceptable Values: ["reload", "reloadBypassingCache", "restore", "restoreWithPost", "historySameDocument", "historyDifferentDocument", "sameDocument", "differentDocument"] 5472 */ 5473 public frameStartedNavigating 5474 (String frameId, String url, String loaderId, String navigationType) 5475 { 5476 super("Page", "frameStartedNavigating", 4); 5477 5478 // Exception-Check(s) to ensure that if any parameters which are not declared as 5479 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5480 5481 if (frameId == null) THROWS.throwNPE("frameId"); 5482 if (url == null) THROWS.throwNPE("url"); 5483 if (loaderId == null) THROWS.throwNPE("loaderId"); 5484 if (navigationType == null) THROWS.throwNPE("navigationType"); 5485 5486 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5487 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5488 5489 THROWS.checkIAE( 5490 "navigationType", navigationType, 5491 "reload", "reloadBypassingCache", "restore", "restoreWithPost", "historySameDocument", "historyDifferentDocument", "sameDocument", "differentDocument" 5492 ); 5493 5494 this.frameId = frameId; 5495 this.url = url; 5496 this.loaderId = loaderId; 5497 this.navigationType = navigationType; 5498 } 5499 5500 /** 5501 * JSON Object Constructor 5502 * @param jo A Json-Object having data about an instance of {@code 'frameStartedNavigating'}. 5503 */ 5504 public frameStartedNavigating (JsonObject jo) 5505 { 5506 super("Page", "frameStartedNavigating", 4); 5507 5508 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5509 this.url = ReadJSON.getString(jo, "url", false, true); 5510 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 5511 this.navigationType = ReadJSON.getString(jo, "navigationType", false, true); 5512 } 5513 5514 5515 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5516 public boolean equals(Object other) 5517 { 5518 if (this == other) return true; 5519 if (other == null) return false; 5520 if (other.getClass() != this.getClass()) return false; 5521 5522 frameStartedNavigating o = (frameStartedNavigating) other; 5523 5524 return 5525 Objects.equals(this.frameId, o.frameId) 5526 && Objects.equals(this.url, o.url) 5527 && Objects.equals(this.loaderId, o.loaderId) 5528 && Objects.equals(this.navigationType, o.navigationType); 5529 } 5530 5531 /** Generates a Hash-Code for {@code 'this'} instance */ 5532 public int hashCode() 5533 { 5534 return 5535 Objects.hashCode(this.frameId) 5536 + Objects.hashCode(this.url) 5537 + Objects.hashCode(this.loaderId) 5538 + Objects.hashCode(this.navigationType); 5539 } 5540 } 5541 5542 /** 5543 * Fired when a renderer-initiated navigation is requested. 5544 * Navigation may still be cancelled after the event is issued. 5545 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5546 */ 5547 public static class frameRequestedNavigation 5548 extends BrowserEvent 5549 implements java.io.Serializable 5550 { 5551 /** For Object Serialization. java.io.Serializable */ 5552 protected static final long serialVersionUID = 1; 5553 5554 public boolean[] optionals() 5555 { return new boolean[] { false, false, false, false, }; } 5556 5557 /** Id of the frame that is being navigated. */ 5558 public final String frameId; 5559 5560 /** The reason for the navigation. */ 5561 public final String reason; 5562 5563 /** The destination URL for the requested navigation. */ 5564 public final String url; 5565 5566 /** The disposition for the navigation. */ 5567 public final String disposition; 5568 5569 /** 5570 * Constructor 5571 * 5572 * @param frameId Id of the frame that is being navigated. 5573 * 5574 * @param reason The reason for the navigation. 5575 * 5576 * @param url The destination URL for the requested navigation. 5577 * 5578 * @param disposition The disposition for the navigation. 5579 */ 5580 public frameRequestedNavigation 5581 (String frameId, String reason, String url, String disposition) 5582 { 5583 super("Page", "frameRequestedNavigation", 4); 5584 5585 // Exception-Check(s) to ensure that if any parameters which are not declared as 5586 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5587 5588 if (frameId == null) THROWS.throwNPE("frameId"); 5589 if (reason == null) THROWS.throwNPE("reason"); 5590 if (url == null) THROWS.throwNPE("url"); 5591 if (disposition == null) THROWS.throwNPE("disposition"); 5592 5593 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5594 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5595 5596 THROWS.checkIAE("reason", reason, "Page.ClientNavigationReason", Page.ClientNavigationReason); 5597 THROWS.checkIAE("disposition", disposition, "Page.ClientNavigationDisposition", Page.ClientNavigationDisposition); 5598 5599 this.frameId = frameId; 5600 this.reason = reason; 5601 this.url = url; 5602 this.disposition = disposition; 5603 } 5604 5605 /** 5606 * JSON Object Constructor 5607 * @param jo A Json-Object having data about an instance of {@code 'frameRequestedNavigation'}. 5608 */ 5609 public frameRequestedNavigation (JsonObject jo) 5610 { 5611 super("Page", "frameRequestedNavigation", 4); 5612 5613 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5614 this.reason = ReadJSON.getString(jo, "reason", false, true); 5615 this.url = ReadJSON.getString(jo, "url", false, true); 5616 this.disposition = ReadJSON.getString(jo, "disposition", false, true); 5617 } 5618 5619 5620 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5621 public boolean equals(Object other) 5622 { 5623 if (this == other) return true; 5624 if (other == null) return false; 5625 if (other.getClass() != this.getClass()) return false; 5626 5627 frameRequestedNavigation o = (frameRequestedNavigation) other; 5628 5629 return 5630 Objects.equals(this.frameId, o.frameId) 5631 && Objects.equals(this.reason, o.reason) 5632 && Objects.equals(this.url, o.url) 5633 && Objects.equals(this.disposition, o.disposition); 5634 } 5635 5636 /** Generates a Hash-Code for {@code 'this'} instance */ 5637 public int hashCode() 5638 { 5639 return 5640 Objects.hashCode(this.frameId) 5641 + Objects.hashCode(this.reason) 5642 + Objects.hashCode(this.url) 5643 + Objects.hashCode(this.disposition); 5644 } 5645 } 5646 5647 /** 5648 * Fired when frame schedules a potential navigation. 5649 * <BR /><B CLASS=Dep>DEPRECATED</B> 5650 */ 5651 public static class frameScheduledNavigation 5652 extends BrowserEvent 5653 implements java.io.Serializable 5654 { 5655 /** For Object Serialization. java.io.Serializable */ 5656 protected static final long serialVersionUID = 1; 5657 5658 public boolean[] optionals() 5659 { return new boolean[] { false, false, false, false, }; } 5660 5661 /** Id of the frame that has scheduled a navigation. */ 5662 public final String frameId; 5663 5664 /** 5665 * Delay (in seconds) until the navigation is scheduled to begin. The navigation is not 5666 * guaranteed to start. 5667 */ 5668 public final Number delay; 5669 5670 /** The reason for the navigation. */ 5671 public final String reason; 5672 5673 /** The destination URL for the scheduled navigation. */ 5674 public final String url; 5675 5676 /** 5677 * Constructor 5678 * 5679 * @param frameId Id of the frame that has scheduled a navigation. 5680 * 5681 * @param delay 5682 * Delay (in seconds) until the navigation is scheduled to begin. The navigation is not 5683 * guaranteed to start. 5684 * 5685 * @param reason The reason for the navigation. 5686 * 5687 * @param url The destination URL for the scheduled navigation. 5688 */ 5689 public frameScheduledNavigation(String frameId, Number delay, String reason, String url) 5690 { 5691 super("Page", "frameScheduledNavigation", 4); 5692 5693 // Exception-Check(s) to ensure that if any parameters which are not declared as 5694 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5695 5696 if (frameId == null) THROWS.throwNPE("frameId"); 5697 if (delay == null) THROWS.throwNPE("delay"); 5698 if (reason == null) THROWS.throwNPE("reason"); 5699 if (url == null) THROWS.throwNPE("url"); 5700 5701 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5702 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5703 5704 THROWS.checkIAE("reason", reason, "Page.ClientNavigationReason", Page.ClientNavigationReason); 5705 5706 this.frameId = frameId; 5707 this.delay = delay; 5708 this.reason = reason; 5709 this.url = url; 5710 } 5711 5712 /** 5713 * JSON Object Constructor 5714 * @param jo A Json-Object having data about an instance of {@code 'frameScheduledNavigation'}. 5715 */ 5716 public frameScheduledNavigation (JsonObject jo) 5717 { 5718 super("Page", "frameScheduledNavigation", 4); 5719 5720 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5721 this.delay = ReadNumberJSON.get(jo, "delay", false, true); 5722 this.reason = ReadJSON.getString(jo, "reason", false, true); 5723 this.url = ReadJSON.getString(jo, "url", false, true); 5724 } 5725 5726 5727 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5728 public boolean equals(Object other) 5729 { 5730 if (this == other) return true; 5731 if (other == null) return false; 5732 if (other.getClass() != this.getClass()) return false; 5733 5734 frameScheduledNavigation o = (frameScheduledNavigation) other; 5735 5736 return 5737 Objects.equals(this.frameId, o.frameId) 5738 && Objects.equals(this.delay, o.delay) 5739 && Objects.equals(this.reason, o.reason) 5740 && Objects.equals(this.url, o.url); 5741 } 5742 5743 /** Generates a Hash-Code for {@code 'this'} instance */ 5744 public int hashCode() 5745 { 5746 return 5747 Objects.hashCode(this.frameId) 5748 + Objects.hashCode(this.delay) 5749 + Objects.hashCode(this.reason) 5750 + Objects.hashCode(this.url); 5751 } 5752 } 5753 5754 /** 5755 * Fired when frame has started loading. 5756 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5757 */ 5758 public static class frameStartedLoading 5759 extends BrowserEvent 5760 implements java.io.Serializable 5761 { 5762 /** For Object Serialization. java.io.Serializable */ 5763 protected static final long serialVersionUID = 1; 5764 5765 public boolean[] optionals() 5766 { return new boolean[] { false, }; } 5767 5768 /** Id of the frame that has started loading. */ 5769 public final String frameId; 5770 5771 /** 5772 * Constructor 5773 * 5774 * @param frameId Id of the frame that has started loading. 5775 */ 5776 public frameStartedLoading(String frameId) 5777 { 5778 super("Page", "frameStartedLoading", 1); 5779 5780 // Exception-Check(s) to ensure that if any parameters which are not declared as 5781 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5782 5783 if (frameId == null) THROWS.throwNPE("frameId"); 5784 5785 this.frameId = frameId; 5786 } 5787 5788 /** 5789 * JSON Object Constructor 5790 * @param jo A Json-Object having data about an instance of {@code 'frameStartedLoading'}. 5791 */ 5792 public frameStartedLoading (JsonObject jo) 5793 { 5794 super("Page", "frameStartedLoading", 1); 5795 5796 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5797 } 5798 5799 5800 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5801 public boolean equals(Object other) 5802 { 5803 if (this == other) return true; 5804 if (other == null) return false; 5805 if (other.getClass() != this.getClass()) return false; 5806 5807 frameStartedLoading o = (frameStartedLoading) other; 5808 5809 return 5810 Objects.equals(this.frameId, o.frameId); 5811 } 5812 5813 /** Generates a Hash-Code for {@code 'this'} instance */ 5814 public int hashCode() 5815 { 5816 return 5817 Objects.hashCode(this.frameId); 5818 } 5819 } 5820 5821 /** 5822 * Fired when frame has stopped loading. 5823 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5824 */ 5825 public static class frameStoppedLoading 5826 extends BrowserEvent 5827 implements java.io.Serializable 5828 { 5829 /** For Object Serialization. java.io.Serializable */ 5830 protected static final long serialVersionUID = 1; 5831 5832 public boolean[] optionals() 5833 { return new boolean[] { false, }; } 5834 5835 /** Id of the frame that has stopped loading. */ 5836 public final String frameId; 5837 5838 /** 5839 * Constructor 5840 * 5841 * @param frameId Id of the frame that has stopped loading. 5842 */ 5843 public frameStoppedLoading(String frameId) 5844 { 5845 super("Page", "frameStoppedLoading", 1); 5846 5847 // Exception-Check(s) to ensure that if any parameters which are not declared as 5848 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5849 5850 if (frameId == null) THROWS.throwNPE("frameId"); 5851 5852 this.frameId = frameId; 5853 } 5854 5855 /** 5856 * JSON Object Constructor 5857 * @param jo A Json-Object having data about an instance of {@code 'frameStoppedLoading'}. 5858 */ 5859 public frameStoppedLoading (JsonObject jo) 5860 { 5861 super("Page", "frameStoppedLoading", 1); 5862 5863 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5864 } 5865 5866 5867 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5868 public boolean equals(Object other) 5869 { 5870 if (this == other) return true; 5871 if (other == null) return false; 5872 if (other.getClass() != this.getClass()) return false; 5873 5874 frameStoppedLoading o = (frameStoppedLoading) other; 5875 5876 return 5877 Objects.equals(this.frameId, o.frameId); 5878 } 5879 5880 /** Generates a Hash-Code for {@code 'this'} instance */ 5881 public int hashCode() 5882 { 5883 return 5884 Objects.hashCode(this.frameId); 5885 } 5886 } 5887 5888 /** 5889 * Fired when page is about to start a download. 5890 * Deprecated. Use Browser.downloadWillBegin instead. 5891 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5892 <B CLASS=Dep>DEPRECATED</B> 5893 */ 5894 public static class downloadWillBegin 5895 extends BrowserEvent 5896 implements java.io.Serializable 5897 { 5898 /** For Object Serialization. java.io.Serializable */ 5899 protected static final long serialVersionUID = 1; 5900 5901 public boolean[] optionals() 5902 { return new boolean[] { false, false, false, false, }; } 5903 5904 /** Id of the frame that caused download to begin. */ 5905 public final String frameId; 5906 5907 /** Global unique identifier of the download. */ 5908 public final String guid; 5909 5910 /** URL of the resource being downloaded. */ 5911 public final String url; 5912 5913 /** Suggested file name of the resource (the actual name of the file saved on disk may differ). */ 5914 public final String suggestedFilename; 5915 5916 /** 5917 * Constructor 5918 * 5919 * @param frameId Id of the frame that caused download to begin. 5920 * 5921 * @param guid Global unique identifier of the download. 5922 * 5923 * @param url URL of the resource being downloaded. 5924 * 5925 * @param suggestedFilename Suggested file name of the resource (the actual name of the file saved on disk may differ). 5926 */ 5927 public downloadWillBegin 5928 (String frameId, String guid, String url, String suggestedFilename) 5929 { 5930 super("Page", "downloadWillBegin", 4); 5931 5932 // Exception-Check(s) to ensure that if any parameters which are not declared as 5933 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5934 5935 if (frameId == null) THROWS.throwNPE("frameId"); 5936 if (guid == null) THROWS.throwNPE("guid"); 5937 if (url == null) THROWS.throwNPE("url"); 5938 if (suggestedFilename == null) THROWS.throwNPE("suggestedFilename"); 5939 5940 this.frameId = frameId; 5941 this.guid = guid; 5942 this.url = url; 5943 this.suggestedFilename = suggestedFilename; 5944 } 5945 5946 /** 5947 * JSON Object Constructor 5948 * @param jo A Json-Object having data about an instance of {@code 'downloadWillBegin'}. 5949 */ 5950 public downloadWillBegin (JsonObject jo) 5951 { 5952 super("Page", "downloadWillBegin", 4); 5953 5954 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 5955 this.guid = ReadJSON.getString(jo, "guid", false, true); 5956 this.url = ReadJSON.getString(jo, "url", false, true); 5957 this.suggestedFilename = ReadJSON.getString(jo, "suggestedFilename", false, true); 5958 } 5959 5960 5961 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5962 public boolean equals(Object other) 5963 { 5964 if (this == other) return true; 5965 if (other == null) return false; 5966 if (other.getClass() != this.getClass()) return false; 5967 5968 downloadWillBegin o = (downloadWillBegin) other; 5969 5970 return 5971 Objects.equals(this.frameId, o.frameId) 5972 && Objects.equals(this.guid, o.guid) 5973 && Objects.equals(this.url, o.url) 5974 && Objects.equals(this.suggestedFilename, o.suggestedFilename); 5975 } 5976 5977 /** Generates a Hash-Code for {@code 'this'} instance */ 5978 public int hashCode() 5979 { 5980 return 5981 Objects.hashCode(this.frameId) 5982 + Objects.hashCode(this.guid) 5983 + Objects.hashCode(this.url) 5984 + Objects.hashCode(this.suggestedFilename); 5985 } 5986 } 5987 5988 /** 5989 * Fired when download makes progress. Last call has |done| == true. 5990 * Deprecated. Use Browser.downloadProgress instead. 5991 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5992 <B CLASS=Dep>DEPRECATED</B> 5993 */ 5994 public static class downloadProgress 5995 extends BrowserEvent 5996 implements java.io.Serializable 5997 { 5998 /** For Object Serialization. java.io.Serializable */ 5999 protected static final long serialVersionUID = 1; 6000 6001 public boolean[] optionals() 6002 { return new boolean[] { false, false, false, false, }; } 6003 6004 /** Global unique identifier of the download. */ 6005 public final String guid; 6006 6007 /** Total expected bytes to download. */ 6008 public final Number totalBytes; 6009 6010 /** Total bytes received. */ 6011 public final Number receivedBytes; 6012 6013 /** Download status. */ 6014 public final String state; 6015 6016 /** 6017 * Constructor 6018 * 6019 * @param guid Global unique identifier of the download. 6020 * 6021 * @param totalBytes Total expected bytes to download. 6022 * 6023 * @param receivedBytes Total bytes received. 6024 * 6025 * @param state Download status. 6026 * <BR />Acceptable Values: ["inProgress", "completed", "canceled"] 6027 */ 6028 public downloadProgress 6029 (String guid, Number totalBytes, Number receivedBytes, String state) 6030 { 6031 super("Page", "downloadProgress", 4); 6032 6033 // Exception-Check(s) to ensure that if any parameters which are not declared as 6034 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6035 6036 if (guid == null) THROWS.throwNPE("guid"); 6037 if (totalBytes == null) THROWS.throwNPE("totalBytes"); 6038 if (receivedBytes == null) THROWS.throwNPE("receivedBytes"); 6039 if (state == null) THROWS.throwNPE("state"); 6040 6041 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6042 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6043 6044 THROWS.checkIAE( 6045 "state", state, 6046 "inProgress", "completed", "canceled" 6047 ); 6048 6049 this.guid = guid; 6050 this.totalBytes = totalBytes; 6051 this.receivedBytes = receivedBytes; 6052 this.state = state; 6053 } 6054 6055 /** 6056 * JSON Object Constructor 6057 * @param jo A Json-Object having data about an instance of {@code 'downloadProgress'}. 6058 */ 6059 public downloadProgress (JsonObject jo) 6060 { 6061 super("Page", "downloadProgress", 4); 6062 6063 this.guid = ReadJSON.getString(jo, "guid", false, true); 6064 this.totalBytes = ReadNumberJSON.get(jo, "totalBytes", false, true); 6065 this.receivedBytes = ReadNumberJSON.get(jo, "receivedBytes", false, true); 6066 this.state = ReadJSON.getString(jo, "state", false, true); 6067 } 6068 6069 6070 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6071 public boolean equals(Object other) 6072 { 6073 if (this == other) return true; 6074 if (other == null) return false; 6075 if (other.getClass() != this.getClass()) return false; 6076 6077 downloadProgress o = (downloadProgress) other; 6078 6079 return 6080 Objects.equals(this.guid, o.guid) 6081 && Objects.equals(this.totalBytes, o.totalBytes) 6082 && Objects.equals(this.receivedBytes, o.receivedBytes) 6083 && Objects.equals(this.state, o.state); 6084 } 6085 6086 /** Generates a Hash-Code for {@code 'this'} instance */ 6087 public int hashCode() 6088 { 6089 return 6090 Objects.hashCode(this.guid) 6091 + Objects.hashCode(this.totalBytes) 6092 + Objects.hashCode(this.receivedBytes) 6093 + Objects.hashCode(this.state); 6094 } 6095 } 6096 6097 /** 6098 * Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been 6099 * closed. 6100 */ 6101 public static class javascriptDialogClosed 6102 extends BrowserEvent 6103 implements java.io.Serializable 6104 { 6105 /** For Object Serialization. java.io.Serializable */ 6106 protected static final long serialVersionUID = 1; 6107 6108 public boolean[] optionals() 6109 { return new boolean[] { false, false, false, }; } 6110 6111 /** 6112 * Frame id. 6113 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6114 */ 6115 public final String frameId; 6116 6117 /** Whether dialog was confirmed. */ 6118 public final boolean result; 6119 6120 /** User input in case of prompt. */ 6121 public final String userInput; 6122 6123 /** 6124 * Constructor 6125 * 6126 * @param frameId Frame id. 6127 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6128 * 6129 * @param result Whether dialog was confirmed. 6130 * 6131 * @param userInput User input in case of prompt. 6132 */ 6133 public javascriptDialogClosed(String frameId, boolean result, String userInput) 6134 { 6135 super("Page", "javascriptDialogClosed", 3); 6136 6137 // Exception-Check(s) to ensure that if any parameters which are not declared as 6138 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6139 6140 if (frameId == null) THROWS.throwNPE("frameId"); 6141 if (userInput == null) THROWS.throwNPE("userInput"); 6142 6143 this.frameId = frameId; 6144 this.result = result; 6145 this.userInput = userInput; 6146 } 6147 6148 /** 6149 * JSON Object Constructor 6150 * @param jo A Json-Object having data about an instance of {@code 'javascriptDialogClosed'}. 6151 */ 6152 public javascriptDialogClosed (JsonObject jo) 6153 { 6154 super("Page", "javascriptDialogClosed", 3); 6155 6156 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 6157 this.result = ReadPrimJSON.getBoolean(jo, "result"); 6158 this.userInput = ReadJSON.getString(jo, "userInput", false, true); 6159 } 6160 6161 6162 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6163 public boolean equals(Object other) 6164 { 6165 if (this == other) return true; 6166 if (other == null) return false; 6167 if (other.getClass() != this.getClass()) return false; 6168 6169 javascriptDialogClosed o = (javascriptDialogClosed) other; 6170 6171 return 6172 Objects.equals(this.frameId, o.frameId) 6173 && (this.result == o.result) 6174 && Objects.equals(this.userInput, o.userInput); 6175 } 6176 6177 /** Generates a Hash-Code for {@code 'this'} instance */ 6178 public int hashCode() 6179 { 6180 return 6181 Objects.hashCode(this.frameId) 6182 + (this.result ? 1 : 0) 6183 + Objects.hashCode(this.userInput); 6184 } 6185 } 6186 6187 /** 6188 * Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to 6189 * open. 6190 */ 6191 public static class javascriptDialogOpening 6192 extends BrowserEvent 6193 implements java.io.Serializable 6194 { 6195 /** For Object Serialization. java.io.Serializable */ 6196 protected static final long serialVersionUID = 1; 6197 6198 public boolean[] optionals() 6199 { return new boolean[] { false, false, false, false, false, true, }; } 6200 6201 /** Frame url. */ 6202 public final String url; 6203 6204 /** 6205 * Frame id. 6206 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6207 */ 6208 public final String frameId; 6209 6210 /** Message that will be displayed by the dialog. */ 6211 public final String message; 6212 6213 /** Dialog type. */ 6214 public final String type; 6215 6216 /** 6217 * True iff browser is capable showing or acting on the given dialog. When browser has no 6218 * dialog handler for given target, calling alert while Page domain is engaged will stall 6219 * the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog. 6220 */ 6221 public final boolean hasBrowserHandler; 6222 6223 /** 6224 * Default dialog prompt. 6225 * <BR /><B CLASS=Opt>OPTIONAL</B> 6226 */ 6227 public final String defaultPrompt; 6228 6229 /** 6230 * Constructor 6231 * 6232 * @param url Frame url. 6233 * 6234 * @param frameId Frame id. 6235 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6236 * 6237 * @param message Message that will be displayed by the dialog. 6238 * 6239 * @param type Dialog type. 6240 * 6241 * @param hasBrowserHandler 6242 * True iff browser is capable showing or acting on the given dialog. When browser has no 6243 * dialog handler for given target, calling alert while Page domain is engaged will stall 6244 * the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog. 6245 * 6246 * @param defaultPrompt Default dialog prompt. 6247 * <BR /><B CLASS=Opt>OPTIONAL</B> 6248 */ 6249 public javascriptDialogOpening( 6250 String url, String frameId, String message, String type, boolean hasBrowserHandler, 6251 String defaultPrompt 6252 ) 6253 { 6254 super("Page", "javascriptDialogOpening", 6); 6255 6256 // Exception-Check(s) to ensure that if any parameters which are not declared as 6257 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6258 6259 if (url == null) THROWS.throwNPE("url"); 6260 if (frameId == null) THROWS.throwNPE("frameId"); 6261 if (message == null) THROWS.throwNPE("message"); 6262 if (type == null) THROWS.throwNPE("type"); 6263 6264 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6265 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6266 6267 THROWS.checkIAE("type", type, "Page.DialogType", Page.DialogType); 6268 6269 this.url = url; 6270 this.frameId = frameId; 6271 this.message = message; 6272 this.type = type; 6273 this.hasBrowserHandler = hasBrowserHandler; 6274 this.defaultPrompt = defaultPrompt; 6275 } 6276 6277 /** 6278 * JSON Object Constructor 6279 * @param jo A Json-Object having data about an instance of {@code 'javascriptDialogOpening'}. 6280 */ 6281 public javascriptDialogOpening (JsonObject jo) 6282 { 6283 super("Page", "javascriptDialogOpening", 6); 6284 6285 this.url = ReadJSON.getString(jo, "url", false, true); 6286 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 6287 this.message = ReadJSON.getString(jo, "message", false, true); 6288 this.type = ReadJSON.getString(jo, "type", false, true); 6289 this.hasBrowserHandler = ReadPrimJSON.getBoolean(jo, "hasBrowserHandler"); 6290 this.defaultPrompt = ReadJSON.getString(jo, "defaultPrompt", true, false); 6291 } 6292 6293 6294 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6295 public boolean equals(Object other) 6296 { 6297 if (this == other) return true; 6298 if (other == null) return false; 6299 if (other.getClass() != this.getClass()) return false; 6300 6301 javascriptDialogOpening o = (javascriptDialogOpening) other; 6302 6303 return 6304 Objects.equals(this.url, o.url) 6305 && Objects.equals(this.frameId, o.frameId) 6306 && Objects.equals(this.message, o.message) 6307 && Objects.equals(this.type, o.type) 6308 && (this.hasBrowserHandler == o.hasBrowserHandler) 6309 && Objects.equals(this.defaultPrompt, o.defaultPrompt); 6310 } 6311 6312 /** Generates a Hash-Code for {@code 'this'} instance */ 6313 public int hashCode() 6314 { 6315 return 6316 Objects.hashCode(this.url) 6317 + Objects.hashCode(this.frameId) 6318 + Objects.hashCode(this.message) 6319 + Objects.hashCode(this.type) 6320 + (this.hasBrowserHandler ? 1 : 0) 6321 + Objects.hashCode(this.defaultPrompt); 6322 } 6323 } 6324 6325 /** 6326 * Fired for lifecycle events (navigation, load, paint, etc) in the current 6327 * target (including local frames). 6328 */ 6329 public static class lifecycleEvent 6330 extends BrowserEvent 6331 implements java.io.Serializable 6332 { 6333 /** For Object Serialization. java.io.Serializable */ 6334 protected static final long serialVersionUID = 1; 6335 6336 public boolean[] optionals() 6337 { return new boolean[] { false, false, false, false, }; } 6338 6339 /** Id of the frame. */ 6340 public final String frameId; 6341 6342 /** Loader identifier. Empty string if the request is fetched from worker. */ 6343 public final String loaderId; 6344 6345 /** <CODE>[No Description Provided by Google]</CODE> */ 6346 public final String name; 6347 6348 /** <CODE>[No Description Provided by Google]</CODE> */ 6349 public final Number timestamp; 6350 6351 /** 6352 * Constructor 6353 * 6354 * @param frameId Id of the frame. 6355 * 6356 * @param loaderId Loader identifier. Empty string if the request is fetched from worker. 6357 * 6358 * @param name - 6359 * 6360 * @param timestamp - 6361 */ 6362 public lifecycleEvent(String frameId, String loaderId, String name, Number timestamp) 6363 { 6364 super("Page", "lifecycleEvent", 4); 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 (frameId == null) THROWS.throwNPE("frameId"); 6370 if (loaderId == null) THROWS.throwNPE("loaderId"); 6371 if (name == null) THROWS.throwNPE("name"); 6372 if (timestamp == null) THROWS.throwNPE("timestamp"); 6373 6374 this.frameId = frameId; 6375 this.loaderId = loaderId; 6376 this.name = name; 6377 this.timestamp = timestamp; 6378 } 6379 6380 /** 6381 * JSON Object Constructor 6382 * @param jo A Json-Object having data about an instance of {@code 'lifecycleEvent'}. 6383 */ 6384 public lifecycleEvent (JsonObject jo) 6385 { 6386 super("Page", "lifecycleEvent", 4); 6387 6388 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 6389 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 6390 this.name = ReadJSON.getString(jo, "name", false, true); 6391 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 6392 } 6393 6394 6395 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6396 public boolean equals(Object other) 6397 { 6398 if (this == other) return true; 6399 if (other == null) return false; 6400 if (other.getClass() != this.getClass()) return false; 6401 6402 lifecycleEvent o = (lifecycleEvent) other; 6403 6404 return 6405 Objects.equals(this.frameId, o.frameId) 6406 && Objects.equals(this.loaderId, o.loaderId) 6407 && Objects.equals(this.name, o.name) 6408 && Objects.equals(this.timestamp, o.timestamp); 6409 } 6410 6411 /** Generates a Hash-Code for {@code 'this'} instance */ 6412 public int hashCode() 6413 { 6414 return 6415 Objects.hashCode(this.frameId) 6416 + Objects.hashCode(this.loaderId) 6417 + Objects.hashCode(this.name) 6418 + Objects.hashCode(this.timestamp); 6419 } 6420 } 6421 6422 /** 6423 * Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do 6424 * not assume any ordering with the Page.frameNavigated event. This event is fired only for 6425 * main-frame history navigation where the document changes (non-same-document navigations), 6426 * when bfcache navigation fails. 6427 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6428 */ 6429 public static class backForwardCacheNotUsed 6430 extends BrowserEvent 6431 implements java.io.Serializable 6432 { 6433 /** For Object Serialization. java.io.Serializable */ 6434 protected static final long serialVersionUID = 1; 6435 6436 public boolean[] optionals() 6437 { return new boolean[] { false, false, false, true, }; } 6438 6439 /** The loader id for the associated navigation. */ 6440 public final String loaderId; 6441 6442 /** The frame id of the associated frame. */ 6443 public final String frameId; 6444 6445 /** Array of reasons why the page could not be cached. This must not be empty. */ 6446 public final Page.BackForwardCacheNotRestoredExplanation[] notRestoredExplanations; 6447 6448 /** 6449 * Tree structure of reasons why the page could not be cached for each frame. 6450 * <BR /><B CLASS=Opt>OPTIONAL</B> 6451 */ 6452 public final Page.BackForwardCacheNotRestoredExplanationTree notRestoredExplanationsTree; 6453 6454 /** 6455 * Constructor 6456 * 6457 * @param loaderId The loader id for the associated navigation. 6458 * 6459 * @param frameId The frame id of the associated frame. 6460 * 6461 * @param notRestoredExplanations Array of reasons why the page could not be cached. This must not be empty. 6462 * 6463 * @param notRestoredExplanationsTree Tree structure of reasons why the page could not be cached for each frame. 6464 * <BR /><B CLASS=Opt>OPTIONAL</B> 6465 */ 6466 public backForwardCacheNotUsed( 6467 String loaderId, String frameId, 6468 Page.BackForwardCacheNotRestoredExplanation[] notRestoredExplanations, 6469 Page.BackForwardCacheNotRestoredExplanationTree notRestoredExplanationsTree 6470 ) 6471 { 6472 super("Page", "backForwardCacheNotUsed", 4); 6473 6474 // Exception-Check(s) to ensure that if any parameters which are not declared as 6475 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6476 6477 if (loaderId == null) THROWS.throwNPE("loaderId"); 6478 if (frameId == null) THROWS.throwNPE("frameId"); 6479 if (notRestoredExplanations == null) THROWS.throwNPE("notRestoredExplanations"); 6480 6481 this.loaderId = loaderId; 6482 this.frameId = frameId; 6483 this.notRestoredExplanations = notRestoredExplanations; 6484 this.notRestoredExplanationsTree = notRestoredExplanationsTree; 6485 } 6486 6487 /** 6488 * JSON Object Constructor 6489 * @param jo A Json-Object having data about an instance of {@code 'backForwardCacheNotUsed'}. 6490 */ 6491 public backForwardCacheNotUsed (JsonObject jo) 6492 { 6493 super("Page", "backForwardCacheNotUsed", 4); 6494 6495 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 6496 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 6497 this.notRestoredExplanations = (jo.getJsonArray("notRestoredExplanations") == null) 6498 ? null 6499 : RJArrIntoStream.objArr(jo.getJsonArray("notRestoredExplanations"), null, 0, Page.BackForwardCacheNotRestoredExplanation.class).toArray(Page.BackForwardCacheNotRestoredExplanation[]::new); 6500 6501 this.notRestoredExplanationsTree = ReadJSON.getObject(jo, "notRestoredExplanationsTree", Page.BackForwardCacheNotRestoredExplanationTree.class, true, false); 6502 } 6503 6504 6505 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6506 public boolean equals(Object other) 6507 { 6508 if (this == other) return true; 6509 if (other == null) return false; 6510 if (other.getClass() != this.getClass()) return false; 6511 6512 backForwardCacheNotUsed o = (backForwardCacheNotUsed) other; 6513 6514 return 6515 Objects.equals(this.loaderId, o.loaderId) 6516 && Objects.equals(this.frameId, o.frameId) 6517 && Arrays.deepEquals(this.notRestoredExplanations, o.notRestoredExplanations) 6518 && Objects.equals(this.notRestoredExplanationsTree, o.notRestoredExplanationsTree); 6519 } 6520 6521 /** Generates a Hash-Code for {@code 'this'} instance */ 6522 public int hashCode() 6523 { 6524 return 6525 Objects.hashCode(this.loaderId) 6526 + Objects.hashCode(this.frameId) 6527 + Arrays.deepHashCode(this.notRestoredExplanations) 6528 + this.notRestoredExplanationsTree.hashCode(); 6529 } 6530 } 6531 6532 /** <CODE>[No Description Provided by Google]</CODE> */ 6533 public static class loadEventFired 6534 extends BrowserEvent 6535 implements java.io.Serializable 6536 { 6537 /** For Object Serialization. java.io.Serializable */ 6538 protected static final long serialVersionUID = 1; 6539 6540 public boolean[] optionals() 6541 { return new boolean[] { false, }; } 6542 6543 /** <CODE>[No Description Provided by Google]</CODE> */ 6544 public final Number timestamp; 6545 6546 /** 6547 * Constructor 6548 * 6549 * @param timestamp - 6550 */ 6551 public loadEventFired(Number timestamp) 6552 { 6553 super("Page", "loadEventFired", 1); 6554 6555 // Exception-Check(s) to ensure that if any parameters which are not declared as 6556 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6557 6558 if (timestamp == null) THROWS.throwNPE("timestamp"); 6559 6560 this.timestamp = timestamp; 6561 } 6562 6563 /** 6564 * JSON Object Constructor 6565 * @param jo A Json-Object having data about an instance of {@code 'loadEventFired'}. 6566 */ 6567 public loadEventFired (JsonObject jo) 6568 { 6569 super("Page", "loadEventFired", 1); 6570 6571 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 6572 } 6573 6574 6575 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6576 public boolean equals(Object other) 6577 { 6578 if (this == other) return true; 6579 if (other == null) return false; 6580 if (other.getClass() != this.getClass()) return false; 6581 6582 loadEventFired o = (loadEventFired) other; 6583 6584 return 6585 Objects.equals(this.timestamp, o.timestamp); 6586 } 6587 6588 /** Generates a Hash-Code for {@code 'this'} instance */ 6589 public int hashCode() 6590 { 6591 return 6592 Objects.hashCode(this.timestamp); 6593 } 6594 } 6595 6596 /** 6597 * Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. 6598 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6599 */ 6600 public static class navigatedWithinDocument 6601 extends BrowserEvent 6602 implements java.io.Serializable 6603 { 6604 /** For Object Serialization. java.io.Serializable */ 6605 protected static final long serialVersionUID = 1; 6606 6607 public boolean[] optionals() 6608 { return new boolean[] { false, false, false, }; } 6609 6610 /** Id of the frame. */ 6611 public final String frameId; 6612 6613 /** Frame's new url. */ 6614 public final String url; 6615 6616 /** Navigation type */ 6617 public final String navigationType; 6618 6619 /** 6620 * Constructor 6621 * 6622 * @param frameId Id of the frame. 6623 * 6624 * @param url Frame's new url. 6625 * 6626 * @param navigationType Navigation type 6627 * <BR />Acceptable Values: ["fragment", "historyApi", "other"] 6628 */ 6629 public navigatedWithinDocument(String frameId, String url, String navigationType) 6630 { 6631 super("Page", "navigatedWithinDocument", 3); 6632 6633 // Exception-Check(s) to ensure that if any parameters which are not declared as 6634 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6635 6636 if (frameId == null) THROWS.throwNPE("frameId"); 6637 if (url == null) THROWS.throwNPE("url"); 6638 if (navigationType == null) THROWS.throwNPE("navigationType"); 6639 6640 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6641 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6642 6643 THROWS.checkIAE( 6644 "navigationType", navigationType, 6645 "fragment", "historyApi", "other" 6646 ); 6647 6648 this.frameId = frameId; 6649 this.url = url; 6650 this.navigationType = navigationType; 6651 } 6652 6653 /** 6654 * JSON Object Constructor 6655 * @param jo A Json-Object having data about an instance of {@code 'navigatedWithinDocument'}. 6656 */ 6657 public navigatedWithinDocument (JsonObject jo) 6658 { 6659 super("Page", "navigatedWithinDocument", 3); 6660 6661 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 6662 this.url = ReadJSON.getString(jo, "url", false, true); 6663 this.navigationType = ReadJSON.getString(jo, "navigationType", false, true); 6664 } 6665 6666 6667 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6668 public boolean equals(Object other) 6669 { 6670 if (this == other) return true; 6671 if (other == null) return false; 6672 if (other.getClass() != this.getClass()) return false; 6673 6674 navigatedWithinDocument o = (navigatedWithinDocument) other; 6675 6676 return 6677 Objects.equals(this.frameId, o.frameId) 6678 && Objects.equals(this.url, o.url) 6679 && Objects.equals(this.navigationType, o.navigationType); 6680 } 6681 6682 /** Generates a Hash-Code for {@code 'this'} instance */ 6683 public int hashCode() 6684 { 6685 return 6686 Objects.hashCode(this.frameId) 6687 + Objects.hashCode(this.url) 6688 + Objects.hashCode(this.navigationType); 6689 } 6690 } 6691 6692 /** 6693 * Compressed image data requested by the {@code startScreencast}. 6694 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6695 */ 6696 public static class screencastFrame 6697 extends BrowserEvent 6698 implements java.io.Serializable 6699 { 6700 /** For Object Serialization. java.io.Serializable */ 6701 protected static final long serialVersionUID = 1; 6702 6703 public boolean[] optionals() 6704 { return new boolean[] { false, false, false, }; } 6705 6706 /** Base64-encoded compressed image. (Encoded as a base64 string when passed over JSON) */ 6707 public final String data; 6708 6709 /** Screencast frame metadata. */ 6710 public final Page.ScreencastFrameMetadata metadata; 6711 6712 /** Frame number. */ 6713 public final int sessionId; 6714 6715 /** 6716 * Constructor 6717 * 6718 * @param data Base64-encoded compressed image. (Encoded as a base64 string when passed over JSON) 6719 * 6720 * @param metadata Screencast frame metadata. 6721 * 6722 * @param sessionId Frame number. 6723 */ 6724 public screencastFrame 6725 (String data, Page.ScreencastFrameMetadata metadata, int sessionId) 6726 { 6727 super("Page", "screencastFrame", 3); 6728 6729 // Exception-Check(s) to ensure that if any parameters which are not declared as 6730 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6731 6732 if (data == null) THROWS.throwNPE("data"); 6733 if (metadata == null) THROWS.throwNPE("metadata"); 6734 6735 this.data = data; 6736 this.metadata = metadata; 6737 this.sessionId = sessionId; 6738 } 6739 6740 /** 6741 * JSON Object Constructor 6742 * @param jo A Json-Object having data about an instance of {@code 'screencastFrame'}. 6743 */ 6744 public screencastFrame (JsonObject jo) 6745 { 6746 super("Page", "screencastFrame", 3); 6747 6748 this.data = ReadJSON.getString(jo, "data", false, true); 6749 this.metadata = ReadJSON.getObject(jo, "metadata", Page.ScreencastFrameMetadata.class, false, true); 6750 this.sessionId = ReadPrimJSON.getInt(jo, "sessionId"); 6751 } 6752 6753 6754 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6755 public boolean equals(Object other) 6756 { 6757 if (this == other) return true; 6758 if (other == null) return false; 6759 if (other.getClass() != this.getClass()) return false; 6760 6761 screencastFrame o = (screencastFrame) other; 6762 6763 return 6764 Objects.equals(this.data, o.data) 6765 && Objects.equals(this.metadata, o.metadata) 6766 && (this.sessionId == o.sessionId); 6767 } 6768 6769 /** Generates a Hash-Code for {@code 'this'} instance */ 6770 public int hashCode() 6771 { 6772 return 6773 Objects.hashCode(this.data) 6774 + this.metadata.hashCode() 6775 + this.sessionId; 6776 } 6777 } 6778 6779 /** 6780 * Fired when the page with currently enabled screencast was shown or hidden. 6781 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6782 */ 6783 public static class screencastVisibilityChanged 6784 extends BrowserEvent 6785 implements java.io.Serializable 6786 { 6787 /** For Object Serialization. java.io.Serializable */ 6788 protected static final long serialVersionUID = 1; 6789 6790 public boolean[] optionals() 6791 { return new boolean[] { false, }; } 6792 6793 /** True if the page is visible. */ 6794 public final boolean visible; 6795 6796 /** 6797 * Constructor 6798 * 6799 * @param visible True if the page is visible. 6800 */ 6801 public screencastVisibilityChanged(boolean visible) 6802 { 6803 super("Page", "screencastVisibilityChanged", 1); 6804 6805 this.visible = visible; 6806 } 6807 6808 /** 6809 * JSON Object Constructor 6810 * @param jo A Json-Object having data about an instance of {@code 'screencastVisibilityChanged'}. 6811 */ 6812 public screencastVisibilityChanged (JsonObject jo) 6813 { 6814 super("Page", "screencastVisibilityChanged", 1); 6815 6816 this.visible = ReadPrimJSON.getBoolean(jo, "visible"); 6817 } 6818 6819 6820 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6821 public boolean equals(Object other) 6822 { 6823 if (this == other) return true; 6824 if (other == null) return false; 6825 if (other.getClass() != this.getClass()) return false; 6826 6827 screencastVisibilityChanged o = (screencastVisibilityChanged) other; 6828 6829 return 6830 (this.visible == o.visible); 6831 } 6832 6833 /** Generates a Hash-Code for {@code 'this'} instance */ 6834 public int hashCode() 6835 { 6836 return 6837 (this.visible ? 1 : 0); 6838 } 6839 } 6840 6841 /** 6842 * Fired when a new window is going to be opened, via window.open(), link click, form submission, 6843 * etc. 6844 */ 6845 public static class windowOpen 6846 extends BrowserEvent 6847 implements java.io.Serializable 6848 { 6849 /** For Object Serialization. java.io.Serializable */ 6850 protected static final long serialVersionUID = 1; 6851 6852 public boolean[] optionals() 6853 { return new boolean[] { false, false, false, false, }; } 6854 6855 /** The URL for the new window. */ 6856 public final String url; 6857 6858 /** Window name. */ 6859 public final String windowName; 6860 6861 /** An array of enabled window features. */ 6862 public final String[] windowFeatures; 6863 6864 /** Whether or not it was triggered by user gesture. */ 6865 public final boolean userGesture; 6866 6867 /** 6868 * Constructor 6869 * 6870 * @param url The URL for the new window. 6871 * 6872 * @param windowName Window name. 6873 * 6874 * @param windowFeatures An array of enabled window features. 6875 * 6876 * @param userGesture Whether or not it was triggered by user gesture. 6877 */ 6878 public windowOpen 6879 (String url, String windowName, String[] windowFeatures, boolean userGesture) 6880 { 6881 super("Page", "windowOpen", 4); 6882 6883 // Exception-Check(s) to ensure that if any parameters which are not declared as 6884 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6885 6886 if (url == null) THROWS.throwNPE("url"); 6887 if (windowName == null) THROWS.throwNPE("windowName"); 6888 if (windowFeatures == null) THROWS.throwNPE("windowFeatures"); 6889 6890 this.url = url; 6891 this.windowName = windowName; 6892 this.windowFeatures = windowFeatures; 6893 this.userGesture = userGesture; 6894 } 6895 6896 /** 6897 * JSON Object Constructor 6898 * @param jo A Json-Object having data about an instance of {@code 'windowOpen'}. 6899 */ 6900 public windowOpen (JsonObject jo) 6901 { 6902 super("Page", "windowOpen", 4); 6903 6904 this.url = ReadJSON.getString(jo, "url", false, true); 6905 this.windowName = ReadJSON.getString(jo, "windowName", false, true); 6906 this.windowFeatures = (jo.getJsonArray("windowFeatures") == null) 6907 ? null 6908 : RJArrIntoStream.strArr(jo.getJsonArray("windowFeatures"), null, 0).toArray(String[]::new); 6909 6910 this.userGesture = ReadPrimJSON.getBoolean(jo, "userGesture"); 6911 } 6912 6913 6914 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6915 public boolean equals(Object other) 6916 { 6917 if (this == other) return true; 6918 if (other == null) return false; 6919 if (other.getClass() != this.getClass()) return false; 6920 6921 windowOpen o = (windowOpen) other; 6922 6923 return 6924 Objects.equals(this.url, o.url) 6925 && Objects.equals(this.windowName, o.windowName) 6926 && Arrays.deepEquals(this.windowFeatures, o.windowFeatures) 6927 && (this.userGesture == o.userGesture); 6928 } 6929 6930 /** Generates a Hash-Code for {@code 'this'} instance */ 6931 public int hashCode() 6932 { 6933 return 6934 Objects.hashCode(this.url) 6935 + Objects.hashCode(this.windowName) 6936 + Arrays.deepHashCode(this.windowFeatures) 6937 + (this.userGesture ? 1 : 0); 6938 } 6939 } 6940 6941 /** 6942 * Issued for every compilation cache generated. 6943 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6944 */ 6945 public static class compilationCacheProduced 6946 extends BrowserEvent 6947 implements java.io.Serializable 6948 { 6949 /** For Object Serialization. java.io.Serializable */ 6950 protected static final long serialVersionUID = 1; 6951 6952 public boolean[] optionals() 6953 { return new boolean[] { false, false, }; } 6954 6955 /** <CODE>[No Description Provided by Google]</CODE> */ 6956 public final String url; 6957 6958 /** Base64-encoded data (Encoded as a base64 string when passed over JSON) */ 6959 public final String data; 6960 6961 /** 6962 * Constructor 6963 * 6964 * @param url - 6965 * 6966 * @param data Base64-encoded data (Encoded as a base64 string when passed over JSON) 6967 */ 6968 public compilationCacheProduced(String url, String data) 6969 { 6970 super("Page", "compilationCacheProduced", 2); 6971 6972 // Exception-Check(s) to ensure that if any parameters which are not declared as 6973 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6974 6975 if (url == null) THROWS.throwNPE("url"); 6976 if (data == null) THROWS.throwNPE("data"); 6977 6978 this.url = url; 6979 this.data = data; 6980 } 6981 6982 /** 6983 * JSON Object Constructor 6984 * @param jo A Json-Object having data about an instance of {@code 'compilationCacheProduced'}. 6985 */ 6986 public compilationCacheProduced (JsonObject jo) 6987 { 6988 super("Page", "compilationCacheProduced", 2); 6989 6990 this.url = ReadJSON.getString(jo, "url", false, true); 6991 this.data = ReadJSON.getString(jo, "data", false, true); 6992 } 6993 6994 6995 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6996 public boolean equals(Object other) 6997 { 6998 if (this == other) return true; 6999 if (other == null) return false; 7000 if (other.getClass() != this.getClass()) return false; 7001 7002 compilationCacheProduced o = (compilationCacheProduced) other; 7003 7004 return 7005 Objects.equals(this.url, o.url) 7006 && Objects.equals(this.data, o.data); 7007 } 7008 7009 /** Generates a Hash-Code for {@code 'this'} instance */ 7010 public int hashCode() 7011 { 7012 return 7013 Objects.hashCode(this.url) 7014 + Objects.hashCode(this.data); 7015 } 7016 } 7017 7018 7019 // Counter for keeping the WebSocket Request ID's distinct. 7020 private static int counter = 1; 7021 7022 /** 7023 * Deprecated, please use addScriptToEvaluateOnNewDocument instead. 7024 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 7025 * 7026 * @param scriptSource - 7027 * 7028 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7029 * String></CODE> 7030 * 7031 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7032 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7033 * String></CODE> will be returned. 7034 * 7035 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7036 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7037 * may be retrieved.</I> 7038 * 7039 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7040 * <BR /><BR /><UL CLASS=JDUL> 7041 * <LI><CODE>String (<B>identifier</B></CODE>) 7042 * <BR />Identifier of the added script. 7043 * </LI> 7044 * </UL> */ 7045 public static Script<String, JsonObject, String> addScriptToEvaluateOnLoad 7046 (String scriptSource) 7047 { 7048 // Exception-Check(s) to ensure that if any parameters which are not declared as 7049 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7050 7051 if (scriptSource == null) THROWS.throwNPE("scriptSource"); 7052 7053 final int webSocketID = 35000000 + counter++; 7054 final boolean[] optionals = { false, }; 7055 7056 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7057 String requestJSON = WriteJSON.get( 7058 parameterTypes.get("addScriptToEvaluateOnLoad"), 7059 parameterNames.get("addScriptToEvaluateOnLoad"), 7060 optionals, webSocketID, 7061 "Page.addScriptToEvaluateOnLoad", 7062 scriptSource 7063 ); 7064 7065 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 7066 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 7067 ReadJSON.getString(jo, "identifier", false, true); 7068 7069 return new Script<>(webSocketID, requestJSON, responseProcessor); 7070 } 7071 7072 /** 7073 * Evaluates given script in every frame upon creation (before loading frame's scripts). 7074 * 7075 * @param source - 7076 * 7077 * @param worldName 7078 * If specified, creates an isolated world with the given name and evaluates given script in it. 7079 * This world name will be used as the ExecutionContextDescription::name when the corresponding 7080 * event is emitted. 7081 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 7082 * 7083 * @param includeCommandLineAPI 7084 * Specifies whether command line API should be available to the script, defaults 7085 * to false. 7086 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 7087 * 7088 * @param runImmediately 7089 * If true, runs the script immediately on existing execution contexts or worlds. 7090 * Default: false. 7091 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 7092 * 7093 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7094 * String></CODE> 7095 * 7096 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7097 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7098 * String></CODE> will be returned. 7099 * 7100 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7101 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7102 * may be retrieved.</I> 7103 * 7104 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7105 * <BR /><BR /><UL CLASS=JDUL> 7106 * <LI><CODE>String (<B>identifier</B></CODE>) 7107 * <BR />Identifier of the added script. 7108 * </LI> 7109 * </UL> */ 7110 public static Script<String, JsonObject, String> addScriptToEvaluateOnNewDocument 7111 (String source, String worldName, Boolean includeCommandLineAPI, Boolean runImmediately) 7112 { 7113 // Exception-Check(s) to ensure that if any parameters which are not declared as 7114 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7115 7116 if (source == null) THROWS.throwNPE("source"); 7117 7118 final int webSocketID = 35001000 + counter++; 7119 final boolean[] optionals = { false, true, true, true, }; 7120 7121 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7122 String requestJSON = WriteJSON.get( 7123 parameterTypes.get("addScriptToEvaluateOnNewDocument"), 7124 parameterNames.get("addScriptToEvaluateOnNewDocument"), 7125 optionals, webSocketID, 7126 "Page.addScriptToEvaluateOnNewDocument", 7127 source, worldName, includeCommandLineAPI, runImmediately 7128 ); 7129 7130 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 7131 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 7132 ReadJSON.getString(jo, "identifier", false, true); 7133 7134 return new Script<>(webSocketID, requestJSON, responseProcessor); 7135 } 7136 7137 /** 7138 * Brings page to front (activates tab). 7139 * 7140 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7141 * {@link Ret0}></CODE> 7142 * 7143 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7144 * browser receives the invocation-request. 7145 * 7146 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7147 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7148 * {@code >} to ensure the Browser Function has run to completion. 7149 */ 7150 public static Script<String, JsonObject, Ret0> bringToFront() 7151 { 7152 final int webSocketID = 35002000 + counter++; 7153 final boolean[] optionals = new boolean[0]; 7154 7155 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7156 String requestJSON = WriteJSON.get( 7157 parameterTypes.get("bringToFront"), 7158 parameterNames.get("bringToFront"), 7159 optionals, webSocketID, 7160 "Page.bringToFront" 7161 ); 7162 7163 // This Remote Command does not have a Return-Value. 7164 return new Script<> 7165 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7166 } 7167 7168 /** 7169 * Capture page screenshot. 7170 * 7171 * @param format Image compression format (defaults to png). 7172 * <BR />Acceptable Values: ["jpeg", "png", "webp"] 7173 * <BR /><B CLASS=Opt>OPTIONAL</B> 7174 * 7175 * @param quality Compression quality from range [0..100] (jpeg only). 7176 * <BR /><B CLASS=Opt>OPTIONAL</B> 7177 * 7178 * @param clip Capture the screenshot of a given region only. 7179 * <BR /><B CLASS=Opt>OPTIONAL</B> 7180 * 7181 * @param fromSurface Capture the screenshot from the surface, rather than the view. Defaults to true. 7182 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 7183 * 7184 * @param captureBeyondViewport Capture the screenshot beyond the viewport. Defaults to false. 7185 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 7186 * 7187 * @param optimizeForSpeed Optimize image encoding for speed, not for resulting size (defaults to false) 7188 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 7189 * 7190 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7191 * String></CODE> 7192 * 7193 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7194 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7195 * String></CODE> will be returned. 7196 * 7197 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7198 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7199 * may be retrieved.</I> 7200 * 7201 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7202 * <BR /><BR /><UL CLASS=JDUL> 7203 * <LI><CODE>String (<B>data</B></CODE>) 7204 * <BR />Base64-encoded image data. (Encoded as a base64 string when passed over JSON) 7205 * </LI> 7206 * </UL> */ 7207 public static Script<String, JsonObject, String> captureScreenshot( 7208 String format, Integer quality, Page.Viewport clip, Boolean fromSurface, 7209 Boolean captureBeyondViewport, Boolean optimizeForSpeed 7210 ) 7211 { 7212 // Exception-Check(s) to ensure that if any parameters which must adhere to a 7213 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 7214 7215 THROWS.checkIAE( 7216 "format", format, 7217 "jpeg", "png", "webp" 7218 ); 7219 7220 final int webSocketID = 35003000 + counter++; 7221 final boolean[] optionals = { true, true, true, true, true, true, }; 7222 7223 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7224 String requestJSON = WriteJSON.get( 7225 parameterTypes.get("captureScreenshot"), 7226 parameterNames.get("captureScreenshot"), 7227 optionals, webSocketID, 7228 "Page.captureScreenshot", 7229 format, quality, clip, fromSurface, captureBeyondViewport, optimizeForSpeed 7230 ); 7231 7232 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 7233 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 7234 ReadJSON.getString(jo, "data", false, true); 7235 7236 return new Script<>(webSocketID, requestJSON, responseProcessor); 7237 } 7238 7239 /** 7240 * Returns a snapshot of the page as a string. For MHTML format, the serialization includes 7241 * iframes, shadow DOM, external resources, and element-inline styles. 7242 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 7243 * 7244 * @param format Format (defaults to mhtml). 7245 * <BR />Acceptable Values: ["mhtml"] 7246 * <BR /><B CLASS=Opt>OPTIONAL</B> 7247 * 7248 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7249 * String></CODE> 7250 * 7251 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7252 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7253 * String></CODE> will be returned. 7254 * 7255 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7256 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7257 * may be retrieved.</I> 7258 * 7259 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7260 * <BR /><BR /><UL CLASS=JDUL> 7261 * <LI><CODE>String (<B>data</B></CODE>) 7262 * <BR />Serialized page data. 7263 * </LI> 7264 * </UL> */ 7265 public static Script<String, JsonObject, String> captureSnapshot(String format) 7266 { 7267 // Exception-Check(s) to ensure that if any parameters which must adhere to a 7268 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 7269 7270 THROWS.checkIAE( 7271 "format", format, 7272 "mhtml" 7273 ); 7274 7275 final int webSocketID = 35004000 + counter++; 7276 final boolean[] optionals = { true, }; 7277 7278 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7279 String requestJSON = WriteJSON.get( 7280 parameterTypes.get("captureSnapshot"), 7281 parameterNames.get("captureSnapshot"), 7282 optionals, webSocketID, 7283 "Page.captureSnapshot", 7284 format 7285 ); 7286 7287 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 7288 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 7289 ReadJSON.getString(jo, "data", false, true); 7290 7291 return new Script<>(webSocketID, requestJSON, responseProcessor); 7292 } 7293 7294 /** 7295 * Clears the overridden device metrics. 7296 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 7297 * 7298 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7299 * {@link Ret0}></CODE> 7300 * 7301 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7302 * browser receives the invocation-request. 7303 * 7304 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7305 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7306 * {@code >} to ensure the Browser Function has run to completion. 7307 */ 7308 public static Script<String, JsonObject, Ret0> clearDeviceMetricsOverride() 7309 { 7310 final int webSocketID = 35005000 + counter++; 7311 final boolean[] optionals = new boolean[0]; 7312 7313 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7314 String requestJSON = WriteJSON.get( 7315 parameterTypes.get("clearDeviceMetricsOverride"), 7316 parameterNames.get("clearDeviceMetricsOverride"), 7317 optionals, webSocketID, 7318 "Page.clearDeviceMetricsOverride" 7319 ); 7320 7321 // This Remote Command does not have a Return-Value. 7322 return new Script<> 7323 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7324 } 7325 7326 /** 7327 * Clears the overridden Device Orientation. 7328 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 7329 * 7330 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7331 * {@link Ret0}></CODE> 7332 * 7333 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7334 * browser receives the invocation-request. 7335 * 7336 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7337 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7338 * {@code >} to ensure the Browser Function has run to completion. 7339 */ 7340 public static Script<String, JsonObject, Ret0> clearDeviceOrientationOverride() 7341 { 7342 final int webSocketID = 35006000 + counter++; 7343 final boolean[] optionals = new boolean[0]; 7344 7345 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7346 String requestJSON = WriteJSON.get( 7347 parameterTypes.get("clearDeviceOrientationOverride"), 7348 parameterNames.get("clearDeviceOrientationOverride"), 7349 optionals, webSocketID, 7350 "Page.clearDeviceOrientationOverride" 7351 ); 7352 7353 // This Remote Command does not have a Return-Value. 7354 return new Script<> 7355 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7356 } 7357 7358 /** 7359 * Clears the overridden Geolocation Position and Error. 7360 * <BR /><B CLASS=Dep-Top>DEPRECATED</B> 7361 * 7362 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7363 * {@link Ret0}></CODE> 7364 * 7365 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7366 * browser receives the invocation-request. 7367 * 7368 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7369 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7370 * {@code >} to ensure the Browser Function has run to completion. 7371 */ 7372 public static Script<String, JsonObject, Ret0> clearGeolocationOverride() 7373 { 7374 final int webSocketID = 35007000 + counter++; 7375 final boolean[] optionals = new boolean[0]; 7376 7377 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7378 String requestJSON = WriteJSON.get( 7379 parameterTypes.get("clearGeolocationOverride"), 7380 parameterNames.get("clearGeolocationOverride"), 7381 optionals, webSocketID, 7382 "Page.clearGeolocationOverride" 7383 ); 7384 7385 // This Remote Command does not have a Return-Value. 7386 return new Script<> 7387 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7388 } 7389 7390 /** 7391 * Creates an isolated world for the given frame. 7392 * 7393 * @param frameId Id of the frame in which the isolated world should be created. 7394 * 7395 * @param worldName An optional name which is reported in the Execution Context. 7396 * <BR /><B CLASS=Opt>OPTIONAL</B> 7397 * 7398 * @param grantUniveralAccess 7399 * Whether or not universal access should be granted to the isolated world. This is a powerful 7400 * option, use with caution. 7401 * <BR /><B CLASS=Opt>OPTIONAL</B> 7402 * 7403 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7404 * Integer></CODE> 7405 * 7406 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7407 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7408 * Integer></CODE> will be returned. 7409 * 7410 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7411 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7412 * may be retrieved.</I> 7413 * 7414 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7415 * <BR /><BR /><UL CLASS=JDUL> 7416 * <LI><CODE>Integer (<B>executionContextId</B></CODE>) 7417 * <BR />Execution context of the isolated world. 7418 * </LI> 7419 * </UL> */ 7420 public static Script<String, JsonObject, Integer> createIsolatedWorld 7421 (String frameId, String worldName, Boolean grantUniveralAccess) 7422 { 7423 // Exception-Check(s) to ensure that if any parameters which are not declared as 7424 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7425 7426 if (frameId == null) THROWS.throwNPE("frameId"); 7427 7428 final int webSocketID = 35008000 + counter++; 7429 final boolean[] optionals = { false, true, true, }; 7430 7431 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7432 String requestJSON = WriteJSON.get( 7433 parameterTypes.get("createIsolatedWorld"), 7434 parameterNames.get("createIsolatedWorld"), 7435 optionals, webSocketID, 7436 "Page.createIsolatedWorld", 7437 frameId, worldName, grantUniveralAccess 7438 ); 7439 7440 // 'JSON Binding' ... Converts Browser Response-JSON to 'Integer' 7441 Function<JsonObject, Integer> responseProcessor = (JsonObject jo) -> 7442 ReadBoxedJSON.getInteger(jo, "executionContextId", true); 7443 7444 return new Script<>(webSocketID, requestJSON, responseProcessor); 7445 } 7446 7447 /** 7448 * Deletes browser cookie with given name, domain and path. 7449 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 7450 * 7451 * @param cookieName Name of the cookie to remove. 7452 * 7453 * @param url URL to match cooke domain and path. 7454 * 7455 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7456 * {@link Ret0}></CODE> 7457 * 7458 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7459 * browser receives the invocation-request. 7460 * 7461 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7462 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7463 * {@code >} to ensure the Browser Function has run to completion. 7464 */ 7465 public static Script<String, JsonObject, Ret0> deleteCookie(String cookieName, String url) 7466 { 7467 // Exception-Check(s) to ensure that if any parameters which are not declared as 7468 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7469 7470 if (cookieName == null) THROWS.throwNPE("cookieName"); 7471 if (url == null) THROWS.throwNPE("url"); 7472 7473 final int webSocketID = 35009000 + counter++; 7474 final boolean[] optionals = { false, false, }; 7475 7476 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7477 String requestJSON = WriteJSON.get( 7478 parameterTypes.get("deleteCookie"), 7479 parameterNames.get("deleteCookie"), 7480 optionals, webSocketID, 7481 "Page.deleteCookie", 7482 cookieName, url 7483 ); 7484 7485 // This Remote Command does not have a Return-Value. 7486 return new Script<> 7487 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7488 } 7489 7490 /** 7491 * Disables page domain notifications. 7492 * 7493 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7494 * {@link Ret0}></CODE> 7495 * 7496 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7497 * browser receives the invocation-request. 7498 * 7499 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7500 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7501 * {@code >} to ensure the Browser Function has run to completion. 7502 */ 7503 public static Script<String, JsonObject, Ret0> disable() 7504 { 7505 final int webSocketID = 35010000 + counter++; 7506 final boolean[] optionals = new boolean[0]; 7507 7508 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7509 String requestJSON = WriteJSON.get( 7510 parameterTypes.get("disable"), 7511 parameterNames.get("disable"), 7512 optionals, webSocketID, 7513 "Page.disable" 7514 ); 7515 7516 // This Remote Command does not have a Return-Value. 7517 return new Script<> 7518 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7519 } 7520 7521 /** 7522 * Enables page domain notifications. 7523 * 7524 * @param enableFileChooserOpenedEvent 7525 * If true, the {@code Page.fileChooserOpened} event will be emitted regardless of the state set by 7526 * {@code Page.setInterceptFileChooserDialog} command (default: false). 7527 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 7528 * 7529 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7530 * {@link Ret0}></CODE> 7531 * 7532 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7533 * browser receives the invocation-request. 7534 * 7535 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7536 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7537 * {@code >} to ensure the Browser Function has run to completion. 7538 */ 7539 public static Script<String, JsonObject, Ret0> enable(Boolean enableFileChooserOpenedEvent) 7540 { 7541 final int webSocketID = 35011000 + counter++; 7542 final boolean[] optionals = { true, }; 7543 7544 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7545 String requestJSON = WriteJSON.get( 7546 parameterTypes.get("enable"), 7547 parameterNames.get("enable"), 7548 optionals, webSocketID, 7549 "Page.enable", 7550 enableFileChooserOpenedEvent 7551 ); 7552 7553 // This Remote Command does not have a Return-Value. 7554 return new Script<> 7555 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 7556 } 7557 7558 /** 7559 * Gets the processed manifest for this current document. 7560 * This API always waits for the manifest to be loaded. 7561 * If manifestId is provided, and it does not match the manifest of the 7562 * current document, this API errors out. 7563 * If there is not a loaded page, this API errors out immediately. 7564 * 7565 * @param manifestId - 7566 * <BR /><B CLASS=Opt>OPTIONAL</B> 7567 * 7568 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7569 * {@link Ret5}></CODE> 7570 * 7571 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 7572 * {@link Script#exec()}), and a {@link Promise} returned. 7573 * 7574 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 7575 * (using {@link Promise#await()}), the {@code Ret5} will subsequently 7576 * be returned from that call. 7577 * 7578 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 7579 * in an instance of <B>{@link Ret5}</B> 7580 * 7581 * <BR /><BR /><UL CLASS=JDUL> 7582 * <LI><CODE><B>Ret5.a:</B> String (<B>url</B>)</CODE> 7583 * <BR />Manifest location. 7584 * <BR /><BR /></LI> 7585 * <LI><CODE><B>Ret5.b:</B> {@link Page.AppManifestError}[] (<B>errors</B>)</CODE> 7586 * <BR />- 7587 * <BR /><BR /></LI> 7588 * <LI><CODE><B>Ret5.c:</B> String (<B>data</B>)</CODE> 7589 * <BR />Manifest content. 7590 * <BR /><BR /></LI> 7591 * <LI><CODE><B>Ret5.d:</B> {@link Page.AppManifestParsedProperties} (<B>parsed</B>)</CODE> 7592 * <BR />Parsed manifest properties. Deprecated, use manifest instead. 7593 * <BR /><BR /></LI> 7594 * <LI><CODE><B>Ret5.e:</B> {@link Page.WebAppManifest} (<B>manifest</B>)</CODE> 7595 * <BR />- 7596 * </LI> 7597 * </UL> 7598 */ 7599 public static Script<String, JsonObject, Ret5<String, Page.AppManifestError[], String, Page.AppManifestParsedProperties, Page.WebAppManifest>> 7600 getAppManifest(String manifestId) 7601 { 7602 final int webSocketID = 35012000 + counter++; 7603 final boolean[] optionals = { true, }; 7604 7605 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7606 String requestJSON = WriteJSON.get( 7607 parameterTypes.get("getAppManifest"), 7608 parameterNames.get("getAppManifest"), 7609 optionals, webSocketID, 7610 "Page.getAppManifest", 7611 manifestId 7612 ); 7613 7614 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret5' 7615 Function<JsonObject, Ret5<String, Page.AppManifestError[], String, Page.AppManifestParsedProperties, Page.WebAppManifest>> 7616 responseProcessor = (JsonObject jo) -> new Ret5<>( 7617 ReadJSON.getString(jo, "url", false, true), 7618 (jo.getJsonArray("errors") == null) 7619 ? null 7620 : RJArrIntoStream.objArr(jo.getJsonArray("errors"), null, 0, Page.AppManifestError.class).toArray(Page.AppManifestError[]::new), 7621 ReadJSON.getString(jo, "data", true, false), 7622 ReadJSON.getObject(jo, "parsed", Page.AppManifestParsedProperties.class, true, false), 7623 ReadJSON.getObject(jo, "manifest", Page.WebAppManifest.class, false, true) 7624 ); 7625 7626 return new Script<>(webSocketID, requestJSON, responseProcessor); 7627 } 7628 7629 /** 7630 * <CODE>[No Description Provided by Google]</CODE> 7631 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 7632 * 7633 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7634 * {@link Page.InstallabilityError}[]></CODE> 7635 * 7636 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7637 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7638 * {@link Page.InstallabilityError}[]></CODE> will be returned. 7639 * 7640 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7641 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7642 * may be retrieved.</I> 7643 * 7644 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7645 * <BR /><BR /><UL CLASS=JDUL> 7646 * <LI><CODE>{@link Page.InstallabilityError}[] (<B>installabilityErrors</B></CODE>) 7647 * <BR />- 7648 * </LI> 7649 * </UL> */ 7650 public static Script<String, JsonObject, Page.InstallabilityError[]> getInstallabilityErrors() 7651 { 7652 final int webSocketID = 35013000 + counter++; 7653 final boolean[] optionals = new boolean[0]; 7654 7655 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7656 String requestJSON = WriteJSON.get( 7657 parameterTypes.get("getInstallabilityErrors"), 7658 parameterNames.get("getInstallabilityErrors"), 7659 optionals, webSocketID, 7660 "Page.getInstallabilityErrors" 7661 ); 7662 7663 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.InstallabilityError[]' 7664 Function<JsonObject, Page.InstallabilityError[]> responseProcessor = (JsonObject jo) -> 7665 (jo.getJsonArray("installabilityErrors") == null) 7666 ? null 7667 : RJArrIntoStream.objArr(jo.getJsonArray("installabilityErrors"), null, 0, Page.InstallabilityError.class).toArray(Page.InstallabilityError[]::new); 7668 7669 return new Script<>(webSocketID, requestJSON, responseProcessor); 7670 } 7671 7672 /** 7673 * Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation. 7674 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 7675 * 7676 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7677 * String></CODE> 7678 * 7679 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7680 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7681 * String></CODE> will be returned. 7682 * 7683 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7684 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7685 * may be retrieved.</I> 7686 * 7687 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7688 * <BR /><BR /><UL CLASS=JDUL> 7689 * <LI><CODE>String (<B>primaryIcon</B></CODE>) 7690 * <BR />- 7691 * </LI> 7692 * </UL> */ 7693 public static Script<String, JsonObject, String> getManifestIcons() 7694 { 7695 final int webSocketID = 35014000 + counter++; 7696 final boolean[] optionals = new boolean[0]; 7697 7698 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7699 String requestJSON = WriteJSON.get( 7700 parameterTypes.get("getManifestIcons"), 7701 parameterNames.get("getManifestIcons"), 7702 optionals, webSocketID, 7703 "Page.getManifestIcons" 7704 ); 7705 7706 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 7707 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 7708 ReadJSON.getString(jo, "primaryIcon", true, false); 7709 7710 return new Script<>(webSocketID, requestJSON, responseProcessor); 7711 } 7712 7713 /** 7714 * Returns the unique (PWA) app id. 7715 * Only returns values if the feature flag 'WebAppEnableManifestId' is enabled 7716 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 7717 * 7718 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7719 * {@link Ret2}></CODE> 7720 * 7721 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 7722 * {@link Script#exec()}), and a {@link Promise} returned. 7723 * 7724 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 7725 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 7726 * be returned from that call. 7727 * 7728 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 7729 * in an instance of <B>{@link Ret2}</B> 7730 * 7731 * <BR /><BR /><UL CLASS=JDUL> 7732 * <LI><CODE><B>Ret2.a:</B> String (<B>appId</B>)</CODE> 7733 * <BR />App id, either from manifest's id attribute or computed from start_url 7734 * <BR /><BR /></LI> 7735 * <LI><CODE><B>Ret2.b:</B> String (<B>recommendedId</B>)</CODE> 7736 * <BR />Recommendation for manifest's id attribute to match current id computed from start_url 7737 * </LI> 7738 * </UL> 7739 */ 7740 public static Script<String, JsonObject, Ret2<String, String>> getAppId() 7741 { 7742 final int webSocketID = 35015000 + counter++; 7743 final boolean[] optionals = new boolean[0]; 7744 7745 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7746 String requestJSON = WriteJSON.get( 7747 parameterTypes.get("getAppId"), 7748 parameterNames.get("getAppId"), 7749 optionals, webSocketID, 7750 "Page.getAppId" 7751 ); 7752 7753 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 7754 Function<JsonObject, Ret2<String, String>> 7755 responseProcessor = (JsonObject jo) -> new Ret2<>( 7756 ReadJSON.getString(jo, "appId", true, false), 7757 ReadJSON.getString(jo, "recommendedId", true, false) 7758 ); 7759 7760 return new Script<>(webSocketID, requestJSON, responseProcessor); 7761 } 7762 7763 /** 7764 * <CODE>[No Description Provided by Google]</CODE> 7765 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 7766 * 7767 * @param frameId - 7768 * 7769 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7770 * {@link Page.AdScriptAncestry}></CODE> 7771 * 7772 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7773 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7774 * {@link Page.AdScriptAncestry}></CODE> will be returned. 7775 * 7776 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7777 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7778 * may be retrieved.</I> 7779 * 7780 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7781 * <BR /><BR /><UL CLASS=JDUL> 7782 * <LI><CODE>{@link Page.AdScriptAncestry} (<B>adScriptAncestry</B></CODE>) 7783 * <BR />The ancestry chain of ad script identifiers leading to this frame's 7784 * creation, along with the root script's filterlist rule. The ancestry 7785 * chain is ordered from the most immediate script (in the frame creation 7786 * stack) to more distant ancestors (that created the immediately preceding 7787 * script). Only sent if frame is labelled as an ad and ids are available. 7788 * </LI> 7789 * </UL> */ 7790 public static Script<String, JsonObject, Page.AdScriptAncestry> getAdScriptAncestry 7791 (String frameId) 7792 { 7793 // Exception-Check(s) to ensure that if any parameters which are not declared as 7794 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7795 7796 if (frameId == null) THROWS.throwNPE("frameId"); 7797 7798 final int webSocketID = 35016000 + counter++; 7799 final boolean[] optionals = { false, }; 7800 7801 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7802 String requestJSON = WriteJSON.get( 7803 parameterTypes.get("getAdScriptAncestry"), 7804 parameterNames.get("getAdScriptAncestry"), 7805 optionals, webSocketID, 7806 "Page.getAdScriptAncestry", 7807 frameId 7808 ); 7809 7810 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.AdScriptAncestry' 7811 Function<JsonObject, Page.AdScriptAncestry> responseProcessor = (JsonObject jo) -> 7812 ReadJSON.getObject(jo, "adScriptAncestry", Page.AdScriptAncestry.class, true, false); 7813 7814 return new Script<>(webSocketID, requestJSON, responseProcessor); 7815 } 7816 7817 /** 7818 * Returns present frame tree structure. 7819 * 7820 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7821 * {@link Page.FrameTree}></CODE> 7822 * 7823 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 7824 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 7825 * {@link Page.FrameTree}></CODE> will be returned. 7826 * 7827 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 7828 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 7829 * may be retrieved.</I> 7830 * 7831 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 7832 * <BR /><BR /><UL CLASS=JDUL> 7833 * <LI><CODE>{@link Page.FrameTree} (<B>frameTree</B></CODE>) 7834 * <BR />Present frame tree structure. 7835 * </LI> 7836 * </UL> */ 7837 public static Script<String, JsonObject, Page.FrameTree> getFrameTree() 7838 { 7839 final int webSocketID = 35017000 + counter++; 7840 final boolean[] optionals = new boolean[0]; 7841 7842 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7843 String requestJSON = WriteJSON.get( 7844 parameterTypes.get("getFrameTree"), 7845 parameterNames.get("getFrameTree"), 7846 optionals, webSocketID, 7847 "Page.getFrameTree" 7848 ); 7849 7850 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.FrameTree' 7851 Function<JsonObject, Page.FrameTree> responseProcessor = (JsonObject jo) -> 7852 ReadJSON.getObject(jo, "frameTree", Page.FrameTree.class, false, true); 7853 7854 return new Script<>(webSocketID, requestJSON, responseProcessor); 7855 } 7856 7857 /** 7858 * Returns metrics relating to the layouting of the page, such as viewport bounds/scale. 7859 * 7860 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7861 * {@link Ret6}></CODE> 7862 * 7863 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 7864 * {@link Script#exec()}), and a {@link Promise} returned. 7865 * 7866 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 7867 * (using {@link Promise#await()}), the {@code Ret6} will subsequently 7868 * be returned from that call. 7869 * 7870 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 7871 * in an instance of <B>{@link Ret6}</B> 7872 * 7873 * <BR /><BR /><UL CLASS=JDUL> 7874 * <LI><CODE><B>Ret6.a1:</B> {@link Page.LayoutViewport} (<B>layoutViewport</B>)</CODE> 7875 * <BR />Deprecated metrics relating to the layout viewport. Is in device pixels. Use {@code cssLayoutViewport} instead. 7876 * <BR /><BR /></LI> 7877 * <LI><CODE><B>Ret6.b2:</B> {@link Page.VisualViewport} (<B>visualViewport</B>)</CODE> 7878 * <BR />Deprecated metrics relating to the visual viewport. Is in device pixels. Use {@code cssVisualViewport} instead. 7879 * <BR /><BR /></LI> 7880 * <LI><CODE><B>Ret6.c3:</B> {@link DOM.Rect} (<B>contentSize</B>)</CODE> 7881 * <BR />Deprecated size of scrollable area. Is in DP. Use {@code cssContentSize} instead. 7882 * <BR /><BR /></LI> 7883 * <LI><CODE><B>Ret6.d4:</B> {@link Page.LayoutViewport} (<B>cssLayoutViewport</B>)</CODE> 7884 * <BR />Metrics relating to the layout viewport in CSS pixels. 7885 * <BR /><BR /></LI> 7886 * <LI><CODE><B>Ret6.e5:</B> {@link Page.VisualViewport} (<B>cssVisualViewport</B>)</CODE> 7887 * <BR />Metrics relating to the visual viewport in CSS pixels. 7888 * <BR /><BR /></LI> 7889 * <LI><CODE><B>Ret6.f6:</B> {@link DOM.Rect} (<B>cssContentSize</B>)</CODE> 7890 * <BR />Size of scrollable area in CSS pixels. 7891 * </LI> 7892 * </UL> 7893 */ 7894 public static Script<String, JsonObject, Ret6<Page.LayoutViewport, Page.VisualViewport, DOM.Rect, Page.LayoutViewport, Page.VisualViewport, DOM.Rect>> 7895 getLayoutMetrics() 7896 { 7897 final int webSocketID = 35018000 + counter++; 7898 final boolean[] optionals = new boolean[0]; 7899 7900 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7901 String requestJSON = WriteJSON.get( 7902 parameterTypes.get("getLayoutMetrics"), 7903 parameterNames.get("getLayoutMetrics"), 7904 optionals, webSocketID, 7905 "Page.getLayoutMetrics" 7906 ); 7907 7908 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret6' 7909 Function<JsonObject, Ret6<Page.LayoutViewport, Page.VisualViewport, DOM.Rect, Page.LayoutViewport, Page.VisualViewport, DOM.Rect>> 7910 responseProcessor = (JsonObject jo) -> new Ret6<>( 7911 ReadJSON.getObject(jo, "layoutViewport", Page.LayoutViewport.class, false, true), 7912 ReadJSON.getObject(jo, "visualViewport", Page.VisualViewport.class, false, true), 7913 ReadJSON.getObject(jo, "contentSize", DOM.Rect.class, false, true), 7914 ReadJSON.getObject(jo, "cssLayoutViewport", Page.LayoutViewport.class, false, true), 7915 ReadJSON.getObject(jo, "cssVisualViewport", Page.VisualViewport.class, false, true), 7916 ReadJSON.getObject(jo, "cssContentSize", DOM.Rect.class, false, true) 7917 ); 7918 7919 return new Script<>(webSocketID, requestJSON, responseProcessor); 7920 } 7921 7922 /** 7923 * Returns navigation history for the current page. 7924 * 7925 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7926 * {@link Ret2}></CODE> 7927 * 7928 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 7929 * {@link Script#exec()}), and a {@link Promise} returned. 7930 * 7931 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 7932 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 7933 * be returned from that call. 7934 * 7935 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 7936 * in an instance of <B>{@link Ret2}</B> 7937 * 7938 * <BR /><BR /><UL CLASS=JDUL> 7939 * <LI><CODE><B>Ret2.a:</B> Integer (<B>currentIndex</B>)</CODE> 7940 * <BR />Index of the current navigation history entry. 7941 * <BR /><BR /></LI> 7942 * <LI><CODE><B>Ret2.b:</B> {@link Page.NavigationEntry}[] (<B>entries</B>)</CODE> 7943 * <BR />Array of navigation history entries. 7944 * </LI> 7945 * </UL> 7946 */ 7947 public static Script<String, JsonObject, Ret2<Integer, Page.NavigationEntry[]>> getNavigationHistory() 7948 { 7949 final int webSocketID = 35019000 + counter++; 7950 final boolean[] optionals = new boolean[0]; 7951 7952 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7953 String requestJSON = WriteJSON.get( 7954 parameterTypes.get("getNavigationHistory"), 7955 parameterNames.get("getNavigationHistory"), 7956 optionals, webSocketID, 7957 "Page.getNavigationHistory" 7958 ); 7959 7960 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 7961 Function<JsonObject, Ret2<Integer, Page.NavigationEntry[]>> 7962 responseProcessor = (JsonObject jo) -> new Ret2<>( 7963 ReadBoxedJSON.getInteger(jo, "currentIndex", true), 7964 (jo.getJsonArray("entries") == null) 7965 ? null 7966 : RJArrIntoStream.objArr(jo.getJsonArray("entries"), null, 0, Page.NavigationEntry.class).toArray(Page.NavigationEntry[]::new) 7967 ); 7968 7969 return new Script<>(webSocketID, requestJSON, responseProcessor); 7970 } 7971 7972 /** 7973 * Resets navigation history for the current page. 7974 * 7975 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 7976 * {@link Ret0}></CODE> 7977 * 7978 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 7979 * browser receives the invocation-request. 7980 * 7981 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 7982 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 7983 * {@code >} to ensure the Browser Function has run to completion. 7984 */ 7985 public static Script<String, JsonObject, Ret0> resetNavigationHistory() 7986 { 7987 final int webSocketID = 35020000 + counter++; 7988 final boolean[] optionals = new boolean[0]; 7989 7990 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 7991 String requestJSON = WriteJSON.get( 7992 parameterTypes.get("resetNavigationHistory"), 7993 parameterNames.get("resetNavigationHistory"), 7994 optionals, webSocketID, 7995 "Page.resetNavigationHistory" 7996 ); 7997 7998 // This Remote Command does not have a Return-Value. 7999 return new Script<> 8000 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8001 } 8002 8003 /** 8004 * Returns content of the given resource. 8005 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8006 * 8007 * @param frameId Frame id to get resource for. 8008 * 8009 * @param url URL of the resource to get content for. 8010 * 8011 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8012 * {@link Ret2}></CODE> 8013 * 8014 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 8015 * {@link Script#exec()}), and a {@link Promise} returned. 8016 * 8017 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 8018 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 8019 * be returned from that call. 8020 * 8021 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 8022 * in an instance of <B>{@link Ret2}</B> 8023 * 8024 * <BR /><BR /><UL CLASS=JDUL> 8025 * <LI><CODE><B>Ret2.a:</B> String (<B>content</B>)</CODE> 8026 * <BR />Resource content. 8027 * <BR /><BR /></LI> 8028 * <LI><CODE><B>Ret2.b:</B> Boolean (<B>base64Encoded</B>)</CODE> 8029 * <BR />True, if content was served as base64. 8030 * </LI> 8031 * </UL> 8032 */ 8033 public static Script<String, JsonObject, Ret2<String, Boolean>> getResourceContent 8034 (String frameId, String url) 8035 { 8036 // Exception-Check(s) to ensure that if any parameters which are not declared as 8037 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8038 8039 if (frameId == null) THROWS.throwNPE("frameId"); 8040 if (url == null) THROWS.throwNPE("url"); 8041 8042 final int webSocketID = 35021000 + counter++; 8043 final boolean[] optionals = { false, false, }; 8044 8045 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8046 String requestJSON = WriteJSON.get( 8047 parameterTypes.get("getResourceContent"), 8048 parameterNames.get("getResourceContent"), 8049 optionals, webSocketID, 8050 "Page.getResourceContent", 8051 frameId, url 8052 ); 8053 8054 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 8055 Function<JsonObject, Ret2<String, Boolean>> 8056 responseProcessor = (JsonObject jo) -> new Ret2<>( 8057 ReadJSON.getString(jo, "content", false, true), 8058 ReadBoxedJSON.getBoolean(jo, "base64Encoded", true) 8059 ); 8060 8061 return new Script<>(webSocketID, requestJSON, responseProcessor); 8062 } 8063 8064 /** 8065 * Returns present frame / resource tree structure. 8066 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8067 * 8068 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8069 * {@link Page.FrameResourceTree}></CODE> 8070 * 8071 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 8072 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 8073 * {@link Page.FrameResourceTree}></CODE> will be returned. 8074 * 8075 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 8076 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 8077 * may be retrieved.</I> 8078 * 8079 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 8080 * <BR /><BR /><UL CLASS=JDUL> 8081 * <LI><CODE>{@link Page.FrameResourceTree} (<B>frameTree</B></CODE>) 8082 * <BR />Present frame / resource tree structure. 8083 * </LI> 8084 * </UL> */ 8085 public static Script<String, JsonObject, Page.FrameResourceTree> getResourceTree() 8086 { 8087 final int webSocketID = 35022000 + counter++; 8088 final boolean[] optionals = new boolean[0]; 8089 8090 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8091 String requestJSON = WriteJSON.get( 8092 parameterTypes.get("getResourceTree"), 8093 parameterNames.get("getResourceTree"), 8094 optionals, webSocketID, 8095 "Page.getResourceTree" 8096 ); 8097 8098 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.FrameResourceTree' 8099 Function<JsonObject, Page.FrameResourceTree> responseProcessor = (JsonObject jo) -> 8100 ReadJSON.getObject(jo, "frameTree", Page.FrameResourceTree.class, false, true); 8101 8102 return new Script<>(webSocketID, requestJSON, responseProcessor); 8103 } 8104 8105 /** 8106 * Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). 8107 * 8108 * @param accept Whether to accept or dismiss the dialog. 8109 * 8110 * @param promptText 8111 * The text to enter into the dialog prompt before accepting. Used only if this is a prompt 8112 * dialog. 8113 * <BR /><B CLASS=Opt>OPTIONAL</B> 8114 * 8115 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8116 * {@link Ret0}></CODE> 8117 * 8118 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8119 * browser receives the invocation-request. 8120 * 8121 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8122 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8123 * {@code >} to ensure the Browser Function has run to completion. 8124 */ 8125 public static Script<String, JsonObject, Ret0> handleJavaScriptDialog 8126 (boolean accept, String promptText) 8127 { 8128 final int webSocketID = 35023000 + counter++; 8129 final boolean[] optionals = { false, true, }; 8130 8131 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8132 String requestJSON = WriteJSON.get( 8133 parameterTypes.get("handleJavaScriptDialog"), 8134 parameterNames.get("handleJavaScriptDialog"), 8135 optionals, webSocketID, 8136 "Page.handleJavaScriptDialog", 8137 accept, promptText 8138 ); 8139 8140 // This Remote Command does not have a Return-Value. 8141 return new Script<> 8142 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8143 } 8144 8145 /** 8146 * Navigates current page to the given URL. 8147 * 8148 * @param url URL to navigate the page to. 8149 * 8150 * @param referrer Referrer URL. 8151 * <BR /><B CLASS=Opt>OPTIONAL</B> 8152 * 8153 * @param transitionType Intended transition type. 8154 * <BR /><B CLASS=Opt>OPTIONAL</B> 8155 * 8156 * @param frameId Frame id to navigate, if not specified navigates the top frame. 8157 * <BR /><B CLASS=Opt>OPTIONAL</B> 8158 * 8159 * @param referrerPolicy Referrer-policy used for the navigation. 8160 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 8161 * 8162 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8163 * {@link Ret4}></CODE> 8164 * 8165 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 8166 * {@link Script#exec()}), and a {@link Promise} returned. 8167 * 8168 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 8169 * (using {@link Promise#await()}), the {@code Ret4} will subsequently 8170 * be returned from that call. 8171 * 8172 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 8173 * in an instance of <B>{@link Ret4}</B> 8174 * 8175 * <BR /><BR /><UL CLASS=JDUL> 8176 * <LI><CODE><B>Ret4.a:</B> String (<B>frameId</B>)</CODE> 8177 * <BR />Frame id that has navigated (or failed to navigate) 8178 * <BR /><BR /></LI> 8179 * <LI><CODE><B>Ret4.b:</B> String (<B>loaderId</B>)</CODE> 8180 * <BR />Loader identifier. This is omitted in case of same-document navigation, 8181 * as the previously committed loaderId would not change. 8182 * <BR /><BR /></LI> 8183 * <LI><CODE><B>Ret4.c:</B> String (<B>errorText</B>)</CODE> 8184 * <BR />User friendly error message, present if and only if navigation has failed. 8185 * <BR /><BR /></LI> 8186 * <LI><CODE><B>Ret4.d:</B> Boolean (<B>isDownload</B>)</CODE> 8187 * <BR />Whether the navigation resulted in a download. 8188 * </LI> 8189 * </UL> 8190 */ 8191 public static Script<String, JsonObject, Ret4<String, String, String, Boolean>> navigate 8192 (String url, String referrer, String transitionType, String frameId, String referrerPolicy) 8193 { 8194 // Exception-Check(s) to ensure that if any parameters which are not declared as 8195 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8196 8197 if (url == null) THROWS.throwNPE("url"); 8198 8199 // Exception-Check(s) to ensure that if any parameters which must adhere to a 8200 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 8201 8202 THROWS.checkIAE("transitionType", transitionType, "Page.TransitionType", Page.TransitionType); 8203 THROWS.checkIAE("referrerPolicy", referrerPolicy, "Page.ReferrerPolicy", Page.ReferrerPolicy); 8204 8205 final int webSocketID = 35024000 + counter++; 8206 final boolean[] optionals = { false, true, true, true, true, }; 8207 8208 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8209 String requestJSON = WriteJSON.get( 8210 parameterTypes.get("navigate"), 8211 parameterNames.get("navigate"), 8212 optionals, webSocketID, 8213 "Page.navigate", 8214 url, referrer, transitionType, frameId, referrerPolicy 8215 ); 8216 8217 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret4' 8218 Function<JsonObject, Ret4<String, String, String, Boolean>> 8219 responseProcessor = (JsonObject jo) -> new Ret4<>( 8220 ReadJSON.getString(jo, "frameId", false, true), 8221 ReadJSON.getString(jo, "loaderId", true, false), 8222 ReadJSON.getString(jo, "errorText", true, false), 8223 ReadBoxedJSON.getBoolean(jo, "isDownload", true) 8224 ); 8225 8226 return new Script<>(webSocketID, requestJSON, responseProcessor); 8227 } 8228 8229 /** 8230 * Navigates current page to the given history entry. 8231 * 8232 * @param entryId Unique id of the entry to navigate to. 8233 * 8234 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8235 * {@link Ret0}></CODE> 8236 * 8237 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8238 * browser receives the invocation-request. 8239 * 8240 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8241 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8242 * {@code >} to ensure the Browser Function has run to completion. 8243 */ 8244 public static Script<String, JsonObject, Ret0> navigateToHistoryEntry(int entryId) 8245 { 8246 final int webSocketID = 35025000 + counter++; 8247 final boolean[] optionals = { false, }; 8248 8249 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8250 String requestJSON = WriteJSON.get( 8251 parameterTypes.get("navigateToHistoryEntry"), 8252 parameterNames.get("navigateToHistoryEntry"), 8253 optionals, webSocketID, 8254 "Page.navigateToHistoryEntry", 8255 entryId 8256 ); 8257 8258 // This Remote Command does not have a Return-Value. 8259 return new Script<> 8260 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8261 } 8262 8263 /** 8264 * Print page as PDF. 8265 * 8266 * @param landscape Paper orientation. Defaults to false. 8267 * <BR /><B CLASS=Opt>OPTIONAL</B> 8268 * 8269 * @param displayHeaderFooter Display header and footer. Defaults to false. 8270 * <BR /><B CLASS=Opt>OPTIONAL</B> 8271 * 8272 * @param printBackground Print background graphics. Defaults to false. 8273 * <BR /><B CLASS=Opt>OPTIONAL</B> 8274 * 8275 * @param scale Scale of the webpage rendering. Defaults to 1. 8276 * <BR /><B CLASS=Opt>OPTIONAL</B> 8277 * 8278 * @param paperWidth Paper width in inches. Defaults to 8.5 inches. 8279 * <BR /><B CLASS=Opt>OPTIONAL</B> 8280 * 8281 * @param paperHeight Paper height in inches. Defaults to 11 inches. 8282 * <BR /><B CLASS=Opt>OPTIONAL</B> 8283 * 8284 * @param marginTop Top margin in inches. Defaults to 1cm (~0.4 inches). 8285 * <BR /><B CLASS=Opt>OPTIONAL</B> 8286 * 8287 * @param marginBottom Bottom margin in inches. Defaults to 1cm (~0.4 inches). 8288 * <BR /><B CLASS=Opt>OPTIONAL</B> 8289 * 8290 * @param marginLeft Left margin in inches. Defaults to 1cm (~0.4 inches). 8291 * <BR /><B CLASS=Opt>OPTIONAL</B> 8292 * 8293 * @param marginRight Right margin in inches. Defaults to 1cm (~0.4 inches). 8294 * <BR /><B CLASS=Opt>OPTIONAL</B> 8295 * 8296 * @param pageRanges 8297 * Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are 8298 * printed in the document order, not in the order specified, and no 8299 * more than once. 8300 * Defaults to empty string, which implies the entire document is printed. 8301 * The page numbers are quietly capped to actual page count of the 8302 * document, and ranges beyond the end of the document are ignored. 8303 * If this results in no pages to print, an error is reported. 8304 * It is an error to specify a range with start greater than end. 8305 * <BR /><B CLASS=Opt>OPTIONAL</B> 8306 * 8307 * @param headerTemplate 8308 * HTML template for the print header. Should be valid HTML markup with following 8309 * classes used to inject printing values into them: 8310 * - {@code date}: formatted print date 8311 * - {@code title}: document title 8312 * - {@code url}: document location 8313 * - {@code pageNumber}: current page number 8314 * - {@code totalPages}: total pages in the document 8315 * 8316 * For example, {@code <span class=title></span>} would generate span containing the title. 8317 * <BR /><B CLASS=Opt>OPTIONAL</B> 8318 * 8319 * @param footerTemplate HTML template for the print footer. Should use the same format as the {@code headerTemplate}. 8320 * <BR /><B CLASS=Opt>OPTIONAL</B> 8321 * 8322 * @param preferCSSPageSize 8323 * Whether or not to prefer page size as defined by css. Defaults to false, 8324 * in which case the content will be scaled to fit the paper size. 8325 * <BR /><B CLASS=Opt>OPTIONAL</B> 8326 * 8327 * @param transferMode return as stream 8328 * <BR />Acceptable Values: ["ReturnAsBase64", "ReturnAsStream"] 8329 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 8330 * 8331 * @param generateTaggedPDF Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice. 8332 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 8333 * 8334 * @param generateDocumentOutline Whether or not to embed the document outline into the PDF. 8335 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 8336 * 8337 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8338 * {@link Ret2}></CODE> 8339 * 8340 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 8341 * {@link Script#exec()}), and a {@link Promise} returned. 8342 * 8343 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 8344 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 8345 * be returned from that call. 8346 * 8347 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 8348 * in an instance of <B>{@link Ret2}</B> 8349 * 8350 * <BR /><BR /><UL CLASS=JDUL> 8351 * <LI><CODE><B>Ret2.a:</B> String (<B>data</B>)</CODE> 8352 * <BR />Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded as a base64 string when passed over JSON) 8353 * <BR /><BR /></LI> 8354 * <LI><CODE><B>Ret2.b:</B> String (<B>stream</B>)</CODE> 8355 * <BR />A handle of the stream that holds resulting PDF data. 8356 * </LI> 8357 * </UL> 8358 */ 8359 public static Script<String, JsonObject, Ret2<String, String>> printToPDF( 8360 Boolean landscape, Boolean displayHeaderFooter, Boolean printBackground, Number scale, 8361 Number paperWidth, Number paperHeight, Number marginTop, Number marginBottom, 8362 Number marginLeft, Number marginRight, String pageRanges, String headerTemplate, 8363 String footerTemplate, Boolean preferCSSPageSize, String transferMode, 8364 Boolean generateTaggedPDF, Boolean generateDocumentOutline 8365 ) 8366 { 8367 // Exception-Check(s) to ensure that if any parameters which must adhere to a 8368 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 8369 8370 THROWS.checkIAE( 8371 "transferMode", transferMode, 8372 "ReturnAsBase64", "ReturnAsStream" 8373 ); 8374 8375 final int webSocketID = 35026000 + counter++; 8376 final boolean[] optionals = { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, }; 8377 8378 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8379 String requestJSON = WriteJSON.get( 8380 parameterTypes.get("printToPDF"), 8381 parameterNames.get("printToPDF"), 8382 optionals, webSocketID, 8383 "Page.printToPDF", 8384 landscape, displayHeaderFooter, printBackground, scale, paperWidth, paperHeight, 8385 marginTop, marginBottom, marginLeft, marginRight, pageRanges, headerTemplate, 8386 footerTemplate, preferCSSPageSize, transferMode, generateTaggedPDF, 8387 generateDocumentOutline 8388 ); 8389 8390 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 8391 Function<JsonObject, Ret2<String, String>> 8392 responseProcessor = (JsonObject jo) -> new Ret2<>( 8393 ReadJSON.getString(jo, "data", false, true), 8394 ReadJSON.getString(jo, "stream", true, false) 8395 ); 8396 8397 return new Script<>(webSocketID, requestJSON, responseProcessor); 8398 } 8399 8400 /** 8401 * Reloads given page optionally ignoring the cache. 8402 * 8403 * @param ignoreCache If true, browser cache is ignored (as if the user pressed Shift+refresh). 8404 * <BR /><B CLASS=Opt>OPTIONAL</B> 8405 * 8406 * @param scriptToEvaluateOnLoad 8407 * If set, the script will be injected into all frames of the inspected page after reload. 8408 * Argument will be ignored if reloading dataURL origin. 8409 * <BR /><B CLASS=Opt>OPTIONAL</B> 8410 * 8411 * @param loaderId 8412 * If set, an error will be thrown if the target page's main frame's 8413 * loader id does not match the provided id. This prevents accidentally 8414 * reloading an unintended target in case there's a racing navigation. 8415 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 8416 * 8417 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8418 * {@link Ret0}></CODE> 8419 * 8420 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8421 * browser receives the invocation-request. 8422 * 8423 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8424 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8425 * {@code >} to ensure the Browser Function has run to completion. 8426 */ 8427 public static Script<String, JsonObject, Ret0> reload 8428 (Boolean ignoreCache, String scriptToEvaluateOnLoad, String loaderId) 8429 { 8430 final int webSocketID = 35027000 + counter++; 8431 final boolean[] optionals = { true, true, true, }; 8432 8433 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8434 String requestJSON = WriteJSON.get( 8435 parameterTypes.get("reload"), 8436 parameterNames.get("reload"), 8437 optionals, webSocketID, 8438 "Page.reload", 8439 ignoreCache, scriptToEvaluateOnLoad, loaderId 8440 ); 8441 8442 // This Remote Command does not have a Return-Value. 8443 return new Script<> 8444 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8445 } 8446 8447 /** 8448 * Deprecated, please use removeScriptToEvaluateOnNewDocument instead. 8449 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 8450 * 8451 * @param identifier - 8452 * 8453 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8454 * {@link Ret0}></CODE> 8455 * 8456 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8457 * browser receives the invocation-request. 8458 * 8459 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8460 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8461 * {@code >} to ensure the Browser Function has run to completion. 8462 */ 8463 public static Script<String, JsonObject, Ret0> removeScriptToEvaluateOnLoad 8464 (String identifier) 8465 { 8466 // Exception-Check(s) to ensure that if any parameters which are not declared as 8467 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8468 8469 if (identifier == null) THROWS.throwNPE("identifier"); 8470 8471 final int webSocketID = 35028000 + counter++; 8472 final boolean[] optionals = { false, }; 8473 8474 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8475 String requestJSON = WriteJSON.get( 8476 parameterTypes.get("removeScriptToEvaluateOnLoad"), 8477 parameterNames.get("removeScriptToEvaluateOnLoad"), 8478 optionals, webSocketID, 8479 "Page.removeScriptToEvaluateOnLoad", 8480 identifier 8481 ); 8482 8483 // This Remote Command does not have a Return-Value. 8484 return new Script<> 8485 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8486 } 8487 8488 /** 8489 * Removes given script from the list. 8490 * 8491 * @param identifier - 8492 * 8493 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8494 * {@link Ret0}></CODE> 8495 * 8496 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8497 * browser receives the invocation-request. 8498 * 8499 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8500 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8501 * {@code >} to ensure the Browser Function has run to completion. 8502 */ 8503 public static Script<String, JsonObject, Ret0> removeScriptToEvaluateOnNewDocument 8504 (String identifier) 8505 { 8506 // Exception-Check(s) to ensure that if any parameters which are not declared as 8507 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8508 8509 if (identifier == null) THROWS.throwNPE("identifier"); 8510 8511 final int webSocketID = 35029000 + counter++; 8512 final boolean[] optionals = { false, }; 8513 8514 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8515 String requestJSON = WriteJSON.get( 8516 parameterTypes.get("removeScriptToEvaluateOnNewDocument"), 8517 parameterNames.get("removeScriptToEvaluateOnNewDocument"), 8518 optionals, webSocketID, 8519 "Page.removeScriptToEvaluateOnNewDocument", 8520 identifier 8521 ); 8522 8523 // This Remote Command does not have a Return-Value. 8524 return new Script<> 8525 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8526 } 8527 8528 /** 8529 * Acknowledges that a screencast frame has been received by the frontend. 8530 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8531 * 8532 * @param sessionId Frame number. 8533 * 8534 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8535 * {@link Ret0}></CODE> 8536 * 8537 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8538 * browser receives the invocation-request. 8539 * 8540 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8541 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8542 * {@code >} to ensure the Browser Function has run to completion. 8543 */ 8544 public static Script<String, JsonObject, Ret0> screencastFrameAck(int sessionId) 8545 { 8546 final int webSocketID = 35030000 + counter++; 8547 final boolean[] optionals = { false, }; 8548 8549 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8550 String requestJSON = WriteJSON.get( 8551 parameterTypes.get("screencastFrameAck"), 8552 parameterNames.get("screencastFrameAck"), 8553 optionals, webSocketID, 8554 "Page.screencastFrameAck", 8555 sessionId 8556 ); 8557 8558 // This Remote Command does not have a Return-Value. 8559 return new Script<> 8560 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8561 } 8562 8563 /** 8564 * Searches for given string in resource content. 8565 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8566 * 8567 * @param frameId Frame id for resource to search in. 8568 * 8569 * @param url URL of the resource to search in. 8570 * 8571 * @param query String to search for. 8572 * 8573 * @param caseSensitive If true, search is case sensitive. 8574 * <BR /><B CLASS=Opt>OPTIONAL</B> 8575 * 8576 * @param isRegex If true, treats string parameter as regex. 8577 * <BR /><B CLASS=Opt>OPTIONAL</B> 8578 * 8579 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8580 * {@link Debugger.SearchMatch}[]></CODE> 8581 * 8582 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 8583 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 8584 * {@link Debugger.SearchMatch}[]></CODE> will be returned. 8585 * 8586 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 8587 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 8588 * may be retrieved.</I> 8589 * 8590 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 8591 * <BR /><BR /><UL CLASS=JDUL> 8592 * <LI><CODE>{@link Debugger.SearchMatch}[] (<B>result</B></CODE>) 8593 * <BR />List of search matches. 8594 * </LI> 8595 * </UL> */ 8596 public static Script<String, JsonObject, Debugger.SearchMatch[]> searchInResource 8597 (String frameId, String url, String query, Boolean caseSensitive, Boolean isRegex) 8598 { 8599 // Exception-Check(s) to ensure that if any parameters which are not declared as 8600 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8601 8602 if (frameId == null) THROWS.throwNPE("frameId"); 8603 if (url == null) THROWS.throwNPE("url"); 8604 if (query == null) THROWS.throwNPE("query"); 8605 8606 final int webSocketID = 35031000 + counter++; 8607 final boolean[] optionals = { false, false, false, true, true, }; 8608 8609 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8610 String requestJSON = WriteJSON.get( 8611 parameterTypes.get("searchInResource"), 8612 parameterNames.get("searchInResource"), 8613 optionals, webSocketID, 8614 "Page.searchInResource", 8615 frameId, url, query, caseSensitive, isRegex 8616 ); 8617 8618 // 'JSON Binding' ... Converts Browser Response-JSON to 'Debugger.SearchMatch[]' 8619 Function<JsonObject, Debugger.SearchMatch[]> responseProcessor = (JsonObject jo) -> 8620 (jo.getJsonArray("result") == null) 8621 ? null 8622 : RJArrIntoStream.objArr(jo.getJsonArray("result"), null, 0, Debugger.SearchMatch.class).toArray(Debugger.SearchMatch[]::new); 8623 8624 return new Script<>(webSocketID, requestJSON, responseProcessor); 8625 } 8626 8627 /** 8628 * Enable Chrome's experimental ad filter on all sites. 8629 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8630 * 8631 * @param enabled Whether to block ads. 8632 * 8633 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8634 * {@link Ret0}></CODE> 8635 * 8636 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8637 * browser receives the invocation-request. 8638 * 8639 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8640 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8641 * {@code >} to ensure the Browser Function has run to completion. 8642 */ 8643 public static Script<String, JsonObject, Ret0> setAdBlockingEnabled(boolean enabled) 8644 { 8645 final int webSocketID = 35032000 + counter++; 8646 final boolean[] optionals = { false, }; 8647 8648 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8649 String requestJSON = WriteJSON.get( 8650 parameterTypes.get("setAdBlockingEnabled"), 8651 parameterNames.get("setAdBlockingEnabled"), 8652 optionals, webSocketID, 8653 "Page.setAdBlockingEnabled", 8654 enabled 8655 ); 8656 8657 // This Remote Command does not have a Return-Value. 8658 return new Script<> 8659 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8660 } 8661 8662 /** 8663 * Enable page Content Security Policy by-passing. 8664 * 8665 * @param enabled Whether to bypass page CSP. 8666 * 8667 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8668 * {@link Ret0}></CODE> 8669 * 8670 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8671 * browser receives the invocation-request. 8672 * 8673 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8674 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8675 * {@code >} to ensure the Browser Function has run to completion. 8676 */ 8677 public static Script<String, JsonObject, Ret0> setBypassCSP(boolean enabled) 8678 { 8679 final int webSocketID = 35033000 + counter++; 8680 final boolean[] optionals = { false, }; 8681 8682 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8683 String requestJSON = WriteJSON.get( 8684 parameterTypes.get("setBypassCSP"), 8685 parameterNames.get("setBypassCSP"), 8686 optionals, webSocketID, 8687 "Page.setBypassCSP", 8688 enabled 8689 ); 8690 8691 // This Remote Command does not have a Return-Value. 8692 return new Script<> 8693 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8694 } 8695 8696 /** 8697 * Get Permissions Policy state on given frame. 8698 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8699 * 8700 * @param frameId - 8701 * 8702 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8703 * {@link Page.PermissionsPolicyFeatureState}[]></CODE> 8704 * 8705 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 8706 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 8707 * {@link Page.PermissionsPolicyFeatureState}[]></CODE> will be returned. 8708 * 8709 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 8710 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 8711 * may be retrieved.</I> 8712 * 8713 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 8714 * <BR /><BR /><UL CLASS=JDUL> 8715 * <LI><CODE>{@link Page.PermissionsPolicyFeatureState}[] (<B>states</B></CODE>) 8716 * <BR />- 8717 * </LI> 8718 * </UL> */ 8719 public static Script<String, JsonObject, Page.PermissionsPolicyFeatureState[]> getPermissionsPolicyState 8720 (String frameId) 8721 { 8722 // Exception-Check(s) to ensure that if any parameters which are not declared as 8723 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8724 8725 if (frameId == null) THROWS.throwNPE("frameId"); 8726 8727 final int webSocketID = 35034000 + counter++; 8728 final boolean[] optionals = { false, }; 8729 8730 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8731 String requestJSON = WriteJSON.get( 8732 parameterTypes.get("getPermissionsPolicyState"), 8733 parameterNames.get("getPermissionsPolicyState"), 8734 optionals, webSocketID, 8735 "Page.getPermissionsPolicyState", 8736 frameId 8737 ); 8738 8739 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.PermissionsPolicyFeatureState[]' 8740 Function<JsonObject, Page.PermissionsPolicyFeatureState[]> responseProcessor = (JsonObject jo) -> 8741 (jo.getJsonArray("states") == null) 8742 ? null 8743 : RJArrIntoStream.objArr(jo.getJsonArray("states"), null, 0, Page.PermissionsPolicyFeatureState.class).toArray(Page.PermissionsPolicyFeatureState[]::new); 8744 8745 return new Script<>(webSocketID, requestJSON, responseProcessor); 8746 } 8747 8748 /** 8749 * Get Origin Trials on given frame. 8750 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8751 * 8752 * @param frameId - 8753 * 8754 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8755 * {@link Page.OriginTrial}[]></CODE> 8756 * 8757 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 8758 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 8759 * {@link Page.OriginTrial}[]></CODE> will be returned. 8760 * 8761 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 8762 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 8763 * may be retrieved.</I> 8764 * 8765 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 8766 * <BR /><BR /><UL CLASS=JDUL> 8767 * <LI><CODE>{@link Page.OriginTrial}[] (<B>originTrials</B></CODE>) 8768 * <BR />- 8769 * </LI> 8770 * </UL> */ 8771 public static Script<String, JsonObject, Page.OriginTrial[]> getOriginTrials(String frameId) 8772 { 8773 // Exception-Check(s) to ensure that if any parameters which are not declared as 8774 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8775 8776 if (frameId == null) THROWS.throwNPE("frameId"); 8777 8778 final int webSocketID = 35035000 + counter++; 8779 final boolean[] optionals = { false, }; 8780 8781 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8782 String requestJSON = WriteJSON.get( 8783 parameterTypes.get("getOriginTrials"), 8784 parameterNames.get("getOriginTrials"), 8785 optionals, webSocketID, 8786 "Page.getOriginTrials", 8787 frameId 8788 ); 8789 8790 // 'JSON Binding' ... Converts Browser Response-JSON to 'Page.OriginTrial[]' 8791 Function<JsonObject, Page.OriginTrial[]> responseProcessor = (JsonObject jo) -> 8792 (jo.getJsonArray("originTrials") == null) 8793 ? null 8794 : RJArrIntoStream.objArr(jo.getJsonArray("originTrials"), null, 0, Page.OriginTrial.class).toArray(Page.OriginTrial[]::new); 8795 8796 return new Script<>(webSocketID, requestJSON, responseProcessor); 8797 } 8798 8799 /** 8800 * Overrides the values of device screen dimensions (window.screen.width, window.screen.height, 8801 * window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media 8802 * query results). 8803 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 8804 * 8805 * @param width Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. 8806 * 8807 * @param height Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override. 8808 * 8809 * @param deviceScaleFactor Overriding device scale factor value. 0 disables the override. 8810 * 8811 * @param mobile 8812 * Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text 8813 * autosizing and more. 8814 * 8815 * @param scale Scale to apply to resulting view image. 8816 * <BR /><B CLASS=Opt>OPTIONAL</B> 8817 * 8818 * @param screenWidth Overriding screen width value in pixels (minimum 0, maximum 10000000). 8819 * <BR /><B CLASS=Opt>OPTIONAL</B> 8820 * 8821 * @param screenHeight Overriding screen height value in pixels (minimum 0, maximum 10000000). 8822 * <BR /><B CLASS=Opt>OPTIONAL</B> 8823 * 8824 * @param positionX Overriding view X position on screen in pixels (minimum 0, maximum 10000000). 8825 * <BR /><B CLASS=Opt>OPTIONAL</B> 8826 * 8827 * @param positionY Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). 8828 * <BR /><B CLASS=Opt>OPTIONAL</B> 8829 * 8830 * @param dontSetVisibleSize Do not set visible view size, rely upon explicit setVisibleSize call. 8831 * <BR /><B CLASS=Opt>OPTIONAL</B> 8832 * 8833 * @param screenOrientation Screen orientation override. 8834 * <BR /><B CLASS=Opt>OPTIONAL</B> 8835 * 8836 * @param viewport The viewport dimensions and scale. If not set, the override is cleared. 8837 * <BR /><B CLASS=Opt>OPTIONAL</B> 8838 * 8839 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8840 * {@link Ret0}></CODE> 8841 * 8842 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8843 * browser receives the invocation-request. 8844 * 8845 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8846 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8847 * {@code >} to ensure the Browser Function has run to completion. 8848 */ 8849 public static Script<String, JsonObject, Ret0> setDeviceMetricsOverride( 8850 int width, int height, Number deviceScaleFactor, boolean mobile, Number scale, 8851 Integer screenWidth, Integer screenHeight, Integer positionX, Integer positionY, 8852 Boolean dontSetVisibleSize, Emulation.ScreenOrientation screenOrientation, 8853 Page.Viewport viewport 8854 ) 8855 { 8856 // Exception-Check(s) to ensure that if any parameters which are not declared as 8857 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8858 8859 if (deviceScaleFactor == null) THROWS.throwNPE("deviceScaleFactor"); 8860 8861 final int webSocketID = 35036000 + counter++; 8862 final boolean[] optionals = { false, false, false, false, true, true, true, true, true, true, true, true, }; 8863 8864 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8865 String requestJSON = WriteJSON.get( 8866 parameterTypes.get("setDeviceMetricsOverride"), 8867 parameterNames.get("setDeviceMetricsOverride"), 8868 optionals, webSocketID, 8869 "Page.setDeviceMetricsOverride", 8870 width, height, deviceScaleFactor, mobile, scale, screenWidth, screenHeight, positionX, 8871 positionY, dontSetVisibleSize, screenOrientation, viewport 8872 ); 8873 8874 // This Remote Command does not have a Return-Value. 8875 return new Script<> 8876 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8877 } 8878 8879 /** 8880 * Overrides the Device Orientation. 8881 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 8882 * 8883 * @param alpha Mock alpha 8884 * 8885 * @param beta Mock beta 8886 * 8887 * @param gamma Mock gamma 8888 * 8889 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8890 * {@link Ret0}></CODE> 8891 * 8892 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8893 * browser receives the invocation-request. 8894 * 8895 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8896 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8897 * {@code >} to ensure the Browser Function has run to completion. 8898 */ 8899 public static Script<String, JsonObject, Ret0> setDeviceOrientationOverride 8900 (Number alpha, Number beta, Number gamma) 8901 { 8902 // Exception-Check(s) to ensure that if any parameters which are not declared as 8903 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8904 8905 if (alpha == null) THROWS.throwNPE("alpha"); 8906 if (beta == null) THROWS.throwNPE("beta"); 8907 if (gamma == null) THROWS.throwNPE("gamma"); 8908 8909 final int webSocketID = 35037000 + counter++; 8910 final boolean[] optionals = { false, false, false, }; 8911 8912 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8913 String requestJSON = WriteJSON.get( 8914 parameterTypes.get("setDeviceOrientationOverride"), 8915 parameterNames.get("setDeviceOrientationOverride"), 8916 optionals, webSocketID, 8917 "Page.setDeviceOrientationOverride", 8918 alpha, beta, gamma 8919 ); 8920 8921 // This Remote Command does not have a Return-Value. 8922 return new Script<> 8923 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8924 } 8925 8926 /** 8927 * Set generic font families. 8928 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8929 * 8930 * @param fontFamilies Specifies font families to set. If a font family is not specified, it won't be changed. 8931 * 8932 * @param forScripts Specifies font families to set for individual scripts. 8933 * <BR /><B CLASS=Opt>OPTIONAL</B> 8934 * 8935 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8936 * {@link Ret0}></CODE> 8937 * 8938 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8939 * browser receives the invocation-request. 8940 * 8941 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8942 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8943 * {@code >} to ensure the Browser Function has run to completion. 8944 */ 8945 public static Script<String, JsonObject, Ret0> setFontFamilies 8946 (Page.FontFamilies fontFamilies, Page.ScriptFontFamilies[] forScripts) 8947 { 8948 // Exception-Check(s) to ensure that if any parameters which are not declared as 8949 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8950 8951 if (fontFamilies == null) THROWS.throwNPE("fontFamilies"); 8952 8953 final int webSocketID = 35038000 + counter++; 8954 final boolean[] optionals = { false, true, }; 8955 8956 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8957 String requestJSON = WriteJSON.get( 8958 parameterTypes.get("setFontFamilies"), 8959 parameterNames.get("setFontFamilies"), 8960 optionals, webSocketID, 8961 "Page.setFontFamilies", 8962 fontFamilies, forScripts 8963 ); 8964 8965 // This Remote Command does not have a Return-Value. 8966 return new Script<> 8967 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 8968 } 8969 8970 /** 8971 * Set default font sizes. 8972 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 8973 * 8974 * @param fontSizes Specifies font sizes to set. If a font size is not specified, it won't be changed. 8975 * 8976 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 8977 * {@link Ret0}></CODE> 8978 * 8979 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 8980 * browser receives the invocation-request. 8981 * 8982 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 8983 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 8984 * {@code >} to ensure the Browser Function has run to completion. 8985 */ 8986 public static Script<String, JsonObject, Ret0> setFontSizes(Page.FontSizes fontSizes) 8987 { 8988 // Exception-Check(s) to ensure that if any parameters which are not declared as 8989 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8990 8991 if (fontSizes == null) THROWS.throwNPE("fontSizes"); 8992 8993 final int webSocketID = 35039000 + counter++; 8994 final boolean[] optionals = { false, }; 8995 8996 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 8997 String requestJSON = WriteJSON.get( 8998 parameterTypes.get("setFontSizes"), 8999 parameterNames.get("setFontSizes"), 9000 optionals, webSocketID, 9001 "Page.setFontSizes", 9002 fontSizes 9003 ); 9004 9005 // This Remote Command does not have a Return-Value. 9006 return new Script<> 9007 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9008 } 9009 9010 /** 9011 * Sets given markup as the document's HTML. 9012 * 9013 * @param frameId Frame id to set HTML for. 9014 * 9015 * @param html HTML content to set. 9016 * 9017 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9018 * {@link Ret0}></CODE> 9019 * 9020 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9021 * browser receives the invocation-request. 9022 * 9023 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9024 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9025 * {@code >} to ensure the Browser Function has run to completion. 9026 */ 9027 public static Script<String, JsonObject, Ret0> setDocumentContent 9028 (String frameId, String html) 9029 { 9030 // Exception-Check(s) to ensure that if any parameters which are not declared as 9031 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9032 9033 if (frameId == null) THROWS.throwNPE("frameId"); 9034 if (html == null) THROWS.throwNPE("html"); 9035 9036 final int webSocketID = 35040000 + counter++; 9037 final boolean[] optionals = { false, false, }; 9038 9039 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9040 String requestJSON = WriteJSON.get( 9041 parameterTypes.get("setDocumentContent"), 9042 parameterNames.get("setDocumentContent"), 9043 optionals, webSocketID, 9044 "Page.setDocumentContent", 9045 frameId, html 9046 ); 9047 9048 // This Remote Command does not have a Return-Value. 9049 return new Script<> 9050 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9051 } 9052 9053 /** 9054 * Set the behavior when downloading a file. 9055 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 9056 * 9057 * @param behavior 9058 * Whether to allow all or deny all download requests, or use default Chrome behavior if 9059 * available (otherwise deny). 9060 * <BR />Acceptable Values: ["deny", "allow", "default"] 9061 * 9062 * @param downloadPath The default path to save downloaded files to. This is required if behavior is set to 'allow' 9063 * <BR /><B CLASS=Opt>OPTIONAL</B> 9064 * 9065 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9066 * {@link Ret0}></CODE> 9067 * 9068 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9069 * browser receives the invocation-request. 9070 * 9071 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9072 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9073 * {@code >} to ensure the Browser Function has run to completion. 9074 */ 9075 public static Script<String, JsonObject, Ret0> setDownloadBehavior 9076 (String behavior, String downloadPath) 9077 { 9078 // Exception-Check(s) to ensure that if any parameters which are not declared as 9079 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9080 9081 if (behavior == null) THROWS.throwNPE("behavior"); 9082 9083 // Exception-Check(s) to ensure that if any parameters which must adhere to a 9084 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 9085 9086 THROWS.checkIAE( 9087 "behavior", behavior, 9088 "deny", "allow", "default" 9089 ); 9090 9091 final int webSocketID = 35041000 + counter++; 9092 final boolean[] optionals = { false, true, }; 9093 9094 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9095 String requestJSON = WriteJSON.get( 9096 parameterTypes.get("setDownloadBehavior"), 9097 parameterNames.get("setDownloadBehavior"), 9098 optionals, webSocketID, 9099 "Page.setDownloadBehavior", 9100 behavior, downloadPath 9101 ); 9102 9103 // This Remote Command does not have a Return-Value. 9104 return new Script<> 9105 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9106 } 9107 9108 /** 9109 * Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position 9110 * unavailable. 9111 * <BR /><B CLASS=Dep-Top>DEPRECATED</B> 9112 * 9113 * @param latitude Mock latitude 9114 * <BR /><B CLASS=Opt>OPTIONAL</B> 9115 * 9116 * @param longitude Mock longitude 9117 * <BR /><B CLASS=Opt>OPTIONAL</B> 9118 * 9119 * @param accuracy Mock accuracy 9120 * <BR /><B CLASS=Opt>OPTIONAL</B> 9121 * 9122 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9123 * {@link Ret0}></CODE> 9124 * 9125 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9126 * browser receives the invocation-request. 9127 * 9128 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9129 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9130 * {@code >} to ensure the Browser Function has run to completion. 9131 */ 9132 public static Script<String, JsonObject, Ret0> setGeolocationOverride 9133 (Number latitude, Number longitude, Number accuracy) 9134 { 9135 final int webSocketID = 35042000 + counter++; 9136 final boolean[] optionals = { true, true, true, }; 9137 9138 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9139 String requestJSON = WriteJSON.get( 9140 parameterTypes.get("setGeolocationOverride"), 9141 parameterNames.get("setGeolocationOverride"), 9142 optionals, webSocketID, 9143 "Page.setGeolocationOverride", 9144 latitude, longitude, accuracy 9145 ); 9146 9147 // This Remote Command does not have a Return-Value. 9148 return new Script<> 9149 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9150 } 9151 9152 /** 9153 * Controls whether page will emit lifecycle events. 9154 * 9155 * @param enabled If true, starts emitting lifecycle events. 9156 * 9157 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9158 * {@link Ret0}></CODE> 9159 * 9160 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9161 * browser receives the invocation-request. 9162 * 9163 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9164 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9165 * {@code >} to ensure the Browser Function has run to completion. 9166 */ 9167 public static Script<String, JsonObject, Ret0> setLifecycleEventsEnabled(boolean enabled) 9168 { 9169 final int webSocketID = 35043000 + counter++; 9170 final boolean[] optionals = { false, }; 9171 9172 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9173 String requestJSON = WriteJSON.get( 9174 parameterTypes.get("setLifecycleEventsEnabled"), 9175 parameterNames.get("setLifecycleEventsEnabled"), 9176 optionals, webSocketID, 9177 "Page.setLifecycleEventsEnabled", 9178 enabled 9179 ); 9180 9181 // This Remote Command does not have a Return-Value. 9182 return new Script<> 9183 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9184 } 9185 9186 /** 9187 * Toggles mouse event-based touch event emulation. 9188 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 9189 * 9190 * @param enabled Whether the touch event emulation should be enabled. 9191 * 9192 * @param configuration Touch/gesture events configuration. Default: current platform. 9193 * <BR />Acceptable Values: ["mobile", "desktop"] 9194 * <BR /><B CLASS=Opt>OPTIONAL</B> 9195 * 9196 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9197 * {@link Ret0}></CODE> 9198 * 9199 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9200 * browser receives the invocation-request. 9201 * 9202 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9203 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9204 * {@code >} to ensure the Browser Function has run to completion. 9205 */ 9206 public static Script<String, JsonObject, Ret0> setTouchEmulationEnabled 9207 (boolean enabled, String configuration) 9208 { 9209 // Exception-Check(s) to ensure that if any parameters which must adhere to a 9210 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 9211 9212 THROWS.checkIAE( 9213 "configuration", configuration, 9214 "mobile", "desktop" 9215 ); 9216 9217 final int webSocketID = 35044000 + counter++; 9218 final boolean[] optionals = { false, true, }; 9219 9220 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9221 String requestJSON = WriteJSON.get( 9222 parameterTypes.get("setTouchEmulationEnabled"), 9223 parameterNames.get("setTouchEmulationEnabled"), 9224 optionals, webSocketID, 9225 "Page.setTouchEmulationEnabled", 9226 enabled, configuration 9227 ); 9228 9229 // This Remote Command does not have a Return-Value. 9230 return new Script<> 9231 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9232 } 9233 9234 /** 9235 * Starts sending each frame using the {@code screencastFrame} event. 9236 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9237 * 9238 * @param format Image compression format. 9239 * <BR />Acceptable Values: ["jpeg", "png"] 9240 * <BR /><B CLASS=Opt>OPTIONAL</B> 9241 * 9242 * @param quality Compression quality from range [0..100]. 9243 * <BR /><B CLASS=Opt>OPTIONAL</B> 9244 * 9245 * @param maxWidth Maximum screenshot width. 9246 * <BR /><B CLASS=Opt>OPTIONAL</B> 9247 * 9248 * @param maxHeight Maximum screenshot height. 9249 * <BR /><B CLASS=Opt>OPTIONAL</B> 9250 * 9251 * @param everyNthFrame Send every n-th frame. 9252 * <BR /><B CLASS=Opt>OPTIONAL</B> 9253 * 9254 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9255 * {@link Ret0}></CODE> 9256 * 9257 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9258 * browser receives the invocation-request. 9259 * 9260 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9261 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9262 * {@code >} to ensure the Browser Function has run to completion. 9263 */ 9264 public static Script<String, JsonObject, Ret0> startScreencast 9265 (String format, Integer quality, Integer maxWidth, Integer maxHeight, Integer everyNthFrame) 9266 { 9267 // Exception-Check(s) to ensure that if any parameters which must adhere to a 9268 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 9269 9270 THROWS.checkIAE( 9271 "format", format, 9272 "jpeg", "png" 9273 ); 9274 9275 final int webSocketID = 35045000 + counter++; 9276 final boolean[] optionals = { true, true, true, true, true, }; 9277 9278 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9279 String requestJSON = WriteJSON.get( 9280 parameterTypes.get("startScreencast"), 9281 parameterNames.get("startScreencast"), 9282 optionals, webSocketID, 9283 "Page.startScreencast", 9284 format, quality, maxWidth, maxHeight, everyNthFrame 9285 ); 9286 9287 // This Remote Command does not have a Return-Value. 9288 return new Script<> 9289 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9290 } 9291 9292 /** 9293 * Force the page stop all navigations and pending resource fetches. 9294 * 9295 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9296 * {@link Ret0}></CODE> 9297 * 9298 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9299 * browser receives the invocation-request. 9300 * 9301 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9302 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9303 * {@code >} to ensure the Browser Function has run to completion. 9304 */ 9305 public static Script<String, JsonObject, Ret0> stopLoading() 9306 { 9307 final int webSocketID = 35046000 + counter++; 9308 final boolean[] optionals = new boolean[0]; 9309 9310 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9311 String requestJSON = WriteJSON.get( 9312 parameterTypes.get("stopLoading"), 9313 parameterNames.get("stopLoading"), 9314 optionals, webSocketID, 9315 "Page.stopLoading" 9316 ); 9317 9318 // This Remote Command does not have a Return-Value. 9319 return new Script<> 9320 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9321 } 9322 9323 /** 9324 * Crashes renderer on the IO thread, generates minidumps. 9325 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9326 * 9327 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9328 * {@link Ret0}></CODE> 9329 * 9330 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9331 * browser receives the invocation-request. 9332 * 9333 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9334 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9335 * {@code >} to ensure the Browser Function has run to completion. 9336 */ 9337 public static Script<String, JsonObject, Ret0> crash() 9338 { 9339 final int webSocketID = 35047000 + counter++; 9340 final boolean[] optionals = new boolean[0]; 9341 9342 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9343 String requestJSON = WriteJSON.get( 9344 parameterTypes.get("crash"), 9345 parameterNames.get("crash"), 9346 optionals, webSocketID, 9347 "Page.crash" 9348 ); 9349 9350 // This Remote Command does not have a Return-Value. 9351 return new Script<> 9352 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9353 } 9354 9355 /** 9356 * Tries to close page, running its beforeunload hooks, if any. 9357 * 9358 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9359 * {@link Ret0}></CODE> 9360 * 9361 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9362 * browser receives the invocation-request. 9363 * 9364 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9365 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9366 * {@code >} to ensure the Browser Function has run to completion. 9367 */ 9368 public static Script<String, JsonObject, Ret0> close() 9369 { 9370 final int webSocketID = 35048000 + counter++; 9371 final boolean[] optionals = new boolean[0]; 9372 9373 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9374 String requestJSON = WriteJSON.get( 9375 parameterTypes.get("close"), 9376 parameterNames.get("close"), 9377 optionals, webSocketID, 9378 "Page.close" 9379 ); 9380 9381 // This Remote Command does not have a Return-Value. 9382 return new Script<> 9383 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9384 } 9385 9386 /** 9387 * Tries to update the web lifecycle state of the page. 9388 * It will transition the page to the given state according to: 9389 * https://github.com/WICG/web-lifecycle/ 9390 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9391 * 9392 * @param state Target lifecycle state 9393 * <BR />Acceptable Values: ["frozen", "active"] 9394 * 9395 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9396 * {@link Ret0}></CODE> 9397 * 9398 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9399 * browser receives the invocation-request. 9400 * 9401 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9402 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9403 * {@code >} to ensure the Browser Function has run to completion. 9404 */ 9405 public static Script<String, JsonObject, Ret0> setWebLifecycleState(String state) 9406 { 9407 // Exception-Check(s) to ensure that if any parameters which are not declared as 9408 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9409 9410 if (state == null) THROWS.throwNPE("state"); 9411 9412 // Exception-Check(s) to ensure that if any parameters which must adhere to a 9413 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 9414 9415 THROWS.checkIAE( 9416 "state", state, 9417 "frozen", "active" 9418 ); 9419 9420 final int webSocketID = 35049000 + counter++; 9421 final boolean[] optionals = { false, }; 9422 9423 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9424 String requestJSON = WriteJSON.get( 9425 parameterTypes.get("setWebLifecycleState"), 9426 parameterNames.get("setWebLifecycleState"), 9427 optionals, webSocketID, 9428 "Page.setWebLifecycleState", 9429 state 9430 ); 9431 9432 // This Remote Command does not have a Return-Value. 9433 return new Script<> 9434 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9435 } 9436 9437 /** 9438 * Stops sending each frame in the {@code screencastFrame}. 9439 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9440 * 9441 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9442 * {@link Ret0}></CODE> 9443 * 9444 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9445 * browser receives the invocation-request. 9446 * 9447 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9448 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9449 * {@code >} to ensure the Browser Function has run to completion. 9450 */ 9451 public static Script<String, JsonObject, Ret0> stopScreencast() 9452 { 9453 final int webSocketID = 35050000 + counter++; 9454 final boolean[] optionals = new boolean[0]; 9455 9456 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9457 String requestJSON = WriteJSON.get( 9458 parameterTypes.get("stopScreencast"), 9459 parameterNames.get("stopScreencast"), 9460 optionals, webSocketID, 9461 "Page.stopScreencast" 9462 ); 9463 9464 // This Remote Command does not have a Return-Value. 9465 return new Script<> 9466 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9467 } 9468 9469 /** 9470 * Requests backend to produce compilation cache for the specified scripts. 9471 * {@code scripts} are appended to the list of scripts for which the cache 9472 * would be produced. The list may be reset during page navigation. 9473 * When script with a matching URL is encountered, the cache is optionally 9474 * produced upon backend discretion, based on internal heuristics. 9475 * See also: {@code Page.compilationCacheProduced}. 9476 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9477 * 9478 * @param scripts - 9479 * 9480 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9481 * {@link Ret0}></CODE> 9482 * 9483 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9484 * browser receives the invocation-request. 9485 * 9486 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9487 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9488 * {@code >} to ensure the Browser Function has run to completion. 9489 */ 9490 public static Script<String, JsonObject, Ret0> produceCompilationCache 9491 (Page.CompilationCacheParams[] scripts) 9492 { 9493 // Exception-Check(s) to ensure that if any parameters which are not declared as 9494 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9495 9496 if (scripts == null) THROWS.throwNPE("scripts"); 9497 9498 final int webSocketID = 35051000 + counter++; 9499 final boolean[] optionals = { false, }; 9500 9501 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9502 String requestJSON = WriteJSON.get( 9503 parameterTypes.get("produceCompilationCache"), 9504 parameterNames.get("produceCompilationCache"), 9505 optionals, webSocketID, 9506 "Page.produceCompilationCache", 9507 (Object) scripts 9508 ); 9509 9510 // This Remote Command does not have a Return-Value. 9511 return new Script<> 9512 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9513 } 9514 9515 /** 9516 * Seeds compilation cache for given url. Compilation cache does not survive 9517 * cross-process navigation. 9518 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9519 * 9520 * @param url - 9521 * 9522 * @param data Base64-encoded data (Encoded as a base64 string when passed over JSON) 9523 * 9524 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9525 * {@link Ret0}></CODE> 9526 * 9527 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9528 * browser receives the invocation-request. 9529 * 9530 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9531 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9532 * {@code >} to ensure the Browser Function has run to completion. 9533 */ 9534 public static Script<String, JsonObject, Ret0> addCompilationCache(String url, String data) 9535 { 9536 // Exception-Check(s) to ensure that if any parameters which are not declared as 9537 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9538 9539 if (url == null) THROWS.throwNPE("url"); 9540 if (data == null) THROWS.throwNPE("data"); 9541 9542 final int webSocketID = 35052000 + counter++; 9543 final boolean[] optionals = { false, false, }; 9544 9545 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9546 String requestJSON = WriteJSON.get( 9547 parameterTypes.get("addCompilationCache"), 9548 parameterNames.get("addCompilationCache"), 9549 optionals, webSocketID, 9550 "Page.addCompilationCache", 9551 url, data 9552 ); 9553 9554 // This Remote Command does not have a Return-Value. 9555 return new Script<> 9556 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9557 } 9558 9559 /** 9560 * Clears seeded compilation cache. 9561 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9562 * 9563 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9564 * {@link Ret0}></CODE> 9565 * 9566 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9567 * browser receives the invocation-request. 9568 * 9569 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9570 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9571 * {@code >} to ensure the Browser Function has run to completion. 9572 */ 9573 public static Script<String, JsonObject, Ret0> clearCompilationCache() 9574 { 9575 final int webSocketID = 35053000 + counter++; 9576 final boolean[] optionals = new boolean[0]; 9577 9578 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9579 String requestJSON = WriteJSON.get( 9580 parameterTypes.get("clearCompilationCache"), 9581 parameterNames.get("clearCompilationCache"), 9582 optionals, webSocketID, 9583 "Page.clearCompilationCache" 9584 ); 9585 9586 // This Remote Command does not have a Return-Value. 9587 return new Script<> 9588 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9589 } 9590 9591 /** 9592 * Sets the Secure Payment Confirmation transaction mode. 9593 * https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode 9594 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9595 * 9596 * @param mode - 9597 * <BR />Acceptable Values: ["none", "autoAccept", "autoChooseToAuthAnotherWay", "autoReject", "autoOptOut"] 9598 * 9599 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9600 * {@link Ret0}></CODE> 9601 * 9602 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9603 * browser receives the invocation-request. 9604 * 9605 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9606 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9607 * {@code >} to ensure the Browser Function has run to completion. 9608 */ 9609 public static Script<String, JsonObject, Ret0> setSPCTransactionMode(String mode) 9610 { 9611 // Exception-Check(s) to ensure that if any parameters which are not declared as 9612 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9613 9614 if (mode == null) THROWS.throwNPE("mode"); 9615 9616 // Exception-Check(s) to ensure that if any parameters which must adhere to a 9617 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 9618 9619 THROWS.checkIAE( 9620 "mode", mode, 9621 "none", "autoAccept", "autoChooseToAuthAnotherWay", "autoReject", "autoOptOut" 9622 ); 9623 9624 final int webSocketID = 35054000 + counter++; 9625 final boolean[] optionals = { false, }; 9626 9627 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9628 String requestJSON = WriteJSON.get( 9629 parameterTypes.get("setSPCTransactionMode"), 9630 parameterNames.get("setSPCTransactionMode"), 9631 optionals, webSocketID, 9632 "Page.setSPCTransactionMode", 9633 mode 9634 ); 9635 9636 // This Remote Command does not have a Return-Value. 9637 return new Script<> 9638 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9639 } 9640 9641 /** 9642 * Extensions for Custom Handlers API: 9643 * https://html.spec.whatwg.org/multipage/system-state.html#rph-automation 9644 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9645 * 9646 * @param mode - 9647 * <BR />Acceptable Values: ["none", "autoAccept", "autoReject"] 9648 * 9649 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9650 * {@link Ret0}></CODE> 9651 * 9652 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9653 * browser receives the invocation-request. 9654 * 9655 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9656 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9657 * {@code >} to ensure the Browser Function has run to completion. 9658 */ 9659 public static Script<String, JsonObject, Ret0> setRPHRegistrationMode(String mode) 9660 { 9661 // Exception-Check(s) to ensure that if any parameters which are not declared as 9662 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9663 9664 if (mode == null) THROWS.throwNPE("mode"); 9665 9666 // Exception-Check(s) to ensure that if any parameters which must adhere to a 9667 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 9668 9669 THROWS.checkIAE( 9670 "mode", mode, 9671 "none", "autoAccept", "autoReject" 9672 ); 9673 9674 final int webSocketID = 35055000 + counter++; 9675 final boolean[] optionals = { false, }; 9676 9677 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9678 String requestJSON = WriteJSON.get( 9679 parameterTypes.get("setRPHRegistrationMode"), 9680 parameterNames.get("setRPHRegistrationMode"), 9681 optionals, webSocketID, 9682 "Page.setRPHRegistrationMode", 9683 mode 9684 ); 9685 9686 // This Remote Command does not have a Return-Value. 9687 return new Script<> 9688 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9689 } 9690 9691 /** 9692 * Generates a report for testing. 9693 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9694 * 9695 * @param message Message to be displayed in the report. 9696 * 9697 * @param group Specifies the endpoint group to deliver the report to. 9698 * <BR /><B CLASS=Opt>OPTIONAL</B> 9699 * 9700 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9701 * {@link Ret0}></CODE> 9702 * 9703 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9704 * browser receives the invocation-request. 9705 * 9706 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9707 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9708 * {@code >} to ensure the Browser Function has run to completion. 9709 */ 9710 public static Script<String, JsonObject, Ret0> generateTestReport 9711 (String message, String group) 9712 { 9713 // Exception-Check(s) to ensure that if any parameters which are not declared as 9714 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9715 9716 if (message == null) THROWS.throwNPE("message"); 9717 9718 final int webSocketID = 35056000 + counter++; 9719 final boolean[] optionals = { false, true, }; 9720 9721 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9722 String requestJSON = WriteJSON.get( 9723 parameterTypes.get("generateTestReport"), 9724 parameterNames.get("generateTestReport"), 9725 optionals, webSocketID, 9726 "Page.generateTestReport", 9727 message, group 9728 ); 9729 9730 // This Remote Command does not have a Return-Value. 9731 return new Script<> 9732 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9733 } 9734 9735 /** 9736 * Pauses page execution. Can be resumed using generic RunTime.runIfWaitingForDebugger. 9737 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9738 * 9739 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9740 * {@link Ret0}></CODE> 9741 * 9742 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9743 * browser receives the invocation-request. 9744 * 9745 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9746 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9747 * {@code >} to ensure the Browser Function has run to completion. 9748 */ 9749 public static Script<String, JsonObject, Ret0> waitForDebugger() 9750 { 9751 final int webSocketID = 35057000 + counter++; 9752 final boolean[] optionals = new boolean[0]; 9753 9754 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9755 String requestJSON = WriteJSON.get( 9756 parameterTypes.get("waitForDebugger"), 9757 parameterNames.get("waitForDebugger"), 9758 optionals, webSocketID, 9759 "Page.waitForDebugger" 9760 ); 9761 9762 // This Remote Command does not have a Return-Value. 9763 return new Script<> 9764 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9765 } 9766 9767 /** 9768 * Intercept file chooser requests and transfer control to protocol clients. 9769 * When file chooser interception is enabled, native file chooser dialog is not shown. 9770 * Instead, a protocol event {@code Page.fileChooserOpened} is emitted. 9771 * 9772 * @param enabled - 9773 * 9774 * @param cancel 9775 * If true, cancels the dialog by emitting relevant events (if any) 9776 * in addition to not showing it if the interception is enabled 9777 * (default: false). 9778 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 9779 * 9780 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9781 * {@link Ret0}></CODE> 9782 * 9783 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9784 * browser receives the invocation-request. 9785 * 9786 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9787 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9788 * {@code >} to ensure the Browser Function has run to completion. 9789 */ 9790 public static Script<String, JsonObject, Ret0> setInterceptFileChooserDialog 9791 (boolean enabled, Boolean cancel) 9792 { 9793 final int webSocketID = 35058000 + counter++; 9794 final boolean[] optionals = { false, true, }; 9795 9796 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9797 String requestJSON = WriteJSON.get( 9798 parameterTypes.get("setInterceptFileChooserDialog"), 9799 parameterNames.get("setInterceptFileChooserDialog"), 9800 optionals, webSocketID, 9801 "Page.setInterceptFileChooserDialog", 9802 enabled, cancel 9803 ); 9804 9805 // This Remote Command does not have a Return-Value. 9806 return new Script<> 9807 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9808 } 9809 9810 /** 9811 * Enable/disable prerendering manually. 9812 * 9813 * This command is a short-term solution for https://crbug.com/1440085. 9814 * See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA 9815 * for more details. 9816 * 9817 * TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets. 9818 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 9819 * 9820 * @param isAllowed - 9821 * 9822 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 9823 * {@link Ret0}></CODE> 9824 * 9825 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 9826 * browser receives the invocation-request. 9827 * 9828 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 9829 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 9830 * {@code >} to ensure the Browser Function has run to completion. 9831 */ 9832 public static Script<String, JsonObject, Ret0> setPrerenderingAllowed(boolean isAllowed) 9833 { 9834 final int webSocketID = 35059000 + counter++; 9835 final boolean[] optionals = { false, }; 9836 9837 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 9838 String requestJSON = WriteJSON.get( 9839 parameterTypes.get("setPrerenderingAllowed"), 9840 parameterNames.get("setPrerenderingAllowed"), 9841 optionals, webSocketID, 9842 "Page.setPrerenderingAllowed", 9843 isAllowed 9844 ); 9845 9846 // This Remote Command does not have a Return-Value. 9847 return new Script<> 9848 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 9849 } 9850 9851}