Class Network


  • public class Network
    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
    Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.

    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
    • 33 Method(s), 33 declared static
    • 27 Field(s), 27 declared static, 26 declared final
    • Fields excused from final modifier (with explanation):
      Field 'counter' is not final. Reason: CONFIGURATION


    • Method Detail

      • setAcceptedEncodings

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setAcceptedEncodings​
                    (java.lang.String[] encodings)
        
        Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.
        EXPERIMENTAL
        Parameters:
        encodings - List of accepted content encodings.
        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.
      • clearAcceptedEncodingsOverride

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0clearAcceptedEncodingsOverride
                    ()
        
        Clears accepted encodings set by setAcceptedEncodings
        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.
      • canClearBrowserCache

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Boolean> canClearBrowserCache
                    ()
        
        Tells whether clearing browser cache is supported.
        DEPRECATED
        Returns:
        An instance of Script<String, JsonObject, Boolean>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Boolean> 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

        • Boolean (result)
          True if browser cache can be cleared.
      • canClearBrowserCookies

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Boolean> canClearBrowserCookies
                    ()
        
        Tells whether clearing browser cookies is supported.
        DEPRECATED
        Returns:
        An instance of Script<String, JsonObject, Boolean>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Boolean> 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

        • Boolean (result)
          True if browser cookies can be cleared.
      • canEmulateNetworkConditions

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Boolean> canEmulateNetworkConditions
                    ()
        
        Tells whether emulation of network conditions is supported.
        DEPRECATED
        Returns:
        An instance of Script<String, JsonObject, Boolean>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Boolean> 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

        • Boolean (result)
          True if emulation of network conditions is supported.
      • clearBrowserCache

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0clearBrowserCache
                    ()
        
        Clears browser cache.
        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.
      • clearBrowserCookies

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0clearBrowserCookies
                    ()
        
        Clears browser cookies.
        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.
      • continueInterceptedRequest

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0continueInterceptedRequest​
                    (java.lang.String interceptionId,
                     java.lang.String errorReason,
                     java.lang.String rawResponse,
                     java.lang.String url,
                     java.lang.String method,
                     java.lang.String postData,
                     JsonObject headers,
                     Network.AuthChallengeResponse authChallengeResponse)
        
        Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId. Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.
        EXPERIMENTAL
        DEPRECATED
        Parameters:
        interceptionId - -
        errorReason - If set this causes the request to fail with the given reason. Passing Aborted for requests marked with isNavigationRequest also cancels the navigation. Must not be set in response to an authChallenge.
        OPTIONAL
        rawResponse - If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge. (Encoded as a base64 string when passed over JSON)
        OPTIONAL
        url - If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge.
        OPTIONAL
        method - If set this allows the request method to be overridden. Must not be set in response to an authChallenge.
        OPTIONAL
        postData - If set this allows postData to be set. Must not be set in response to an authChallenge.
        OPTIONAL
        headers - If set this allows the request headers to be changed. Must not be set in response to an authChallenge.
        OPTIONAL
        authChallengeResponse - Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
        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.
      • deleteCookies

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0deleteCookies​
                    (java.lang.String name,
                     java.lang.String url,
                     java.lang.String domain,
                     java.lang.String path)
        
        Deletes browser cookies with matching name and url or domain/path pair.
        Parameters:
        name - Name of the cookies to remove.
        url - If specified, deletes all the cookies with the given name where domain and path match provided URL.
        OPTIONAL
        domain - If specified, deletes only cookies with the exact domain.
        OPTIONAL
        path - If specified, deletes only cookies with the exact path.
        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.
      • disable

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0disable()
        Disables network tracking, prevents network events from being sent to the client.
        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.
      • emulateNetworkConditions

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0emulateNetworkConditions​
                    (boolean offline,
                     java.lang.Number latency,
                     java.lang.Number downloadThroughput,
                     java.lang.Number uploadThroughput,
                     java.lang.String connectionType)
        
        Activates emulation of network conditions.
        Parameters:
        offline - True to emulate internet disconnection.
        latency - Minimum latency from request sent to response headers received (ms).
        downloadThroughput - Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
        uploadThroughput - Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
        connectionType - Connection type if known.
        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.
      • enable

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0enable​
                    (java.lang.Integer maxTotalBufferSize,
                     java.lang.Integer maxResourceBufferSize,
                     java.lang.Integer maxPostDataSize)
        
        Enables network tracking, network events will now be delivered to the client.
        Parameters:
        maxTotalBufferSize - Buffer size in bytes to use when preserving network payloads (XHRs, etc).
        OPTIONAL
        EXPERIMENTAL
        maxResourceBufferSize - Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
        OPTIONAL
        EXPERIMENTAL
        maxPostDataSize - Longest post body size (in bytes) that would be included in requestWillBeSent notification
        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.
      • getCertificate

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String[]> getCertificate​
                    (java.lang.String origin)
        
        Returns the DER-encoded certificate.
        EXPERIMENTAL
        Parameters:
        origin - Origin to get certificate for.
        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[] (tableNames)
          -
      • getCookies

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Network.Cookie[]> getCookies​
                    (java.lang.String[] urls)
        
        Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the cookies field.
        Parameters:
        urls - The list of URLs for which applicable cookies will be fetched. If not specified, it's assumed to be set to the list containing the URLs of the page and all of its subframes.
        OPTIONAL
        Returns:
        An instance of Script<String, JsonObject, Network.Cookie[]>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Network.Cookie[]> 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

      • getResponseBody

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret2<java.lang.String,​java.lang.Boolean>> getResponseBody​
                    (java.lang.String requestId)
        
        Returns content served for the given request.
        Parameters:
        requestId - Identifier of the network request 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 (body)
          Response body.

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

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String> getRequestPostData​
                    (java.lang.String requestId)
        
        Returns post data sent with the request. Returns an error when no data was sent with the request.
        Parameters:
        requestId - Identifier of the network request to get content for.
        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 (postData)
          Request body string, omitting files from multipart requests
      • getResponseBodyForInterception

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret2<java.lang.String,​java.lang.Boolean>> getResponseBodyForInterception​
                    (java.lang.String interceptionId)
        
        Returns content served for the given currently intercepted request.
        EXPERIMENTAL
        Parameters:
        interceptionId - Identifier for the intercepted request to get body 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 (body)
          Response body.

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

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.String> takeResponseBodyForInterceptionAsStream​
                    (java.lang.String interceptionId)
        
        Returns a handle to the stream representing the response body. Note that after this command, the intercepted request can't be continued as is -- you either need to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified.
        EXPERIMENTAL
        Parameters:
        interceptionId - -
        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 (stream)
          -
      • replayXHR

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0replayXHR​
                    (java.lang.String requestId)
        
        This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.
        EXPERIMENTAL
        Parameters:
        requestId - Identifier of XHR to replay.
        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.
      • searchInResponseBody

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Debugger.SearchMatch[]> searchInResponseBody​
                    (java.lang.String requestId,
                     java.lang.String query,
                     java.lang.Boolean caseSensitive,
                     java.lang.Boolean isRegex)
        
        Searches for given string in response content.
        EXPERIMENTAL
        Parameters:
        requestId - Identifier of the network response to search.
        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

      • setBlockedURLs

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setBlockedURLs​
                    (java.lang.String[] urls)
        
        Blocks URLs from loading.
        EXPERIMENTAL
        Parameters:
        urls - URL patterns to block. Wildcards ('*') are allowed.
        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.
      • setBypassServiceWorker

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setBypassServiceWorker​
                    (boolean bypass)
        
        Toggles ignoring of service worker for each request.
        EXPERIMENTAL
        Parameters:
        bypass - Bypass service worker and load from network.
        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.
      • setCacheDisabled

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setCacheDisabled​
                    (boolean cacheDisabled)
        
        Toggles ignoring cache for each request. If true, cache will not be used.
        Parameters:
        cacheDisabled - Cache disabled state.
        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.
      • setCookie

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​java.lang.Boolean> setCookie​
                    (java.lang.String name,
                     java.lang.String value,
                     java.lang.String url,
                     java.lang.String domain,
                     java.lang.String path,
                     java.lang.Boolean secure,
                     java.lang.Boolean httpOnly,
                     java.lang.String sameSite,
                     java.lang.Number expires,
                     java.lang.String priority,
                     java.lang.Boolean sameParty,
                     java.lang.String sourceScheme,
                     java.lang.Integer sourcePort)
        
        Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
        Parameters:
        name - Cookie name.
        value - Cookie value.
        url - The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.
        OPTIONAL
        domain - Cookie domain.
        OPTIONAL
        path - Cookie path.
        OPTIONAL
        secure - True if cookie is secure.
        OPTIONAL
        httpOnly - True if cookie is http-only.
        OPTIONAL
        sameSite - Cookie SameSite type.
        OPTIONAL
        expires - Cookie expiration date, session cookie if not set
        OPTIONAL
        priority - Cookie Priority type.
        OPTIONAL
        EXPERIMENTAL
        sameParty - True if cookie is SameParty.
        OPTIONAL
        EXPERIMENTAL
        sourceScheme - Cookie source scheme type.
        OPTIONAL
        EXPERIMENTAL
        sourcePort - Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
        OPTIONAL
        EXPERIMENTAL
        Returns:
        An instance of Script<String, JsonObject, Boolean>

        This script may be executed, using Script.exec(), and afterwards, a Promise<JsonObject, Boolean> 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

        • Boolean (success)
          Always set to true. If an error occurs, the response indicates protocol error.
      • setCookies

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setCookies​
                    (Network.CookieParam[] cookies)
        
        Sets given cookies.
        Parameters:
        cookies - Cookies to be 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.
      • setExtraHTTPHeaders

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setExtraHTTPHeaders​
                    (JsonObject headers)
        
        Specifies whether to always send extra HTTP headers with the requests from this page.
        Parameters:
        headers - Map with extra HTTP headers.
        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.
      • setAttachDebugStack

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setAttachDebugStack​
                    (boolean enabled)
        
        Specifies whether to attach a page script stack id in requests
        EXPERIMENTAL
        Parameters:
        enabled - Whether to attach a page script stack for debugging purpose.
        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.
      • setRequestInterception

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setRequestInterception​
                    (Network.RequestPattern[] patterns)
        
        Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.
        EXPERIMENTAL
        DEPRECATED
        Parameters:
        patterns - Requests matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call.
        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.
      • setUserAgentOverride

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0setUserAgentOverride​
                    (java.lang.String userAgent,
                     java.lang.String acceptLanguage,
                     java.lang.String platform,
                     Emulation.UserAgentMetadata userAgentMetadata)
        
        Allows overriding user agent with the given string.
        Parameters:
        userAgent - User agent to use.
        acceptLanguage - Browser langugage to emulate.
        OPTIONAL
        platform - The platform navigator.platform should return.
        OPTIONAL
        userAgentMetadata - To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
        OPTIONAL
        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.
      • enableReportingApi

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.String,​JsonObject,​Ret0enableReportingApi​
                    (boolean enable)
        
        Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client. Enabling triggers 'reportingApiReportAdded' for all existing reports.
        EXPERIMENTAL
        Parameters:
        enable - Whether to enable or disable events for the Reporting API
        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.