Class Page


  • public class Page
    extends java.lang.Object
    Class created by Automatic Code-Generator.
    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.

    JSON-Viewable Google-API:
    These files may be viewed here: browser_protocol.json and js_protocol.json.
    These files were converted into this Java-Browser (CDT) Library; they are a Java-Alternative to the Node.js implementation.

    HTML-Viewable API:
    In addition to this Class-Library, these files were also converted to a simple HTML Page, which may be browsed here: Browser API Web-Page

    Node.js RDP-API Implementation:
    You may read about the Node.js Chrome Remote Interface on the Node.js Package Manager Web-Site: NPM
    Actions and events related to the inspected page belong to the page domain.

    This class is intended to be used with a Headless Browser

    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 a Remote Debugging Port. The initializations may be accomplished using class BRDPC (Browser Remote Debug Protocol Connection).

    Google-Chrome was used during the development process of the classes in this particular package. Note that, lately, it has been asserted Microsoft has switched to using the Chrome-Engine for its Microsoft Edge Browser Internal Code-Base. Therefore, there may limited support / functionality when running the methods in this class with Microsoft-Edge. There is the possibility these will work with Opera & Safari.

    Check whether the your Web-Browser will allow itself to be driven by the Web-Socket RDP-Port 9223.


    Foreign Function API:
    Every one of the methods that reside in this class are designed to do nothing more than:

    1. Accept Parameters from the User, and "Marshall Them" into a Valid JSON-Request
    2. Transmit the Marshalled Request-JSON to a Headless Web-Browser over a Web-Socket RDP Connection
    3. Receive BOTH that Method's Results AND any Browser Event-Firings from the Web-Socket
    4. Parse JSON Method-Results and Browser-Event Firings, and Subsequently Convert them to Standard Java-Types
    5. Report these Method-Results and Browser-Events to the User via an User-Registered Event-Listener or a Promise Object


    Java-HTML Difference:
    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".



    Stateless Class:
    This class neither contains any program-state, nor can it be instantiated. The @StaticFunctional Annotation may also be called 'The Spaghetti Report'. Static-Functional classes are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's @Stateless Annotation.

    • 1 Constructor(s), 1 declared private, zero-argument constructor
    • 57 Method(s), 57 declared static
    • 23 Field(s), 23 declared static, 22 declared final
    • Fields excused from final modifier (with explanation):
      Field 'counter' is not final. Reason: CONFIGURATION


    • Method Detail

      • addScriptToEvaluateOnLoad

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String> addScriptToEvaluateOnLoad​
                    (java.lang.String scriptSource)
        
        Deprecated, please use addScriptToEvaluateOnNewDocument instead.
        EXPERIMENTAL
        DEPRECATED
        Parameters:
        scriptSource - -
        Returns:
        An instance of Script<String, JsonObject, String>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String (identifier)
          Identifier of the added script.
      • addScriptToEvaluateOnNewDocument

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String> addScriptToEvaluateOnNewDocument​
                    (java.lang.String source,
                     java.lang.String worldName,
                     java.lang.Boolean includeCommandLineAPI)
        
        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.
        OPTIONAL
        EXPERIMENTAL
        includeCommandLineAPI - Specifies whether command line API should be available to the script, defaults to false.
        OPTIONAL
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, String>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String (identifier)
          Identifier of the added script.
      • bringToFront

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0bringToFront()
        Brings page to front (activates tab).
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • captureScreenshot

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String> captureScreenshot​
                    (java.lang.String format,
                     java.lang.Integer quality,
                     Page.Viewport clip,
                     java.lang.Boolean fromSurface,
                     java.lang.Boolean captureBeyondViewport)
        
        Capture page screenshot.
        Parameters:
        format - Image compression format (defaults to png).
        Acceptable Values: ["jpeg", "png", "webp"]
        OPTIONAL
        quality - Compression quality from range [0..100] (jpeg only).
        OPTIONAL
        clip - Capture the screenshot of a given region only.
        OPTIONAL
        fromSurface - Capture the screenshot from the surface, rather than the view. Defaults to true.
        OPTIONAL
        EXPERIMENTAL
        captureBeyondViewport - Capture the screenshot beyond the viewport. Defaults to false.
        OPTIONAL
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, String>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String (data)
          Base64-encoded image data. (Encoded as a base64 string when passed over JSON)
      • captureSnapshot

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​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, JsonObject, String>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String (data)
          Serialized page data.
      • clearDeviceMetricsOverride

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0clearDeviceMetricsOverride
                    ()
        
        Clears the overridden device metrics.
        EXPERIMENTAL
        DEPRECATED
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • clearDeviceOrientationOverride

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0clearDeviceOrientationOverride
                    ()
        
        Clears the overridden Device Orientation.
        EXPERIMENTAL
        DEPRECATED
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • clearGeolocationOverride

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0clearGeolocationOverride
                    ()
        
        Clears the overridden Geolocation Position and Error.
        DEPRECATED
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • createIsolatedWorld

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​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.
        OPTIONAL
        grantUniveralAccess - 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<String, JsonObject, Integer>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Integer> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • Integer (executionContextId)
          Execution context of the isolated world.
      • deleteCookie

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0deleteCookie​
                    (java.lang.String cookieName,
                     java.lang.String url)
        
        Deletes browser cookie with given name, domain and path.
        EXPERIMENTAL
        DEPRECATED
        Parameters:
        cookieName - Name of the cookie to remove.
        url - URL to match cooke domain and path.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • disable

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0disable()
        Disables page domain notifications.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • enable

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0enable()
        Enables page domain notifications.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • getManifestIcons

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String> getManifestIcons
                    ()
        
        [No Description Provided by Google]
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, String>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, String> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

        • String (primaryIcon)
          -
      • getAppId

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret2<java.lang.String,​java.lang.String>> getAppId
                    ()
        
        Returns the unique (PWA) app id. Only returns values if the feature flag 'WebAppEnableManifestId' is enabled
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret2>

        This Script may be executed (using Script.exec()), and a Promise returned.

        When the Promise is awaited (using Promise.await()), the Ret2 will subsequently be returned from that call.

        The returned values are encapsulated in an instance of Ret2

        • Ret2.a: String (appId)
          App id, either from manifest's id attribute or computed from start_url

        • Ret2.b: String (recommendedId)
          Recommendation for manifest's id attribute to match current id computed from start_url
      • resetNavigationHistory

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0resetNavigationHistory
                    ()
        
        Resets navigation history for the current page.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • getResourceContent

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret2<java.lang.String,​java.lang.Boolean>> 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<String, JsonObject, Ret2>

        This Script may be executed (using Script.exec()), and a Promise returned.

        When the Promise is awaited (using Promise.await()), the Ret2 will subsequently be returned from that call.

        The returned values are encapsulated in an instance of Ret2

        • Ret2.a: String (content)
          Resource content.

        • Ret2.b: Boolean (base64Encoded)
          True, if content was served as base64.
      • handleJavaScriptDialog

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0handleJavaScriptDialog​
                    (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<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • navigate

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret3<java.lang.String,​java.lang.String,​java.lang.String>> 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.
        Parameters:
        url - URL to navigate the page to.
        referrer - Referrer URL.
        OPTIONAL
        transitionType - Intended transition type.
        OPTIONAL
        frameId - Frame id to navigate, if not specified navigates the top frame.
        OPTIONAL
        referrerPolicy - Referrer-policy used for the navigation.
        OPTIONAL
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret3>

        This Script may be executed (using Script.exec()), and a Promise returned.

        When the Promise is awaited (using Promise.await()), the Ret3 will subsequently be returned from that call.

        The returned values are encapsulated in an instance of Ret3

        • Ret3.a: String (frameId)
          Frame id that has navigated (or failed to navigate)

        • Ret3.b: String (loaderId)
          Loader identifier.

        • Ret3.c: String (errorText)
          User friendly error message, present if and only if navigation has failed.
      • navigateToHistoryEntry

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0navigateToHistoryEntry​
                    (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<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • printToPDF

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret2<java.lang.String,​java.lang.String>> 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.Boolean ignoreInvalidPageRanges,
                     java.lang.String headerTemplate,
                     java.lang.String footerTemplate,
                     java.lang.Boolean preferCSSPageSize,
                     java.lang.String transferMode)
        
        Print page as PDF.
        Parameters:
        landscape - Paper orientation. Defaults to false.
        OPTIONAL
        displayHeaderFooter - Display header and footer. Defaults to false.
        OPTIONAL
        printBackground - Print background graphics. Defaults to false.
        OPTIONAL
        scale - Scale of the webpage rendering. Defaults to 1.
        OPTIONAL
        paperWidth - Paper width in inches. Defaults to 8.5 inches.
        OPTIONAL
        paperHeight - Paper height in inches. Defaults to 11 inches.
        OPTIONAL
        marginTop - Top margin in inches. Defaults to 1cm (~0.4 inches).
        OPTIONAL
        marginBottom - Bottom margin in inches. Defaults to 1cm (~0.4 inches).
        OPTIONAL
        marginLeft - Left margin in inches. Defaults to 1cm (~0.4 inches).
        OPTIONAL
        marginRight - Right margin in inches. Defaults to 1cm (~0.4 inches).
        OPTIONAL
        pageRanges - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
        OPTIONAL
        ignoreInvalidPageRanges - Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
        OPTIONAL
        headerTemplate - 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.
        OPTIONAL
        footerTemplate - HTML template for the print footer. Should use the same format as the headerTemplate.
        OPTIONAL
        preferCSSPageSize - 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.
        OPTIONAL
        transferMode - return as stream
        Acceptable Values: ["ReturnAsBase64", "ReturnAsStream"]
        OPTIONAL
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret2>

        This Script may be executed (using Script.exec()), and a Promise returned.

        When the Promise is awaited (using Promise.await()), the Ret2 will subsequently be returned from that call.

        The returned values are encapsulated in an instance of Ret2

        • Ret2.a: String (data)
          Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded as a base64 string when passed over JSON)

        • Ret2.b: String (stream)
          A handle of the stream that holds resulting PDF data.
      • reload

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0reload​
                    (java.lang.Boolean ignoreCache,
                     java.lang.String scriptToEvaluateOnLoad)
        
        Reloads given page optionally ignoring the cache.
        Parameters:
        ignoreCache - If true, browser cache is ignored (as if the user pressed Shift+refresh).
        OPTIONAL
        scriptToEvaluateOnLoad - If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • removeScriptToEvaluateOnLoad

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0removeScriptToEvaluateOnLoad​
                    (java.lang.String identifier)
        
        Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
        EXPERIMENTAL
        DEPRECATED
        Parameters:
        identifier - -
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • removeScriptToEvaluateOnNewDocument

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0removeScriptToEvaluateOnNewDocument​
                    (java.lang.String identifier)
        
        Removes given script from the list.
        Parameters:
        identifier - -
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • screencastFrameAck

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0screencastFrameAck​
                    (int sessionId)
        
        Acknowledges that a screencast frame has been received by the frontend.
        EXPERIMENTAL
        Parameters:
        sessionId - Frame number.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • searchInResource

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​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
        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.
        OPTIONAL
        isRegex - If true, treats string parameter as regex.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Debugger.SearchMatch[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Debugger.SearchMatch[]> will be returned.

        Finally, the Promise may be awaited, using Promise.await(), and the returned result of this Browser Function may may be retrieved.

        This Browser Function returns

      • setAdBlockingEnabled

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setAdBlockingEnabled​
                    (boolean enabled)
        
        Enable Chrome's experimental ad filter on all sites.
        EXPERIMENTAL
        Parameters:
        enabled - Whether to block ads.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setBypassCSP

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setBypassCSP​
                    (boolean enabled)
        
        Enable page Content Security Policy by-passing.
        EXPERIMENTAL
        Parameters:
        enabled - Whether to bypass page CSP.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setDeviceMetricsOverride

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setDeviceMetricsOverride​
                    (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).
        EXPERIMENTAL
        DEPRECATED
        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.
        OPTIONAL
        screenWidth - Overriding screen width value in pixels (minimum 0, maximum 10000000).
        OPTIONAL
        screenHeight - Overriding screen height value in pixels (minimum 0, maximum 10000000).
        OPTIONAL
        positionX - Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
        OPTIONAL
        positionY - Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
        OPTIONAL
        dontSetVisibleSize - Do not set visible view size, rely upon explicit setVisibleSize call.
        OPTIONAL
        screenOrientation - Screen orientation override.
        OPTIONAL
        viewport - The viewport dimensions and scale. If not set, the override is cleared.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setDeviceOrientationOverride

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setDeviceOrientationOverride​
                    (java.lang.Number alpha,
                     java.lang.Number beta,
                     java.lang.Number gamma)
        
        Overrides the Device Orientation.
        EXPERIMENTAL
        DEPRECATED
        Parameters:
        alpha - Mock alpha
        beta - Mock beta
        gamma - Mock gamma
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setFontFamilies

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setFontFamilies​
                    (Page.FontFamilies fontFamilies)
        
        Set generic font families.
        EXPERIMENTAL
        Parameters:
        fontFamilies - Specifies font families to set. If a font family is not specified, it won't be changed.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setFontSizes

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setFontSizes​
                    (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<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setDocumentContent

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setDocumentContent​
                    (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<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setDownloadBehavior

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setDownloadBehavior​
                    (java.lang.String behavior,
                     java.lang.String downloadPath)
        
        Set the behavior when downloading a file.
        EXPERIMENTAL
        DEPRECATED
        Parameters:
        behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
        Acceptable Values: ["deny", "allow", "default"]
        downloadPath - The default path to save downloaded files to. This is required if behavior is set to 'allow'
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setGeolocationOverride

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setGeolocationOverride​
                    (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
        OPTIONAL
        longitude - Mock longitude
        OPTIONAL
        accuracy - Mock accuracy
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setLifecycleEventsEnabled

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setLifecycleEventsEnabled​
                    (boolean enabled)
        
        Controls whether page will emit lifecycle events.
        EXPERIMENTAL
        Parameters:
        enabled - If true, starts emitting lifecycle events.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setTouchEmulationEnabled

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setTouchEmulationEnabled​
                    (boolean enabled,
                     java.lang.String configuration)
        
        Toggles mouse event-based touch event emulation.
        EXPERIMENTAL
        DEPRECATED
        Parameters:
        enabled - Whether the touch event emulation should be enabled.
        configuration - Touch/gesture events configuration. Default: current platform.
        Acceptable Values: ["mobile", "desktop"]
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • startScreencast

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0startScreencast​
                    (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 the screencastFrame event.
        EXPERIMENTAL
        Parameters:
        format - Image compression format.
        Acceptable Values: ["jpeg", "png"]
        OPTIONAL
        quality - Compression quality from range [0..100].
        OPTIONAL
        maxWidth - Maximum screenshot width.
        OPTIONAL
        maxHeight - Maximum screenshot height.
        OPTIONAL
        everyNthFrame - Send every n-th frame.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • stopLoading

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0stopLoading()
        Force the page stop all navigations and pending resource fetches.
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • crash

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0crash()
        Crashes renderer on the IO thread, generates minidumps.
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • close

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0close()
        Tries to close page, running its beforeunload hooks, if any.
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setWebLifecycleState

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setWebLifecycleState​
                    (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: ["frozen", "active"]
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • stopScreencast

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0stopScreencast()
        Stops sending each frame in the screencastFrame.
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • produceCompilationCache

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0produceCompilationCache​
                    (Page.CompilationCacheParams[] scripts)
        
        Requests backend to produce compilation cache for the specified scripts. scripts are appeneded 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<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • addCompilationCache

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0addCompilationCache​
                    (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<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • clearCompilationCache

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0clearCompilationCache
                    ()
        
        Clears seeded compilation cache.
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • generateTestReport

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0generateTestReport​
                    (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<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • waitForDebugger

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0waitForDebugger()
        Pauses page execution. Can be resumed using generic RunTime.runIfWaitingForDebugger.
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.
      • setInterceptFileChooserDialog

        🡅     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setInterceptFileChooserDialog​
                    (boolean enabled)
        
        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 event Page.fileChooserOpened is emitted.
        EXPERIMENTAL
        Parameters:
        enabled - -
        Returns:
        An instance of Script<String, JsonObject, Ret0>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<JsonObject, Ret0 > to ensure the Browser Function has run to completion.