Package Torello.Browser.BrowserAPI
Class Page
- java.lang.Object
-
- Torello.Browser.BrowserAPI.Page
-
public class Page extends java.lang.Object
This class was built using the Chrome Remote Dev-Tools A.P.I., which is specified by two JSON-RPC Files. These files were obtained from the Chrome Dev Tools Protocol Git Hub Page, which has a "Tip of Tree" (the latest) API-Specification Page Here: JSON-RPC Protocol Specification.
These files were converted into this Java-Browser (CDP) Library. The intention is to have them function in a similar fasion to the Node.js Tool known as 'Puppeteer', Microsoft's 'Playwright' and of course the Main-Stay 'Selenium.' The Java-HTML JAR Library merely implements the Java Types & Commands defined by Google's DevTools Protocol.
🧠 View the Google CDP API:
Actions and events related to the inspected page belong to the page domain.
The top-level description and explanation for this class (this comment, at the top this Java-Doc Page) is repeated, verbatim, across all of the domain classes which comprise Google's CDP API.This class is intended to be used with a Browser Instance
These methods have been tested, to some degree, using Google Chrome. In order to use this class you must start a web-browser instance and make a connection to the browser using aRemote Debugging Port. Google-Corporation is the developer of this API, but any browser which accepts a Remote Debug Port Connection over Web-Sockets.
Google-Chrome was used during the development process of the classes in this particular package. Lately, it has been asserted Microsoft has switched to using the Chrome Browser-Engine for its Microsoft Edge Internal Code-Base. Therefore, there may some functionality available when running the methods in this class with Microsoft-Edge.
Check whether the your Web-Browser will allow itself to be driven by theWeb-Socket RDP-Port 9223. See the examples available in packageTorello.Browserto undertand how to build aPageConnandBrowserConnWeb-Socket Connection, and how to build aWebSocketSenderinstance in order to execute the methods in this class.
Web-Socket & JSON API:
Every one of the methods that reside in this class are designed to do nothing more than:- Accept Parameters from the User, and "Marshall Them" into a Valid JSON-Request
- Transmit the Marshalled Request-JSON to a Headless Web-Browser over a Web-Socket Connection
- Receive BOTH that Command-Results AND any Browser Event-Firings from the Web-Socket
- Parse JSON Method-Results and Browser-Event Firings, and Subsequently Convert them to Standard Java-Types
- Report these Method-Results and Browser-Events to the User via a User-Registered, Event-Listener (Events) or a Promise Object (Command Responses / Results)
Unlike the bulk of the Java HTML JAR Library, there is very little native Java-Code, and very little testing that may be done on any of the classes & methods in this package. The code inside these classes does nothing more than marshall-and-unmarshall Java-Types into Json-Requests (and vice-versa). The Java-Script & Browser modules inside of a Google-Chrome instance are, theoretically, handling these requests, and returning their results (or events) over the Web-Socket Connection.
It has been asserted (by Google Chrome Developers) that some of these methods are only "partially working" or "experimental".
Asking Chat-GPT for Help:
The LLM otherwise known as "Chat-GPT" does, indeed, have an expert level of knowledge about the "Remote DevTools Protocol". The API that theChrome DevTools Protocl (CDP)exports is extremely well understood by the LLM, and generally I have found that Chat-GPT understands (by 2 or 3 orders of magnitude) better what my Auto-Generated JSON-Wrappers can do in controlling a Web-Browser than I could ever possibly hope to understand.
Though not available today, there will soon be an automatically downloadable Token-Stream (AI Embeddings) BUTTON available on my Java-Doc Pages that should hopefully make it extremely easy to post my code-base, RAG Style, to Chat-GPT and other LLM's when 'interogating' them. Presently, because my "Get Token Stream Button" does not exist yet on any of my pages, what you can do is copy-and-paste any Method-Signature from any one of these pages and then ask Chat-GPT to explain what that Browser or Java-Script Function is actually doing. It is very likely to give you some pretty neat answers.
I have found that every single one of the Domains, Types & Events which are offered by the CDP Protocol (though not documented very well by Google), are perfectly understood by the A.I. LLM - literally to the point where it does know (much better than I ever could) what my own code base actually does!
Try it out, it's a lot of fun. Note that this package and these classes were originally developed solely to be able to execute the Java-Script that a browser executes when visiting a Web-Site. Complete HTML-Page Content can be scraped (using the HTML Data-Scraping Tools in Java-HTML) off of Web-Sites that have dynamic / Java-Script Generated Content.
Conspicuous Boxed-Types Usage:
You may notice that there are many methods that have parameters which accept, for instance, anInteger, instead of a primitiveint. Just to remind the readiner, in Java Programs aBoxed Typeis a standard Java-Primitive which has been converted into an Object-Reference. The use of Boxed-Types in this code base is an easy-and-fast-way to allow for the concept of "Optional Parameters" or "Optional Field Value."
Whenever you see a method that accepts anInteger, the reason for this Parameter-Type choice is actually to allow a user to pass 'null' to it. This is a simple way to ELIDE passing any value at all to parameters which Google-Chrome would otherwise assert are "Optional." Whenever you pass 'null' to a Boxed-Types in this class, the Json-Processor will simply eliminate that Object-Property from the command altogether; and the browser will simply not receive any value for that parameter when that command is invoked.
The Java Language Specification does not have an easy or well defined means of accepting optional method parameters; so Boxed-Types and 'null' are utilized here. Note that 'null' may be passed to any Command Method-Parameter that is listed asOptionalon the Java-Doc Page description for that parameter.
Hi-Lited Source-Code:This File's Source Code:
- View Here: Torello/Browser/BrowserAPI/Page.java
- Open New Browser-Tab: Torello/Browser/BrowserAPI/Page.java
File Size: 280,213 Bytes Line Count: 6,903 '\n' Characters Found
Helper: Command Invocation Helpers
- View Here: Page$$Commands.java
- Open New Browser-Tab: Page$$Commands.java
File Size: 16,438 Bytes Line Count: 371 '\n' Characters Found
Stateless Class:This class neither contains any program-state, nor can it be instantiated. The@StaticFunctionalAnnotation may also be called 'The Spaghetti Report'.Static-Functionalclasses are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's@StatelessAnnotation.
- 1 Constructor(s), 1 declared private, zero-argument constructor
- 66 Method(s), 66 declared static
- 23 Field(s), 23 declared static, 23 declared final
-
-
Nested Class Summary
Type Nested Classes: Types / Classes that Are Used & Exported by this Domain Modifier and Type Class Description static classPage.AdFrameStatusIndicates whether a frame has been identified as an ad and why.static classPage.AdScriptAncestryEncapsulates the script ancestry and the root script filterlist rule that caused the frame to be labelled as an ad.static classPage.AdScriptIdIdentifies the script which caused a script or frame to be labelled as an ad.static classPage.AppManifestErrorError while paring app manifest.static classPage.AppManifestParsedPropertiesParsed app manifest properties.static classPage.BackForwardCacheBlockingDetails[No Description Provided by Google]static classPage.BackForwardCacheNotRestoredExplanation[No Description Provided by Google]static classPage.BackForwardCacheNotRestoredExplanationTree[No Description Provided by Google]static classPage.CompilationCacheParamsPer-script compilation cache parameters forPage.produceCompilationCachestatic classPage.FileFilter[No Description Provided by Google]static classPage.FileHandler[No Description Provided by Google]static classPage.FontFamiliesGeneric font families collection.static classPage.FontSizesDefault font sizes.static classPage.FrameInformation about the Frame on the page.static classPage.FrameResourceInformation about the Resource on the page.static classPage.FrameResourceTreeInformation about the Frame hierarchy along with their cached resources.static classPage.FrameTreeInformation about the Frame hierarchy.static classPage.ImageResourceThe image definition used in both icon and screenshot.static classPage.InstallabilityErrorThe installability errorstatic classPage.InstallabilityErrorArgument[No Description Provided by Google]static classPage.LaunchHandler[No Description Provided by Google]static classPage.LayoutViewportLayout viewport position and dimensions.static classPage.NavigationEntryNavigation history entry.static classPage.OriginTrial[No Description Provided by Google]static classPage.OriginTrialToken[No Description Provided by Google]static classPage.OriginTrialTokenWithStatus[No Description Provided by Google]static classPage.PermissionsPolicyBlockLocator[No Description Provided by Google]static classPage.PermissionsPolicyFeatureState[No Description Provided by Google]static classPage.ProtocolHandler[No Description Provided by Google]static classPage.RelatedApplication[No Description Provided by Google]static classPage.ScopeExtension[No Description Provided by Google]static classPage.ScreencastFrameMetadataScreencast frame metadata.static classPage.Screenshot[No Description Provided by Google]static classPage.ScriptFontFamiliesFont families collection for a script.static classPage.SecurityOriginDetailsAdditional information about the frame document's security origin.static classPage.ShareTarget[No Description Provided by Google]static classPage.Shortcut[No Description Provided by Google]static classPage.ViewportViewport for capturing screenshot.static classPage.VisualViewportVisual viewport position, dimensions, and scale.static classPage.WebAppManifest[No Description Provided by Google]Event Nested Classes: Browser Events, as Java Inner Classes, Which are Fired by this Domain Modifier and Type Class Description static classPage.backForwardCacheNotUsedFired for failed bfcache history navigations if BackForwardCache feature is enabled.static classPage.compilationCacheProducedIssued for every compilation cache generated.static classPage.documentOpenedFired when opening document to write to.static classPage.domContentEventFired[No Description Provided by Google]static classPage.downloadProgressFired when download makes progress.static classPage.downloadWillBeginFired when page is about to start a download.static classPage.fileChooserOpenedEmitted only whenpage.interceptFileChooseris enabled.static classPage.frameAttachedFired when frame has been attached to its parent.static classPage.frameClearedScheduledNavigationFired when frame no longer has a scheduled navigation.static classPage.frameDetachedFired when frame has been detached from its parent.static classPage.frameNavigatedFired once navigation of the frame has completed.static classPage.frameRequestedNavigationFired when a renderer-initiated navigation is requested.static classPage.frameScheduledNavigationFired when frame schedules a potential navigation.static classPage.frameStartedLoadingFired when frame has started loading.static classPage.frameStartedNavigatingFired when a navigation starts.static classPage.frameStoppedLoadingFired when frame has stopped loading.static classPage.frameSubtreeWillBeDetachedFired before frame subtree is detached.static classPage.javascriptDialogClosedFired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.static classPage.javascriptDialogOpeningFired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.static classPage.lifecycleEventFired for lifecycle events (navigation, load, paint, etc) in the current target (including local frames).static classPage.loadEventFired[No Description Provided by Google]static classPage.navigatedWithinDocumentFired when same-document navigation happens, e.g.static classPage.screencastFrameCompressed image data requested by thestartScreencast.static classPage.screencastVisibilityChangedFired when the page with currently enabled screencast was shown or hidden.static classPage.windowOpenFired when a new window is going to be opened, via window.open(), link click, form submission, etc.Command-Returns Nested Classes: Domain-Commands with Multiple Return-Values, and a Dedicated Inner-Class Modifier and Type Class Description static classPage.getAppId$$RETReturns the unique (PWA) app id.static classPage.getAppManifest$$RETGets the processed manifest for this current document.static classPage.getLayoutMetrics$$RETReturns metrics relating to the layouting of the page, such as viewport bounds/scale.static classPage.getNavigationHistory$$RETReturns navigation history for the current page.static classPage.getResourceContent$$RETReturns content of the given resource.static classPage.navigate$$RETNavigates current page to the given URL.static classPage.printToPDF$$RETPrint page as PDF.
-
Field Summary
Enumerated Strings: Like Java 'enum' Types, but Converted to Read-Only String-Lists Modifier and Type Field Description static ReadOnlyList<String>AdFrameExplanation[No Description Provided by Google]static ReadOnlyList<String>AdFrameTypeIndicates whether a frame has been identified as an ad.static ReadOnlyList<String>BackForwardCacheNotRestoredReasonList of not restored reasons for back-forward cache.static ReadOnlyList<String>BackForwardCacheNotRestoredReasonTypeTypes of not restored reasons for back-forward cache.static ReadOnlyList<String>ClientNavigationDisposition[No Description Provided by Google]static ReadOnlyList<String>ClientNavigationReason[No Description Provided by Google]static ReadOnlyList<String>CrossOriginIsolatedContextTypeIndicates whether the frame is cross-origin isolated and why it is the case.static ReadOnlyList<String>DialogTypeJavascript dialog type.static ReadOnlyList<String>GatedAPIFeatures[No Description Provided by Google]static ReadOnlyList<String>NavigationTypeThe type of a frameNavigated event.static ReadOnlyList<String>OriginTrialStatusStatus for an Origin Trial.static ReadOnlyList<String>OriginTrialTokenStatusOrigin Trial(https://www.chromium.org/blink/origin-trials) support.static ReadOnlyList<String>OriginTrialUsageRestriction[No Description Provided by Google]static ReadOnlyList<String>PermissionsPolicyBlockReasonReason for a permissions policy feature to be disabled.static ReadOnlyList<String>PermissionsPolicyFeatureAll Permissions Policy features.static ReadOnlyList<String>ReferrerPolicyThe referring-policy used for the navigation.static ReadOnlyList<String>SecureContextTypeIndicates whether the frame is a secure context and why it is the case.static ReadOnlyList<String>TransitionTypeTransition type.Eliminated Types: Removed CDP Types which Have Been Re-Mapped to Basic Java String Constants Modifier and Type Field Description static StringFrameIdUnique frame identifier.static StringScriptIdentifierUnique script identifier.Marker Events: Events without any Fields or Properties Modifier and Type Field Description static StringframeResized[No Description Provided by Google]static StringinterstitialHiddenFired when interstitial page was hiddenstatic StringinterstitialShownFired when interstitial page was shown
-
Method Summary
Page Domain Commands Script Returns Modifier and Type Method Voidstatic Script<>addCompilationCache(String url, String data)
Seeds compilation cache for given url.Stringstatic Script<>addScriptToEvaluateOnLoad(String scriptSource)
Deprecated, please use addScriptToEvaluateOnNewDocument instead.Stringstatic Script<>addScriptToEvaluateOnNewDocument(String source, String worldName, Boolean includeCommandLineAPI, Boolean runImmediately)
Evaluates given script in every frame upon creation (before loading frame's scripts).Voidstatic Script<>bringToFront()
Brings page to front (activates tab).Stringstatic Script<>captureScreenshot(String format, Integer quality, Page.Viewport clip, Boolean fromSurface, Boolean captureBeyondViewport, Boolean optimizeForSpeed)
Capture page screenshot.Stringstatic Script<>captureSnapshot(String format)
Returns a snapshot of the page as a string.Voidstatic Script<>clearCompilationCache()
Clears seeded compilation cache.Voidstatic Script<>clearDeviceMetricsOverride()
Clears the overridden device metrics.Voidstatic Script<>clearDeviceOrientationOverride()
Clears the overridden Device Orientation.Voidstatic Script<>clearGeolocationOverride()
Clears the overridden Geolocation Position and Error.Voidstatic Script<>close()
Tries to close page, running its beforeunload hooks, if any.Voidstatic Script<>crash()
Crashes renderer on the IO thread, generates minidumps.Integerstatic Script<>createIsolatedWorld(String frameId, String worldName, Boolean grantUniveralAccess)
Creates an isolated world for the given frame.Voidstatic Script<>deleteCookie(String cookieName, String url)
Deletes browser cookie with given name, domain and path.Voidstatic Script<>disable()
Disables page domain notifications.Voidstatic Script<>enable(Boolean enableFileChooserOpenedEvent)
Enables page domain notifications.Voidstatic Script<>generateTestReport(String message, String group)
Generates a report for testing.Page.AdScriptAncestrystatic Script<>getAdScriptAncestry(String frameId)
[No Description Provided by Google]Page.getAppId$$RETstatic Script<>getAppId()
Returns the unique (PWA) app id.Page.getAppManifest$$RETstatic Script<>getAppManifest(String manifestId)
Gets the processed manifest for this current document.Page.FrameTreestatic Script<>getFrameTree()
Returns present frame tree structure.Page.InstallabilityError[]static Script<>getInstallabilityErrors()
[No Description Provided by Google]Page.getLayoutMetrics$$RETstatic Script<>getLayoutMetrics()
Returns metrics relating to the layouting of the page, such as viewport bounds/scale.Stringstatic Script<>getManifestIcons()
Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation.Page.getNavigationHistory$$RETstatic Script<>getNavigationHistory()
Returns navigation history for the current page.Page.OriginTrial[]static Script<>getOriginTrials(String frameId)
Get Origin Trials on given frame.Page.PermissionsPolicyFeatureState[]static Script<>getPermissionsPolicyState(String frameId)
Get Permissions Policy state on given frame.Page.getResourceContent$$RETstatic Script<>getResourceContent(String frameId, String url)
Returns content of the given resource.Page.FrameResourceTreestatic Script<>getResourceTree()
Returns present frame / resource tree structure.Voidstatic Script<>handleJavaScriptDialog(boolean accept, String promptText)
Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).Page.navigate$$RETstatic Script<>navigate(String url, String referrer, String transitionType, String frameId, String referrerPolicy)
Navigates current page to the given URL.Voidstatic Script<>navigateToHistoryEntry(int entryId)
Navigates current page to the given history entry.Page.printToPDF$$RETstatic Script<>printToPDF(Boolean landscape, Boolean displayHeaderFooter, Boolean printBackground, Number scale, Number paperWidth, Number paperHeight, Number marginTop, Number marginBottom, Number marginLeft, Number marginRight, String pageRanges, String headerTemplate, String footerTemplate, Boolean preferCSSPageSize, String transferMode, Boolean generateTaggedPDF, Boolean generateDocumentOutline)
Print page as PDF.Voidstatic Script<>produceCompilationCache(Page.CompilationCacheParams[] scripts)
Requests backend to produce compilation cache for the specified scripts.Voidstatic Script<>reload(Boolean ignoreCache, String scriptToEvaluateOnLoad, String loaderId)
Reloads given page optionally ignoring the cache.Voidstatic Script<>removeScriptToEvaluateOnLoad(String identifier)
Deprecated, please use removeScriptToEvaluateOnNewDocument instead.Voidstatic Script<>removeScriptToEvaluateOnNewDocument(String identifier)
Removes given script from the list.Voidstatic Script<>resetNavigationHistory()
Resets navigation history for the current page.Voidstatic Script<>screencastFrameAck(int sessionId)
Acknowledges that a screencast frame has been received by the frontend.Debugger.SearchMatch[]static Script<>searchInResource(String frameId, String url, String query, Boolean caseSensitive, Boolean isRegex)
Searches for given string in resource content.Voidstatic Script<>setAdBlockingEnabled(boolean enabled)
Enable Chrome's experimental ad filter on all sites.Voidstatic Script<>setBypassCSP(boolean enabled)
Enable page Content Security Policy by-passing.Voidstatic Script<>setDeviceMetricsOverride(int width, int height, Number deviceScaleFactor, boolean mobile, Number scale, Integer screenWidth, Integer screenHeight, Integer positionX, Integer positionY, Boolean dontSetVisibleSize, Emulation.ScreenOrientation screenOrientation, Page.Viewport viewport)
Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).Voidstatic Script<>setDeviceOrientationOverride(Number alpha, Number beta, Number gamma)
Overrides the Device Orientation.Voidstatic Script<>setDocumentContent(String frameId, String html)
Sets given markup as the document's HTML.Voidstatic Script<>setDownloadBehavior(String behavior, String downloadPath)
Set the behavior when downloading a file.Voidstatic Script<>setFontFamilies(Page.FontFamilies fontFamilies, Page.ScriptFontFamilies[] forScripts)
Set generic font families.Voidstatic Script<>setFontSizes(Page.FontSizes fontSizes)
Set default font sizes.Voidstatic Script<>setGeolocationOverride(Number latitude, Number longitude, Number accuracy)
Overrides the Geolocation Position or Error.Voidstatic Script<>setInterceptFileChooserDialog(boolean enabled, Boolean cancel)
Intercept file chooser requests and transfer control to protocol clients.Voidstatic Script<>setLifecycleEventsEnabled(boolean enabled)
Controls whether page will emit lifecycle events.Voidstatic Script<>setPrerenderingAllowed(boolean isAllowed)
Enable/disable prerendering manually.Voidstatic Script<>setRPHRegistrationMode(String mode)
Extensions for Custom Handlers API: https://html.spec.whatwg.org/multipage/system-state.html#rph-automationVoidstatic Script<>setSPCTransactionMode(String mode)
Sets the Secure Payment Confirmation transaction mode.Voidstatic Script<>setTouchEmulationEnabled(boolean enabled, String configuration)
Toggles mouse event-based touch event emulation.Voidstatic Script<>setWebLifecycleState(String state)
Tries to update the web lifecycle state of the page.Voidstatic Script<>startScreencast(String format, Integer quality, Integer maxWidth, Integer maxHeight, Integer everyNthFrame)
Starts sending each frame using thescreencastFrameevent.Voidstatic Script<>stopLoading()
Force the page stop all navigations and pending resource fetches.Voidstatic Script<>stopScreencast()
Stops sending each frame in thescreencastFrame.Voidstatic Script<>waitForDebugger()
Pauses page execution.Page Domain CommandBuilder Methods Modifier and Type Method Description static CommandBuilder
<String>captureScreenshot()Creates a buider for conveniently assigning parameters to this method.static CommandBuilder
<Page.navigate$$RET>navigate()Creates a buider for conveniently assigning parameters to this method.static CommandBuilder
<Page.printToPDF$$RET>printToPDF()Creates a buider for conveniently assigning parameters to this method.static CommandBuilder
<Debugger.SearchMatch[]>searchInResource()Creates a buider for conveniently assigning parameters to this method.static CommandBuilder
<Void>setDeviceMetricsOverride()Creates a buider for conveniently assigning parameters to this method.static CommandBuilder
<Void>startScreencast()Creates a buider for conveniently assigning parameters to this method.
-
-
-
Field Detail
-
FrameId
public static final java.lang.String FrameId
Unique frame identifier.
The TypeFrameIdhas been eliminated, because it is a direct mapping to a basic Java-Type; it has no additional fields, or other distinguishing properties. Instead, this CDP defined type has been relegated to a simpleStringConstant, for documentation & reference purposes only.
The code which is generated which employs this type replaces its use with the Standard Java-Type:String
Eliminated Type- See Also:
- Constant Field Values
-
ScriptIdentifier
public static final java.lang.String ScriptIdentifier
Unique script identifier.
The TypeScriptIdentifierhas been eliminated, because it is a direct mapping to a basic Java-Type; it has no additional fields, or other distinguishing properties. Instead, this CDP defined type has been relegated to a simpleStringConstant, for documentation & reference purposes only.
The code which is generated which employs this type replaces its use with the Standard Java-Type:String
Eliminated Type- See Also:
- Constant Field Values
-
frameResized
public static final java.lang.String frameResized
[No Description Provided by Google]
EXPERIMENTAL
This is Marker-Event. Marker-Event's are events that do not possess any data or fields at all. When such events are fired by the browser, the Web-Socket sends nothing more than the name of the event in the packet. The Java-HTML CDP Implementation (this library) has not actually created a dedicated Java Event-Type for this Browser Event.
This specificstaticfield is actually just declared aString.frameResizedhas not been 'reified' into an actual nested / inner class of its own, at all.
Eliminated Event Type- See Also:
- Constant Field Values
-
interstitialHidden
public static final java.lang.String interstitialHidden
Fired when interstitial page was hidden
This is Marker-Event. Marker-Event's are events that do not possess any data or fields at all. When such events are fired by the browser, the Web-Socket sends nothing more than the name of the event in the packet. The Java-HTML CDP Implementation (this library) has not actually created a dedicated Java Event-Type for this Browser Event.
This specificstaticfield is actually just declared aString.interstitialHiddenhas not been 'reified' into an actual nested / inner class of its own, at all.
Eliminated Event Type- See Also:
- Constant Field Values
-
interstitialShown
public static final java.lang.String interstitialShown
Fired when interstitial page was shown
This is Marker-Event. Marker-Event's are events that do not possess any data or fields at all. When such events are fired by the browser, the Web-Socket sends nothing more than the name of the event in the packet. The Java-HTML CDP Implementation (this library) has not actually created a dedicated Java Event-Type for this Browser Event.
This specificstaticfield is actually just declared aString.interstitialShownhas not been 'reified' into an actual nested / inner class of its own, at all.
Eliminated Event Type- See Also:
- Constant Field Values
-
AdFrameExplanation
public static final ReadOnlyList<java.lang.String> AdFrameExplanation
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
AdFrameType
public static final ReadOnlyList<java.lang.String> AdFrameType
Indicates whether a frame has been identified as an ad.
EXPERIMENTAL
String-Enumeration Type
-
BackForwardCacheNotRestoredReason
public static final ReadOnlyList<java.lang.String> BackForwardCacheNotRestoredReason
List of not restored reasons for back-forward cache.
EXPERIMENTAL
String-Enumeration Type
-
BackForwardCacheNotRestoredReasonType
public static final ReadOnlyList<java.lang.String> BackForwardCacheNotRestoredReasonType
Types of not restored reasons for back-forward cache.
EXPERIMENTAL
String-Enumeration Type
-
ClientNavigationDisposition
public static final ReadOnlyList<java.lang.String> ClientNavigationDisposition
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
ClientNavigationReason
public static final ReadOnlyList<java.lang.String> ClientNavigationReason
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
CrossOriginIsolatedContextType
public static final ReadOnlyList<java.lang.String> CrossOriginIsolatedContextType
Indicates whether the frame is cross-origin isolated and why it is the case.
EXPERIMENTAL
String-Enumeration Type
-
DialogType
public static final ReadOnlyList<java.lang.String> DialogType
Javascript dialog type.
String-Enumeration Type
-
GatedAPIFeatures
public static final ReadOnlyList<java.lang.String> GatedAPIFeatures
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
NavigationType
public static final ReadOnlyList<java.lang.String> NavigationType
The type of a frameNavigated event.
EXPERIMENTAL
String-Enumeration Type
-
OriginTrialStatus
public static final ReadOnlyList<java.lang.String> OriginTrialStatus
Status for an Origin Trial.
EXPERIMENTAL
String-Enumeration Type
-
OriginTrialTokenStatus
public static final ReadOnlyList<java.lang.String> OriginTrialTokenStatus
Origin Trial(https://www.chromium.org/blink/origin-trials) support. Status for an Origin Trial token.
EXPERIMENTAL
String-Enumeration Type
-
OriginTrialUsageRestriction
public static final ReadOnlyList<java.lang.String> OriginTrialUsageRestriction
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
PermissionsPolicyBlockReason
public static final ReadOnlyList<java.lang.String> PermissionsPolicyBlockReason
Reason for a permissions policy feature to be disabled.
EXPERIMENTAL
String-Enumeration Type
-
PermissionsPolicyFeature
public static final ReadOnlyList<java.lang.String> PermissionsPolicyFeature
All Permissions Policy features. This enum should match the one defined in services/network/public/cpp/permissions_policy/permissions_policy_features.json5. LINT.IfChange(PermissionsPolicyFeature)
EXPERIMENTAL
String-Enumeration Type
-
ReferrerPolicy
public static final ReadOnlyList<java.lang.String> ReferrerPolicy
The referring-policy used for the navigation.
EXPERIMENTAL
String-Enumeration Type
-
SecureContextType
public static final ReadOnlyList<java.lang.String> SecureContextType
Indicates whether the frame is a secure context and why it is the case.
EXPERIMENTAL
String-Enumeration Type
-
TransitionType
public static final ReadOnlyList<java.lang.String> TransitionType
Transition type.
String-Enumeration Type
-
-
Method Detail
-
addCompilationCache
public static Script<java.lang.Void> addCompilationCache (java.lang.String url, java.lang.String data)
Seeds compilation cache for given url. Compilation cache does not survive cross-process navigation.
EXPERIMENTAL- Parameters:
url- -data- Base64-encoded data (Encoded as a base64 string when passed over JSON)- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
addScriptToEvaluateOnLoad
public static Script<java.lang.String> addScriptToEvaluateOnLoad (java.lang.String scriptSource)
Deprecated, please use addScriptToEvaluateOnNewDocument instead.
EXPERIMENTALDEPRECATED- Parameters:
scriptSource- -- Returns:
- An instance of
Script<String>
This script may be executed, usingScript.exec, and afterwards, aPromise<String>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:String (identifier)
Identifier of the added script.
-
addScriptToEvaluateOnNewDocument
public static Script<java.lang.String> addScriptToEvaluateOnNewDocument (java.lang.String source, java.lang.String worldName, java.lang.Boolean includeCommandLineAPI, java.lang.Boolean runImmediately)
Evaluates given script in every frame upon creation (before loading frame's scripts).- Parameters:
source- -worldName- If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.
OPTIONALEXPERIMENTALincludeCommandLineAPI- Specifies whether command line API should be available to the script, defaults to false.
OPTIONALEXPERIMENTALrunImmediately- If true, runs the script immediately on existing execution contexts or worlds. Default: false.
OPTIONALEXPERIMENTAL- Returns:
- An instance of
Script<String>
This script may be executed, usingScript.exec, and afterwards, aPromise<String>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:String (identifier)
Identifier of the added script.
-
bringToFront
public static Script<java.lang.Void> bringToFront()
Brings page to front (activates tab).
-
captureScreenshot
public static Script<java.lang.String> captureScreenshot (java.lang.String format, java.lang.Integer quality, Page.Viewport clip, java.lang.Boolean fromSurface, java.lang.Boolean captureBeyondViewport, java.lang.Boolean optimizeForSpeed)
Capture page screenshot.👍 Because of the sheer number of input parameters to this method, there is a aCommandBuildervariant to this method which may be invoked instead.
Please View:captureScreenshot()- Parameters:
format- Image compression format (defaults to png).
Acceptable Values: ["jpeg", "png", "webp"]
OPTIONALquality- Compression quality from range [0..100] (jpeg only).
OPTIONALclip- Capture the screenshot of a given region only.
OPTIONALfromSurface- Capture the screenshot from the surface, rather than the view. Defaults to true.
OPTIONALEXPERIMENTALcaptureBeyondViewport- Capture the screenshot beyond the viewport. Defaults to false.
OPTIONALEXPERIMENTALoptimizeForSpeed- Optimize image encoding for speed, not for resulting size (defaults to false)
OPTIONALEXPERIMENTAL- Returns:
- An instance of
Script<String>
This script may be executed, usingScript.exec, and afterwards, aPromise<String>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:String (data)
Base64-encoded image data. (Encoded as a base64 string when passed over JSON)
-
captureSnapshot
public static Script<java.lang.String> captureSnapshot (java.lang.String format)
Returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles.
EXPERIMENTAL- Parameters:
format- Format (defaults to mhtml).
Acceptable Values: ["mhtml"]
OPTIONAL- Returns:
- An instance of
Script<String>
This script may be executed, usingScript.exec, and afterwards, aPromise<String>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:String (data)
Serialized page data.
-
clearCompilationCache
public static Script<java.lang.Void> clearCompilationCache()
Clears seeded compilation cache.
EXPERIMENTAL
-
clearDeviceMetricsOverride
public static Script<java.lang.Void> clearDeviceMetricsOverride()
Clears the overridden device metrics.
EXPERIMENTALDEPRECATED
-
clearDeviceOrientationOverride
public static Script<java.lang.Void> clearDeviceOrientationOverride()
Clears the overridden Device Orientation.
EXPERIMENTALDEPRECATED
-
clearGeolocationOverride
public static Script<java.lang.Void> clearGeolocationOverride()
Clears the overridden Geolocation Position and Error.
DEPRECATED
-
close
-
crash
-
createIsolatedWorld
public static Script<java.lang.Integer> createIsolatedWorld (java.lang.String frameId, java.lang.String worldName, java.lang.Boolean grantUniveralAccess)
Creates an isolated world for the given frame.- Parameters:
frameId- Id of the frame in which the isolated world should be created.worldName- An optional name which is reported in the Execution Context.
OPTIONALgrantUniveralAccess- Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.
OPTIONAL- Returns:
- An instance of
Script<Integer>
This script may be executed, usingScript.exec, and afterwards, aPromise<Integer>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Integer (executionContextId)
Execution context of the isolated world.
-
deleteCookie
public static Script<java.lang.Void> deleteCookie (java.lang.String cookieName, java.lang.String url)
Deletes browser cookie with given name, domain and path.
EXPERIMENTALDEPRECATED- Parameters:
cookieName- Name of the cookie to remove.url- URL to match cooke domain and path.- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
disable
-
enable
public static Script<java.lang.Void> enable (java.lang.Boolean enableFileChooserOpenedEvent)
Enables page domain notifications.- Parameters:
enableFileChooserOpenedEvent- If true, thePage.fileChooserOpenedevent will be emitted regardless of the state set byPage.setInterceptFileChooserDialogcommand (default: false).
OPTIONALEXPERIMENTAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
generateTestReport
public static Script<java.lang.Void> generateTestReport (java.lang.String message, java.lang.String group)
Generates a report for testing.
EXPERIMENTAL- Parameters:
message- Message to be displayed in the report.group- Specifies the endpoint group to deliver the report to.
OPTIONAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
getAdScriptAncestry
public static Script<Page.AdScriptAncestry> getAdScriptAncestry (java.lang.String frameId)
[No Description Provided by Google]
EXPERIMENTAL- Parameters:
frameId- -- Returns:
- An instance of
Script<Page.AdScriptAncestry>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.AdScriptAncestry>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.AdScriptAncestry(adScriptAncestry)
The ancestry chain of ad script identifiers leading to this frame's creation, along with the root script's filterlist rule. The ancestry chain is ordered from the most immediate script (in the frame creation stack) to more distant ancestors (that created the immediately preceding script). Only sent if frame is labelled as an ad and ids are available.
-
getAppId
public static Script<Page.getAppId$$RET> getAppId()
Returns the unique (PWA) app id. Only returns values if the feature flag 'WebAppEnableManifestId' is enabled
EXPERIMENTAL- Returns:
- An instance of
Script<Page.getAppId$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.getAppId$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.getAppId$$RETA dedicated return type implies that the browser may return more than 1 datum
-
getAppManifest
public static Script<Page.getAppManifest$$RET> getAppManifest (java.lang.String manifestId)
Gets the processed manifest for this current document. This API always waits for the manifest to be loaded. If manifestId is provided, and it does not match the manifest of the current document, this API errors out. If there is not a loaded page, this API errors out immediately.- Parameters:
manifestId- -
OPTIONAL- Returns:
- An instance of
Script<Page.getAppManifest$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.getAppManifest$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.getAppManifest$$RETA dedicated return type implies that the browser may return more than 1 datum
-
getFrameTree
public static Script<Page.FrameTree> getFrameTree()
Returns present frame tree structure.- Returns:
- An instance of
Script<Page.FrameTree>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.FrameTree>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.
-
getInstallabilityErrors
public static Script<Page.InstallabilityError[]> getInstallabilityErrors()
[No Description Provided by Google]
EXPERIMENTAL- Returns:
- An instance of
Script<Page.InstallabilityError[]>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.InstallabilityError[]>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.InstallabilityError[] (installabilityErrors)
-
getLayoutMetrics
public static Script<Page.getLayoutMetrics$$RET> getLayoutMetrics()
Returns metrics relating to the layouting of the page, such as viewport bounds/scale.- Returns:
- An instance of
Script<Page.getLayoutMetrics$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.getLayoutMetrics$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.getLayoutMetrics$$RETA dedicated return type implies that the browser may return more than 1 datum
-
getManifestIcons
public static Script<java.lang.String> getManifestIcons()
Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation.
EXPERIMENTALDEPRECATED- Returns:
- An instance of
Script<String>
This script may be executed, usingScript.exec, and afterwards, aPromise<String>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:String (primaryIcon)
-
getNavigationHistory
public static Script<Page.getNavigationHistory$$RET> getNavigationHistory()
Returns navigation history for the current page.- Returns:
- An instance of
Script<Page.getNavigationHistory$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.getNavigationHistory$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.getNavigationHistory$$RETA dedicated return type implies that the browser may return more than 1 datum
-
getOriginTrials
public static Script<Page.OriginTrial[]> getOriginTrials (java.lang.String frameId)
Get Origin Trials on given frame.
EXPERIMENTAL- Parameters:
frameId- -- Returns:
- An instance of
Script<Page.OriginTrial[]>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.OriginTrial[]>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.OriginTrial[] (originTrials)
-
getPermissionsPolicyState
public static Script<Page.PermissionsPolicyFeatureState[]> getPermissionsPolicyState (java.lang.String frameId)
Get Permissions Policy state on given frame.
EXPERIMENTAL- Parameters:
frameId- -- Returns:
- An instance of
Script<Page.PermissionsPolicyFeatureState[]>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.PermissionsPolicyFeatureState[]>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.PermissionsPolicyFeatureState[] (states)
-
getResourceContent
public static Script<Page.getResourceContent$$RET> getResourceContent (java.lang.String frameId, java.lang.String url)
Returns content of the given resource.
EXPERIMENTAL- Parameters:
frameId- Frame id to get resource for.url- URL of the resource to get content for.- Returns:
- An instance of
Script<Page.getResourceContent$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.getResourceContent$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.getResourceContent$$RETA dedicated return type implies that the browser may return more than 1 datum
-
getResourceTree
public static Script<Page.FrameResourceTree> getResourceTree()
Returns present frame / resource tree structure.
EXPERIMENTAL- Returns:
- An instance of
Script<Page.FrameResourceTree>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.FrameResourceTree>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.FrameResourceTree(frameTree)
Present frame / resource tree structure.
-
handleJavaScriptDialog
public static Script<java.lang.Void> handleJavaScriptDialog (boolean accept, java.lang.String promptText)
Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).- Parameters:
accept- Whether to accept or dismiss the dialog.promptText- The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.
OPTIONAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
navigate
public static Script<Page.navigate$$RET> navigate (java.lang.String url, java.lang.String referrer, java.lang.String transitionType, java.lang.String frameId, java.lang.String referrerPolicy)
Navigates current page to the given URL.👍 Because of the sheer number of input parameters to this method, there is a aCommandBuildervariant to this method which may be invoked instead.
Please View:navigate()- Parameters:
url- URL to navigate the page to.referrer- Referrer URL.
OPTIONALtransitionType- Intended transition type.
OPTIONALframeId- Frame id to navigate, if not specified navigates the top frame.
OPTIONALreferrerPolicy- Referrer-policy used for the navigation.
OPTIONALEXPERIMENTAL- Returns:
- An instance of
Script<Page.navigate$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.navigate$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.navigate$$RETA dedicated return type implies that the browser may return more than 1 datum
-
navigateToHistoryEntry
public static Script<java.lang.Void> navigateToHistoryEntry(int entryId)
Navigates current page to the given history entry.- Parameters:
entryId- Unique id of the entry to navigate to.- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
printToPDF
public static Script<Page.printToPDF$$RET> printToPDF (java.lang.Boolean landscape, java.lang.Boolean displayHeaderFooter, java.lang.Boolean printBackground, java.lang.Number scale, java.lang.Number paperWidth, java.lang.Number paperHeight, java.lang.Number marginTop, java.lang.Number marginBottom, java.lang.Number marginLeft, java.lang.Number marginRight, java.lang.String pageRanges, java.lang.String headerTemplate, java.lang.String footerTemplate, java.lang.Boolean preferCSSPageSize, java.lang.String transferMode, java.lang.Boolean generateTaggedPDF, java.lang.Boolean generateDocumentOutline)
Print page as PDF.👍 Because of the sheer number of input parameters to this method, there is a aCommandBuildervariant to this method which may be invoked instead.
Please View:printToPDF()- Parameters:
landscape- Paper orientation. Defaults to false.
OPTIONALdisplayHeaderFooter- Display header and footer. Defaults to false.
OPTIONALprintBackground- Print background graphics. Defaults to false.
OPTIONALscale- Scale of the webpage rendering. Defaults to 1.
OPTIONALpaperWidth- Paper width in inches. Defaults to 8.5 inches.
OPTIONALpaperHeight- Paper height in inches. Defaults to 11 inches.
OPTIONALmarginTop- Top margin in inches. Defaults to 1cm (~0.4 inches).
OPTIONALmarginBottom- Bottom margin in inches. Defaults to 1cm (~0.4 inches).
OPTIONALmarginLeft- Left margin in inches. Defaults to 1cm (~0.4 inches).
OPTIONALmarginRight- Right margin in inches. Defaults to 1cm (~0.4 inches).
OPTIONALpageRanges- Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are printed in the document order, not in the order specified, and no more than once. Defaults to empty string, which implies the entire document is printed. The page numbers are quietly capped to actual page count of the document, and ranges beyond the end of the document are ignored. If this results in no pages to print, an error is reported. It is an error to specify a range with start greater than end.
OPTIONALheaderTemplate- HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: -date: formatted print date -title: document title -url: document location -pageNumber: current page number -totalPages: total pages in the document For example,would generate span containing the title.
OPTIONALfooterTemplate- HTML template for the print footer. Should use the same format as theheaderTemplate.
OPTIONALpreferCSSPageSize- Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
OPTIONALtransferMode- return as stream
Acceptable Values: ["ReturnAsBase64", "ReturnAsStream"]
OPTIONALEXPERIMENTALgenerateTaggedPDF- Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice.
OPTIONALEXPERIMENTALgenerateDocumentOutline- Whether or not to embed the document outline into the PDF.
OPTIONALEXPERIMENTAL- Returns:
- An instance of
Script<Page.printToPDF$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedPage.printToPDF$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Page.printToPDF$$RETA dedicated return type implies that the browser may return more than 1 datum
-
produceCompilationCache
public static Script<java.lang.Void> produceCompilationCache (Page.CompilationCacheParams[] scripts)
Requests backend to produce compilation cache for the specified scripts.scriptsare appended to the list of scripts for which the cache would be produced. The list may be reset during page navigation. When script with a matching URL is encountered, the cache is optionally produced upon backend discretion, based on internal heuristics. See also:Page.compilationCacheProduced.
EXPERIMENTAL- Parameters:
scripts- -- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
reload
public static Script<java.lang.Void> reload (java.lang.Boolean ignoreCache, java.lang.String scriptToEvaluateOnLoad, java.lang.String loaderId)
Reloads given page optionally ignoring the cache.- Parameters:
ignoreCache- If true, browser cache is ignored (as if the user pressed Shift+refresh).
OPTIONALscriptToEvaluateOnLoad- If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin.
OPTIONALloaderId- If set, an error will be thrown if the target page's main frame's loader id does not match the provided id. This prevents accidentally reloading an unintended target in case there's a racing navigation.
OPTIONALEXPERIMENTAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
removeScriptToEvaluateOnLoad
public static Script<java.lang.Void> removeScriptToEvaluateOnLoad (java.lang.String identifier)
Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
EXPERIMENTALDEPRECATED- Parameters:
identifier- -- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
removeScriptToEvaluateOnNewDocument
public static Script<java.lang.Void> removeScriptToEvaluateOnNewDocument (java.lang.String identifier)
Removes given script from the list.- Parameters:
identifier- -- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
resetNavigationHistory
public static Script<java.lang.Void> resetNavigationHistory()
Resets navigation history for the current page.
-
screencastFrameAck
public static Script<java.lang.Void> screencastFrameAck(int sessionId)
Acknowledges that a screencast frame has been received by the frontend.
EXPERIMENTAL- Parameters:
sessionId- Frame number.- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
searchInResource
public static Script<Debugger.SearchMatch[]> searchInResource (java.lang.String frameId, java.lang.String url, java.lang.String query, java.lang.Boolean caseSensitive, java.lang.Boolean isRegex)
Searches for given string in resource content.
EXPERIMENTAL👍 Because of the sheer number of input parameters to this method, there is a aCommandBuildervariant to this method which may be invoked instead.
Please View:searchInResource()- Parameters:
frameId- Frame id for resource to search in.url- URL of the resource to search in.query- String to search for.caseSensitive- If true, search is case sensitive.
OPTIONALisRegex- If true, treats string parameter as regex.
OPTIONAL- Returns:
- An instance of
Script<Debugger.SearchMatch[]>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedDebugger.SearchMatch[]>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.
-
setAdBlockingEnabled
public static Script<java.lang.Void> setAdBlockingEnabled(boolean enabled)
Enable Chrome's experimental ad filter on all sites.
EXPERIMENTAL- Parameters:
enabled- Whether to block ads.- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setBypassCSP
public static Script<java.lang.Void> setBypassCSP(boolean enabled)
Enable page Content Security Policy by-passing.- Parameters:
enabled- Whether to bypass page CSP.- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setDeviceMetricsOverride
public static Script<java.lang.Void> setDeviceMetricsOverride (int width, int height, java.lang.Number deviceScaleFactor, boolean mobile, java.lang.Number scale, java.lang.Integer screenWidth, java.lang.Integer screenHeight, java.lang.Integer positionX, java.lang.Integer positionY, java.lang.Boolean dontSetVisibleSize, Emulation.ScreenOrientation screenOrientation, Page.Viewport viewport)
Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).
EXPERIMENTALDEPRECATED👍 Because of the sheer number of input parameters to this method, there is a aCommandBuildervariant to this method which may be invoked instead.
Please View:setDeviceMetricsOverride()- Parameters:
width- Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.height- Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.deviceScaleFactor- Overriding device scale factor value. 0 disables the override.mobile- Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.scale- Scale to apply to resulting view image.
OPTIONALscreenWidth- Overriding screen width value in pixels (minimum 0, maximum 10000000).
OPTIONALscreenHeight- Overriding screen height value in pixels (minimum 0, maximum 10000000).
OPTIONALpositionX- Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
OPTIONALpositionY- Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
OPTIONALdontSetVisibleSize- Do not set visible view size, rely upon explicit setVisibleSize call.
OPTIONALscreenOrientation- Screen orientation override.
OPTIONALviewport- The viewport dimensions and scale. If not set, the override is cleared.
OPTIONAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setDeviceOrientationOverride
public static Script<java.lang.Void> setDeviceOrientationOverride (java.lang.Number alpha, java.lang.Number beta, java.lang.Number gamma)
Overrides the Device Orientation.
EXPERIMENTALDEPRECATED- Parameters:
alpha- Mock alphabeta- Mock betagamma- Mock gamma- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setDocumentContent
public static Script<java.lang.Void> setDocumentContent (java.lang.String frameId, java.lang.String html)
Sets given markup as the document's HTML.- Parameters:
frameId- Frame id to set HTML for.html- HTML content to set.- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setDownloadBehavior
public static Script<java.lang.Void> setDownloadBehavior (java.lang.String behavior, java.lang.String downloadPath)
Set the behavior when downloading a file.
EXPERIMENTALDEPRECATED- Parameters:
behavior- Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
Acceptable Values: ["allow", "default", "deny"]downloadPath- The default path to save downloaded files to. This is required if behavior is set to 'allow'
OPTIONAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setFontFamilies
public static Script<java.lang.Void> setFontFamilies (Page.FontFamilies fontFamilies, Page.ScriptFontFamilies[] forScripts)
Set generic font families.
EXPERIMENTAL- Parameters:
fontFamilies- Specifies font families to set. If a font family is not specified, it won't be changed.forScripts- Specifies font families to set for individual scripts.
OPTIONAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setFontSizes
public static Script<java.lang.Void> setFontSizes (Page.FontSizes fontSizes)
Set default font sizes.
EXPERIMENTAL- Parameters:
fontSizes- Specifies font sizes to set. If a font size is not specified, it won't be changed.- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setGeolocationOverride
public static Script<java.lang.Void> setGeolocationOverride (java.lang.Number latitude, java.lang.Number longitude, java.lang.Number accuracy)
Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.
DEPRECATED- Parameters:
latitude- Mock latitude
OPTIONALlongitude- Mock longitude
OPTIONALaccuracy- Mock accuracy
OPTIONAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setInterceptFileChooserDialog
public static Script<java.lang.Void> setInterceptFileChooserDialog (boolean enabled, java.lang.Boolean cancel)
Intercept file chooser requests and transfer control to protocol clients. When file chooser interception is enabled, native file chooser dialog is not shown. Instead, a protocol eventPage.fileChooserOpenedis emitted.- Parameters:
enabled- -cancel- If true, cancels the dialog by emitting relevant events (if any) in addition to not showing it if the interception is enabled (default: false).
OPTIONALEXPERIMENTAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setLifecycleEventsEnabled
public static Script<java.lang.Void> setLifecycleEventsEnabled (boolean enabled)
Controls whether page will emit lifecycle events.- Parameters:
enabled- If true, starts emitting lifecycle events.- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setPrerenderingAllowed
public static Script<java.lang.Void> setPrerenderingAllowed (boolean isAllowed)
Enable/disable prerendering manually. This command is a short-term solution for https://crbug.com/1440085. See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA for more details. TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets.
EXPERIMENTAL- Parameters:
isAllowed- -- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setRPHRegistrationMode
public static Script<java.lang.Void> setRPHRegistrationMode (java.lang.String mode)
Extensions for Custom Handlers API: https://html.spec.whatwg.org/multipage/system-state.html#rph-automation
EXPERIMENTAL- Parameters:
mode- -
Acceptable Values: ["autoAccept", "autoReject", "none"]- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setSPCTransactionMode
public static Script<java.lang.Void> setSPCTransactionMode (java.lang.String mode)
Sets the Secure Payment Confirmation transaction mode. https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode
EXPERIMENTAL- Parameters:
mode- -
Acceptable Values: ["autoAccept", "autoChooseToAuthAnotherWay", "autoOptOut", "autoReject", "none"]- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setTouchEmulationEnabled
public static Script<java.lang.Void> setTouchEmulationEnabled (boolean enabled, java.lang.String configuration)
Toggles mouse event-based touch event emulation.
EXPERIMENTALDEPRECATED- Parameters:
enabled- Whether the touch event emulation should be enabled.configuration- Touch/gesture events configuration. Default: current platform.
Acceptable Values: ["desktop", "mobile"]
OPTIONAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
setWebLifecycleState
public static Script<java.lang.Void> setWebLifecycleState (java.lang.String state)
Tries to update the web lifecycle state of the page. It will transition the page to the given state according to: https://github.com/WICG/web-lifecycle/
EXPERIMENTAL- Parameters:
state- Target lifecycle state
Acceptable Values: ["active", "frozen"]- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
startScreencast
public static Script<java.lang.Void> startScreencast (java.lang.String format, java.lang.Integer quality, java.lang.Integer maxWidth, java.lang.Integer maxHeight, java.lang.Integer everyNthFrame)
Starts sending each frame using thescreencastFrameevent.
EXPERIMENTAL👍 Because of the sheer number of input parameters to this method, there is a aCommandBuildervariant to this method which may be invoked instead.
Please View:startScreencast()- Parameters:
format- Image compression format.
Acceptable Values: ["jpeg", "png"]
OPTIONALquality- Compression quality from range [0..100].
OPTIONALmaxWidth- Maximum screenshot width.
OPTIONALmaxHeight- Maximum screenshot height.
OPTIONALeveryNthFrame- Send every n-th frame.
OPTIONAL- Returns:
- An instance of
Script<Void>
ThisScriptinstance must be executed before the browser receives the invocation-request.This Browser-Function does not have a return-value. You may choose to await thePromise<Void>to ensure that the Browser Function has run to completion.
-
stopLoading
public static Script<java.lang.Void> stopLoading()
Force the page stop all navigations and pending resource fetches.
-
stopScreencast
public static Script<java.lang.Void> stopScreencast()
Stops sending each frame in thescreencastFrame.
EXPERIMENTAL
-
waitForDebugger
public static Script<java.lang.Void> waitForDebugger()
Pauses page execution. Can be resumed using generic RunTime.runIfWaitingForDebugger.
EXPERIMENTAL
-
captureScreenshot
public static CommandBuilder<java.lang.String> captureScreenshot()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 6 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
captureScreenshot(java.lang.String, java.lang.Integer, Torello.Browser.BrowserAPI.Page.Viewport, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean)
-
navigate
public static CommandBuilder<Page.navigate$$RET> navigate()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 5 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
navigate(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
-
printToPDF
public static CommandBuilder<Page.printToPDF$$RET> printToPDF()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 17 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
printToPDF(java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.Number, java.lang.Number, java.lang.Number, java.lang.Number, java.lang.Number, java.lang.Number, java.lang.Number, java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.String, java.lang.Boolean, java.lang.Boolean)
-
searchInResource
public static CommandBuilder<Debugger.SearchMatch[]> searchInResource()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 5 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
searchInResource(java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean)
-
setDeviceMetricsOverride
public static CommandBuilder<java.lang.Void> setDeviceMetricsOverride()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 12 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
setDeviceMetricsOverride(int, int, java.lang.Number, boolean, java.lang.Number, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Boolean, Torello.Browser.BrowserAPI.Emulation.ScreenOrientation, Torello.Browser.BrowserAPI.Page.Viewport)
-
startScreencast
public static CommandBuilder<java.lang.Void> startScreencast()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 5 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
startScreencast(java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer)
-
-