Package Torello.Browser.BrowserAPI
Class Network
- java.lang.Object
-
- Torello.Browser.BrowserAPI.Network
-
public class Network 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:
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.
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/Network.java
- Open New Browser-Tab: Torello/Browser/BrowserAPI/Network.java
File Size: 314,224 Bytes Line Count: 7,641 '\n' Characters Found
Helper: Command Invocation Helpers
- View Here: Network$$Commands.java
- Open New Browser-Tab: Network$$Commands.java
File Size: 9,936 Bytes Line Count: 232 '\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
- 39 Method(s), 39 declared static
- 35 Field(s), 35 declared static, 35 declared final
-
-
Nested Class Summary
Type Nested Classes: Types / Classes that Are Used & Exported by this Domain Modifier and Type Class Description static classNetwork.AssociatedCookieA cookie associated with the request which may or may not be sent with it.static classNetwork.AuthChallengeAuthorization challenge for HTTP status code 401 or 407.static classNetwork.AuthChallengeResponseResponse to an AuthChallenge.static classNetwork.BlockedSetCookieWithReasonA cookie which was not stored from a response with the corresponding reason.static classNetwork.CachedResourceInformation about the cached resource.static classNetwork.ClientSecurityState[No Description Provided by Google]static classNetwork.ConnectTiming[No Description Provided by Google]static classNetwork.ContentSecurityPolicyStatus[No Description Provided by Google]static classNetwork.CookieCookie objectstatic classNetwork.CookieParamCookie parameter objectstatic classNetwork.CookiePartitionKeycookiePartitionKey object The representation of the components of the key that are created by the cookiePartitionKey class contained in net/cookies/cookie_partition_key.h.static classNetwork.CorsErrorStatus[No Description Provided by Google]static classNetwork.CrossOriginEmbedderPolicyStatus[No Description Provided by Google]static classNetwork.CrossOriginOpenerPolicyStatus[No Description Provided by Google]static classNetwork.DirectTCPSocketOptions[No Description Provided by Google]static classNetwork.DirectUDPMessage[No Description Provided by Google]static classNetwork.DirectUDPSocketOptions[No Description Provided by Google]static classNetwork.ExemptedSetCookieWithReasonA cookie should have been blocked by 3PCD but is exempted and stored from a response with the corresponding reason.static classNetwork.InitiatorInformation about the request initiator.static classNetwork.LoadNetworkResourceOptionsAn options object that may be extended later to better support CORS, CORB and streaming.static classNetwork.LoadNetworkResourcePageResultAn object providing the result of a network resource load.static classNetwork.PostDataEntryPost data entry for HTTP requeststatic classNetwork.ReportingApiEndpoint[No Description Provided by Google]static classNetwork.ReportingApiReportAn object representing a report generated by the Reporting API.static classNetwork.RequestHTTP request data.static classNetwork.RequestPatternRequest pattern for interception.static classNetwork.ResourceTimingTiming information for the request.static classNetwork.ResponseHTTP response data.static classNetwork.SecurityDetailsSecurity details about a request.static classNetwork.SecurityIsolationStatus[No Description Provided by Google]static classNetwork.ServiceWorkerRouterInfo[No Description Provided by Google]static classNetwork.SignedCertificateTimestampDetails of a signed certificate timestamp (SCT).static classNetwork.SignedExchangeErrorInformation about a signed exchange response.static classNetwork.SignedExchangeHeaderInformation about a signed exchange header.static classNetwork.SignedExchangeInfoInformation about a signed exchange response.static classNetwork.SignedExchangeSignatureInformation about a signed exchange signature.static classNetwork.TrustTokenParamsDetermines what type of Trust Token operation is executed and depending on the type, some additional parameters.static classNetwork.WebSocketFrameWebSocket message data.static classNetwork.WebSocketRequestWebSocket request data.static classNetwork.WebSocketResponseWebSocket response data.Event Nested Classes: Browser Events, as Java Inner Classes, Which are Fired by this Domain Modifier and Type Class Description static classNetwork.dataReceivedFired when data chunk was received over the network.static classNetwork.directTCPSocketAbortedFired when direct_socket.TCPSocket is aborted.static classNetwork.directTCPSocketChunkReceivedFired when data is received from tcp direct socket stream.static classNetwork.directTCPSocketChunkSentFired when data is sent to tcp direct socket stream.static classNetwork.directTCPSocketClosedFired when direct_socket.TCPSocket is closed.static classNetwork.directTCPSocketCreatedFired upon direct_socket.TCPSocket creation.static classNetwork.directTCPSocketOpenedFired when direct_socket.TCPSocket connection is opened.static classNetwork.directUDPSocketAbortedFired when direct_socket.UDPSocket is aborted.static classNetwork.directUDPSocketChunkReceivedFired when message is received from udp direct socket stream.static classNetwork.directUDPSocketChunkSentFired when message is sent to udp direct socket stream.static classNetwork.directUDPSocketClosedFired when direct_socket.UDPSocket is closed.static classNetwork.directUDPSocketCreatedFired upon direct_socket.UDPSocket creation.static classNetwork.directUDPSocketOpenedFired when direct_socket.UDPSocket connection is opened.static classNetwork.eventSourceMessageReceivedFired when EventSource message is received.static classNetwork.loadingFailedFired when HTTP request has failed to load.static classNetwork.loadingFinishedFired when HTTP request has finished loading.static classNetwork.reportingApiEndpointsChangedForOrigin[No Description Provided by Google]static classNetwork.reportingApiReportAddedIs sent whenever a new report is added.static classNetwork.reportingApiReportUpdated[No Description Provided by Google]static classNetwork.requestInterceptedDetails of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked.static classNetwork.requestServedFromCacheFired if request ended up loading from cache.static classNetwork.requestWillBeSentFired when page is about to send HTTP request.static classNetwork.requestWillBeSentExtraInfoFired when additional information about a requestWillBeSent event is available from the network stack.static classNetwork.resourceChangedPriorityFired when resource loading priority is changedstatic classNetwork.responseReceivedFired when HTTP response is available.static classNetwork.responseReceivedEarlyHintsFired when 103 Early Hints headers is received in addition to the common response.static classNetwork.responseReceivedExtraInfoFired when additional information about a responseReceived event is available from the network stack.static classNetwork.signedExchangeReceivedFired when a signed exchange was received over the networkstatic classNetwork.subresourceWebBundleInnerResponseErrorFired when request for resources within a .wbn file failed.static classNetwork.subresourceWebBundleInnerResponseParsedFired when handling requests for resources within a .wbn file.static classNetwork.subresourceWebBundleMetadataErrorFired once when parsing the .wbn file has failed.static classNetwork.subresourceWebBundleMetadataReceivedFired once when parsing the .wbn file has succeeded.static classNetwork.trustTokenOperationDoneFired exactly once for each Trust Token operation.static classNetwork.webSocketClosedFired when WebSocket is closed.static classNetwork.webSocketCreatedFired upon WebSocket creation.static classNetwork.webSocketFrameErrorFired when WebSocket message error occurs.static classNetwork.webSocketFrameReceivedFired when WebSocket message is received.static classNetwork.webSocketFrameSentFired when WebSocket message is sent.static classNetwork.webSocketHandshakeResponseReceivedFired when WebSocket handshake response becomes available.static classNetwork.webSocketWillSendHandshakeRequestFired when WebSocket is about to initiate handshake.static classNetwork.webTransportClosedFired when WebTransport is disposed.static classNetwork.webTransportConnectionEstablishedFired when WebTransport handshake is finished.static classNetwork.webTransportCreatedFired upon WebTransport creation.Command-Returns Nested Classes: Domain-Commands with Multiple Return-Values, and a Dedicated Inner-Class Modifier and Type Class Description static classNetwork.getResponseBody$$RETReturns content served for the given request.static classNetwork.getResponseBodyForInterception$$RETReturns content served for the given currently intercepted request.
-
Field Summary
Enumerated Strings: Like Java 'enum' Types, but Converted to Read-Only String-Lists Modifier and Type Field Description static ReadOnlyList<String>AlternateProtocolUsageThe reason why Chrome uses a specific transport protocol for HTTP semantics.static ReadOnlyList<String>BlockedReasonThe reason why request was blocked.static ReadOnlyList<String>CertificateTransparencyComplianceWhether the request complied with Certificate Transparency policy.static ReadOnlyList<String>ConnectionTypeThe underlying connection technology that the browser is supposedly using.static ReadOnlyList<String>ContentEncodingList of content encodings supported by the backend.static ReadOnlyList<String>ContentSecurityPolicySource[No Description Provided by Google]static ReadOnlyList<String>CookieBlockedReasonTypes of reasons why a cookie may not be sent with a request.static ReadOnlyList<String>CookieExemptionReasonTypes of reasons why a cookie should have been blocked by 3PCD but is exempted for the request.static ReadOnlyList<String>CookiePriorityRepresents the cookie's 'Priority' status: https://tools.ietf.org/html/draft-west-cookie-priority-00static ReadOnlyList<String>CookieSameSiteRepresents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookiesstatic ReadOnlyList<String>CookieSourceSchemeRepresents the source scheme of the origin that originally set the cookie.static ReadOnlyList<String>CorsErrorThe reason why request was blocked.static ReadOnlyList<String>CrossOriginEmbedderPolicyValue[No Description Provided by Google]static ReadOnlyList<String>CrossOriginOpenerPolicyValue[No Description Provided by Google]static ReadOnlyList<String>DirectSocketDnsQueryType[No Description Provided by Google]static ReadOnlyList<String>ErrorReasonNetwork level fetch failure reason.static ReadOnlyList<String>InterceptionStageStages of the interception to begin intercepting.static ReadOnlyList<String>IPAddressSpace[No Description Provided by Google]static ReadOnlyList<String>PrivateNetworkRequestPolicy[No Description Provided by Google]static ReadOnlyList<String>ReportStatusThe status of a Reporting API report.static ReadOnlyList<String>ResourcePriorityLoading priority of a resource request.static ReadOnlyList<String>ResourceTypeResource type as it was perceived by the rendering engine.static ReadOnlyList<String>ServiceWorkerResponseSourceSource of serviceworker response.static ReadOnlyList<String>ServiceWorkerRouterSourceSource of service worker router.static ReadOnlyList<String>SetCookieBlockedReasonTypes of reasons why a cookie may not be stored from a response.static ReadOnlyList<String>SignedExchangeErrorFieldField type for a signed exchange related error.static ReadOnlyList<String>TrustTokenOperationType[No Description Provided by Google]Eliminated Types: Removed CDP Types which Have Been Re-Mapped to Basic Java String Constants Modifier and Type Field Description static StringHeadersRequest / response headers as keys / values of JSON object.static StringInterceptionIdUnique intercepted request identifier.static StringLoaderIdUnique loader identifier.static StringMonotonicTimeMonotonically increasing time in seconds since an arbitrary point in the past.static StringReportId[No Description Provided by Google]static StringRequestIdUnique network request identifier.static StringTimeSinceEpochUTC time in seconds, counted from January 1, 1970.Marker Events: Events without any Fields or Properties Modifier and Type Field Description static StringpolicyUpdatedFired once security policy has been updated.
-
Method Summary
Network Domain Commands Script Returns Modifier and Type Method Booleanstatic Script<>canClearBrowserCache()
Tells whether clearing browser cache is supported.Booleanstatic Script<>canClearBrowserCookies()
Tells whether clearing browser cookies is supported.Booleanstatic Script<>canEmulateNetworkConditions()
Tells whether emulation of network conditions is supported.Voidstatic Script<>clearAcceptedEncodingsOverride()
Clears accepted encodings set by setAcceptedEncodingsVoidstatic Script<>clearBrowserCache()
Clears browser cache.Voidstatic Script<>clearBrowserCookies()
Clears browser cookies.Voidstatic Script<>continueInterceptedRequest(String interceptionId, String errorReason, String rawResponse, String url, String method, String postData, JsonValue 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.Voidstatic Script<>deleteCookies(String name, String url, String domain, String path, Network.CookiePartitionKey partitionKey)
Deletes browser cookies with matching name and url or domain/path/partitionKey pair.Voidstatic Script<>disable()
Disables network tracking, prevents network events from being sent to the client.Voidstatic Script<>emulateNetworkConditions(boolean offline, Number latency, Number downloadThroughput, Number uploadThroughput, String connectionType, Number packetLoss, Integer packetQueueLength, Boolean packetReordering)
Activates emulation of network conditions.Voidstatic Script<>enable(Integer maxTotalBufferSize, Integer maxResourceBufferSize, Integer maxPostDataSize, Boolean reportDirectSocketTraffic)
Enables network tracking, network events will now be delivered to the client.Voidstatic Script<>enableReportingApi(boolean enable)
Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client.Network.Cookie[]static Script<>getAllCookies()
Returns all browser cookies.String[]static Script<>getCertificate(String origin)
Returns the DER-encoded certificate.Network.Cookie[]static Script<>getCookies(String[] urls)
Returns all browser cookies for the current URL.Stringstatic Script<>getRequestPostData(String requestId)
Returns post data sent with the request.Network.getResponseBody$$RETstatic Script<>getResponseBody(String requestId)
Returns content served for the given request.Network.getResponseBodyForInterception$$RETstatic Script<>getResponseBodyForInterception(String interceptionId)
Returns content served for the given currently intercepted request.Network.SecurityIsolationStatusstatic Script<>getSecurityIsolationStatus(String frameId)
Returns information about the COEP/COOP isolation status.Network.LoadNetworkResourcePageResultstatic Script<>loadNetworkResource(String frameId, String url, Network.LoadNetworkResourceOptions options)
Fetches the resource and returns the content.Voidstatic Script<>replayXHR(String requestId)
This method sends a new XMLHttpRequest which is identical to the original one.Debugger.SearchMatch[]static Script<>searchInResponseBody(String requestId, String query, Boolean caseSensitive, Boolean isRegex)
Searches for given string in response content.Voidstatic Script<>setAcceptedEncodings(String[] encodings)
Sets a list of content encodings that will be accepted.Voidstatic Script<>setAttachDebugStack(boolean enabled)
Specifies whether to attach a page script stack id in requestsVoidstatic Script<>setBlockedURLs(String[] urls)
Blocks URLs from loading.Voidstatic Script<>setBypassServiceWorker(boolean bypass)
Toggles ignoring of service worker for each request.Voidstatic Script<>setCacheDisabled(boolean cacheDisabled)
Toggles ignoring cache for each request.Booleanstatic Script<>setCookie(String name, String value, String url, String domain, String path, Boolean secure, Boolean httpOnly, String sameSite, Number expires, String priority, Boolean sameParty, String sourceScheme, Integer sourcePort, Network.CookiePartitionKey partitionKey)
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.Voidstatic Script<>setCookieControls(boolean enableThirdPartyCookieRestriction, boolean disableThirdPartyCookieMetadata, boolean disableThirdPartyCookieHeuristics)
Sets Controls for third-party cookie access Page reload is required before the new cookie behavior will be observedVoidstatic Script<>setCookies(Network.CookieParam[] cookies)
Sets given cookies.Voidstatic Script<>setExtraHTTPHeaders(JsonValue headers)
Specifies whether to always send extra HTTP headers with the requests from this page.Voidstatic Script<>setRequestInterception(Network.RequestPattern[] patterns)
Sets the requests to intercept that match the provided patterns and optionally resource types.Voidstatic Script<>setUserAgentOverride(String userAgent, String acceptLanguage, String platform, Emulation.UserAgentMetadata userAgentMetadata)
Allows overriding user agent with the given string.Stringstatic Script<>streamResourceContent(String requestId)
Enables streaming of the response for the given requestId.Stringstatic Script<>takeResponseBodyForInterceptionAsStream(String interceptionId)
Returns a handle to the stream representing the response body.Network Domain CommandBuilder Methods Modifier and Type Method Description static CommandBuilder
<Void>continueInterceptedRequest()Creates a buider for conveniently assigning parameters to this method.static CommandBuilder
<Void>deleteCookies()Creates a buider for conveniently assigning parameters to this method.static CommandBuilder
<Void>emulateNetworkConditions()Creates a buider for conveniently assigning parameters to this method.static CommandBuilder
<Boolean>setCookie()Creates a buider for conveniently assigning parameters to this method.
-
-
-
Field Detail
-
Headers
public static final java.lang.String Headers
Request / response headers as keys / values of JSON object.
The TypeHeadershas 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:JsonValue
Eliminated Type- See Also:
- Constant Field Values
-
InterceptionId
public static final java.lang.String InterceptionId
Unique intercepted request identifier.
The TypeInterceptionIdhas 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
-
LoaderId
public static final java.lang.String LoaderId
Unique loader identifier.
The TypeLoaderIdhas 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
-
MonotonicTime
public static final java.lang.String MonotonicTime
Monotonically increasing time in seconds since an arbitrary point in the past.
The TypeMonotonicTimehas 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:Number
Eliminated Type- See Also:
- Constant Field Values
-
ReportId
public static final java.lang.String ReportId
[No Description Provided by Google]
EXPERIMENTAL
The TypeReportIdhas 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
-
RequestId
public static final java.lang.String RequestId
Unique network request identifier. Note that this does not identify individual HTTP requests that are part of a network request.
The TypeRequestIdhas 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
-
TimeSinceEpoch
public static final java.lang.String TimeSinceEpoch
UTC time in seconds, counted from January 1, 1970.
The TypeTimeSinceEpochhas 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:Number
Eliminated Type- See Also:
- Constant Field Values
-
policyUpdated
public static final java.lang.String policyUpdated
Fired once security policy has been updated.
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.policyUpdatedhas not been 'reified' into an actual nested / inner class of its own, at all.
Eliminated Event Type- See Also:
- Constant Field Values
-
AlternateProtocolUsage
public static final ReadOnlyList<java.lang.String> AlternateProtocolUsage
The reason why Chrome uses a specific transport protocol for HTTP semantics.
EXPERIMENTAL
String-Enumeration Type
-
BlockedReason
public static final ReadOnlyList<java.lang.String> BlockedReason
The reason why request was blocked.
String-Enumeration Type
-
CertificateTransparencyCompliance
public static final ReadOnlyList<java.lang.String> CertificateTransparencyCompliance
Whether the request complied with Certificate Transparency policy.
String-Enumeration Type
-
ConnectionType
public static final ReadOnlyList<java.lang.String> ConnectionType
The underlying connection technology that the browser is supposedly using.
String-Enumeration Type
-
ContentEncoding
public static final ReadOnlyList<java.lang.String> ContentEncoding
List of content encodings supported by the backend.
EXPERIMENTAL
String-Enumeration Type
-
ContentSecurityPolicySource
public static final ReadOnlyList<java.lang.String> ContentSecurityPolicySource
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
CookieBlockedReason
public static final ReadOnlyList<java.lang.String> CookieBlockedReason
Types of reasons why a cookie may not be sent with a request.
EXPERIMENTAL
String-Enumeration Type
-
CookieExemptionReason
public static final ReadOnlyList<java.lang.String> CookieExemptionReason
Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request.
EXPERIMENTAL
String-Enumeration Type
-
CookiePriority
public static final ReadOnlyList<java.lang.String> CookiePriority
Represents the cookie's 'Priority' status: https://tools.ietf.org/html/draft-west-cookie-priority-00
EXPERIMENTAL
String-Enumeration Type
-
CookieSameSite
public static final ReadOnlyList<java.lang.String> CookieSameSite
Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies
String-Enumeration Type
-
CookieSourceScheme
public static final ReadOnlyList<java.lang.String> CookieSourceScheme
Represents the source scheme of the origin that originally set the cookie. A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. This is a temporary ability and it will be removed in the future.
EXPERIMENTAL
String-Enumeration Type
-
CorsError
public static final ReadOnlyList<java.lang.String> CorsError
The reason why request was blocked.
String-Enumeration Type
-
CrossOriginEmbedderPolicyValue
public static final ReadOnlyList<java.lang.String> CrossOriginEmbedderPolicyValue
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
CrossOriginOpenerPolicyValue
public static final ReadOnlyList<java.lang.String> CrossOriginOpenerPolicyValue
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
DirectSocketDnsQueryType
public static final ReadOnlyList<java.lang.String> DirectSocketDnsQueryType
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
ErrorReason
public static final ReadOnlyList<java.lang.String> ErrorReason
Network level fetch failure reason.
String-Enumeration Type
-
IPAddressSpace
public static final ReadOnlyList<java.lang.String> IPAddressSpace
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
InterceptionStage
public static final ReadOnlyList<java.lang.String> InterceptionStage
Stages of the interception to begin intercepting. Request will intercept before the request is sent. Response will intercept after the response is received.
EXPERIMENTAL
String-Enumeration Type
-
PrivateNetworkRequestPolicy
public static final ReadOnlyList<java.lang.String> PrivateNetworkRequestPolicy
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
ReportStatus
public static final ReadOnlyList<java.lang.String> ReportStatus
The status of a Reporting API report.
EXPERIMENTAL
String-Enumeration Type
-
ResourcePriority
public static final ReadOnlyList<java.lang.String> ResourcePriority
Loading priority of a resource request.
String-Enumeration Type
-
ResourceType
public static final ReadOnlyList<java.lang.String> ResourceType
Resource type as it was perceived by the rendering engine.
String-Enumeration Type
-
ServiceWorkerResponseSource
public static final ReadOnlyList<java.lang.String> ServiceWorkerResponseSource
Source of serviceworker response.
String-Enumeration Type
-
ServiceWorkerRouterSource
public static final ReadOnlyList<java.lang.String> ServiceWorkerRouterSource
Source of service worker router.
String-Enumeration Type
-
SetCookieBlockedReason
public static final ReadOnlyList<java.lang.String> SetCookieBlockedReason
Types of reasons why a cookie may not be stored from a response.
EXPERIMENTAL
String-Enumeration Type
-
SignedExchangeErrorField
public static final ReadOnlyList<java.lang.String> SignedExchangeErrorField
Field type for a signed exchange related error.
EXPERIMENTAL
String-Enumeration Type
-
TrustTokenOperationType
public static final ReadOnlyList<java.lang.String> TrustTokenOperationType
[No Description Provided by Google]
EXPERIMENTAL
String-Enumeration Type
-
-
Method Detail
-
canClearBrowserCache
public static Script<java.lang.Boolean> canClearBrowserCache()
Tells whether clearing browser cache is supported.
DEPRECATED- Returns:
- An instance of
Script<Boolean>
This script may be executed, usingScript.exec, and afterwards, aPromise<Boolean>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Boolean (result)
True if browser cache can be cleared.
-
canClearBrowserCookies
public static Script<java.lang.Boolean> canClearBrowserCookies()
Tells whether clearing browser cookies is supported.
DEPRECATED- Returns:
- An instance of
Script<Boolean>
This script may be executed, usingScript.exec, and afterwards, aPromise<Boolean>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Boolean (result)
True if browser cookies can be cleared.
-
canEmulateNetworkConditions
public static Script<java.lang.Boolean> canEmulateNetworkConditions()
Tells whether emulation of network conditions is supported.
DEPRECATED- Returns:
- An instance of
Script<Boolean>
This script may be executed, usingScript.exec, and afterwards, aPromise<Boolean>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Boolean (result)
True if emulation of network conditions is supported.
-
clearAcceptedEncodingsOverride
public static Script<java.lang.Void> clearAcceptedEncodingsOverride()
Clears accepted encodings set by setAcceptedEncodings
EXPERIMENTAL
-
clearBrowserCache
public static Script<java.lang.Void> clearBrowserCache()
Clears browser cache.
-
clearBrowserCookies
public static Script<java.lang.Void> clearBrowserCookies()
Clears browser cookies.
-
continueInterceptedRequest
public static Script<java.lang.Void> continueInterceptedRequest (java.lang.String interceptionId, java.lang.String errorReason, java.lang.String rawResponse, java.lang.String url, java.lang.String method, java.lang.String postData, JsonValue 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.
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:continueInterceptedRequest()- Parameters:
interceptionId- -errorReason- If set this causes the request to fail with the given reason. PassingAbortedfor requests marked withisNavigationRequestalso cancels the navigation. Must not be set in response to an authChallenge.
OPTIONALrawResponse- 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)
OPTIONALurl- 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.
OPTIONALmethod- If set this allows the request method to be overridden. Must not be set in response to an authChallenge.
OPTIONALpostData- If set this allows postData to be set. Must not be set in response to an authChallenge.
OPTIONALheaders- If set this allows the request headers to be changed. Must not be set in response to an authChallenge.
OPTIONALauthChallengeResponse- Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
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.
-
deleteCookies
public static Script<java.lang.Void> deleteCookies (java.lang.String name, java.lang.String url, java.lang.String domain, java.lang.String path, Network.CookiePartitionKey partitionKey)
Deletes browser cookies with matching name and url or domain/path/partitionKey pair.👍 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:deleteCookies()- 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.
OPTIONALdomain- If specified, deletes only cookies with the exact domain.
OPTIONALpath- If specified, deletes only cookies with the exact path.
OPTIONALpartitionKey- If specified, deletes only cookies with the the given name and partitionKey where all partition key attributes match the cookie partition key attribute.
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.
-
disable
-
emulateNetworkConditions
public static Script<java.lang.Void> emulateNetworkConditions (boolean offline, java.lang.Number latency, java.lang.Number downloadThroughput, java.lang.Number uploadThroughput, java.lang.String connectionType, java.lang.Number packetLoss, java.lang.Integer packetQueueLength, java.lang.Boolean packetReordering)
Activates emulation of network conditions.👍 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:emulateNetworkConditions()- 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.
OPTIONALpacketLoss- WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
OPTIONALEXPERIMENTALpacketQueueLength- WebRTC packet queue length (packet). 0 removes any queue length limitations.
OPTIONALEXPERIMENTALpacketReordering- WebRTC packetReordering feature.
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.
-
enable
public static Script<java.lang.Void> enable (java.lang.Integer maxTotalBufferSize, java.lang.Integer maxResourceBufferSize, java.lang.Integer maxPostDataSize, java.lang.Boolean reportDirectSocketTraffic)
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).
OPTIONALEXPERIMENTALmaxResourceBufferSize- Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
OPTIONALEXPERIMENTALmaxPostDataSize- Longest post body size (in bytes) that would be included in requestWillBeSent notification
OPTIONALreportDirectSocketTraffic- Whether DirectSocket chunk send/receive events should be reported.
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.
-
enableReportingApi
public static Script<java.lang.Void> enableReportingApi(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<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.
-
getAllCookies
public static Script<Network.Cookie[]> getAllCookies()
Returns all browser cookies. Depending on the backend support, will return detailed cookie information in thecookiesfield. Deprecated. Use Storage.getCookies instead.
DEPRECATED- Returns:
- An instance of
Script<Network.Cookie[]>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedNetwork.Cookie[]>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.
-
getCertificate
public static Script<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[]>
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[] (tableNames)
-
getCookies
public static Script<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 thecookiesfield.- 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<Network.Cookie[]>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedNetwork.Cookie[]>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.
-
getRequestPostData
public static Script<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>
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 (postData)
Request body string, omitting files from multipart requests
-
getResponseBody
public static Script<Network.getResponseBody$$RET> 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<Network.getResponseBody$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedNetwork.getResponseBody$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Network.getResponseBody$$RETA dedicated return type implies that the browser may return more than 1 datum
-
getResponseBodyForInterception
public static Script<Network.getResponseBodyForInterception$$RET> 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<Network.getResponseBodyForInterception$$RET>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedNetwork.getResponseBodyForInterception$$RET>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Network.getResponseBodyForInterception$$RETA dedicated return type implies that the browser may return more than 1 datum
-
getSecurityIsolationStatus
public static Script<Network.SecurityIsolationStatus> getSecurityIsolationStatus (java.lang.String frameId)
Returns information about the COEP/COOP isolation status.
EXPERIMENTAL- Parameters:
frameId- If no frameId is provided, the status of the target is provided.
OPTIONAL- Returns:
- An instance of
Script<Network.SecurityIsolationStatus>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedNetwork.SecurityIsolationStatus>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Network.SecurityIsolationStatus(status)
-
loadNetworkResource
public static Script<Network.LoadNetworkResourcePageResult> loadNetworkResource (java.lang.String frameId, java.lang.String url, Network.LoadNetworkResourceOptions options)
Fetches the resource and returns the content.
EXPERIMENTAL- Parameters:
frameId- Frame id to get the resource for. Mandatory for frame targets, and should be omitted for worker targets.
OPTIONALurl- URL of the resource to get content for.options- Options for the request.- Returns:
- An instance of
Script<Network.LoadNetworkResourcePageResult>
This script may be executed, usingScript.exec, and afterwards, aPromise<will be returnedNetwork.LoadNetworkResourcePageResult>
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Network.LoadNetworkResourcePageResult(resource)
-
replayXHR
public static Script<java.lang.Void> replayXHR(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<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.
-
searchInResponseBody
public static Script<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.
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.
-
setAcceptedEncodings
public static Script<java.lang.Void> setAcceptedEncodings (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<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.
-
setAttachDebugStack
public static Script<java.lang.Void> setAttachDebugStack(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<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.
-
setBlockedURLs
public static Script<java.lang.Void> setBlockedURLs (java.lang.String[] urls)
Blocks URLs from loading.
EXPERIMENTAL- Parameters:
urls- URL patterns to block. Wildcards ('*') are allowed.- 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.
-
setBypassServiceWorker
public static Script<java.lang.Void> setBypassServiceWorker (boolean bypass)
Toggles ignoring of service worker for each request.- Parameters:
bypass- Bypass service worker and load from network.- 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.
-
setCacheDisabled
public static Script<java.lang.Void> setCacheDisabled (boolean cacheDisabled)
Toggles ignoring cache for each request. Iftrue, cache will not be used.- Parameters:
cacheDisabled- Cache disabled state.- 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.
-
setCookie
public static Script<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, Network.CookiePartitionKey partitionKey)
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.👍 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:setCookie()- 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.
OPTIONALdomain- Cookie domain.
OPTIONALpath- Cookie path.
OPTIONALsecure- True if cookie is secure.
OPTIONALhttpOnly- True if cookie is http-only.
OPTIONALsameSite- Cookie SameSite type.
OPTIONALexpires- Cookie expiration date, session cookie if not set
OPTIONALpriority- Cookie Priority type.
OPTIONALEXPERIMENTALsameParty- True if cookie is SameParty.
OPTIONALEXPERIMENTALsourceScheme- Cookie source scheme type.
OPTIONALEXPERIMENTALsourcePort- 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.
OPTIONALEXPERIMENTALpartitionKey- Cookie partition key. If not set, the cookie will be set as not partitioned.
OPTIONALEXPERIMENTAL- Returns:
- An instance of
Script<Boolean>
This script may be executed, usingScript.exec, and afterwards, aPromise<Boolean>will be returned
Finally, thePromisemay be awaited, usingPromise.await(), and the returned result of this Browser Function may be retrieved.This Browser Function'sPromisereturns:Boolean (success)
Always set to true. If an error occurs, the response indicates protocol error.
-
setCookieControls
public static Script<java.lang.Void> setCookieControls (boolean enableThirdPartyCookieRestriction, boolean disableThirdPartyCookieMetadata, boolean disableThirdPartyCookieHeuristics)
Sets Controls for third-party cookie access Page reload is required before the new cookie behavior will be observed
EXPERIMENTAL- Parameters:
enableThirdPartyCookieRestriction- Whether 3pc restriction is enabled.disableThirdPartyCookieMetadata- Whether 3pc grace period exception should be enabled; false by default.disableThirdPartyCookieHeuristics- Whether 3pc heuristics exceptions should be enabled; false by default.- 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.
-
setCookies
public static Script<java.lang.Void> setCookies (Network.CookieParam[] cookies)
Sets given cookies.- Parameters:
cookies- Cookies to be 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.
-
setExtraHTTPHeaders
public static Script<java.lang.Void> setExtraHTTPHeaders (JsonValue 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<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.
-
setRequestInterception
public static Script<java.lang.Void> setRequestInterception (Network.RequestPattern[] patterns)
Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.
EXPERIMENTALDEPRECATED- Parameters:
patterns- Requests matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call.- 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.
-
setUserAgentOverride
public static Script<java.lang.Void> setUserAgentOverride (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 language to emulate.
OPTIONALplatform- The platform navigator.platform should return.
OPTIONALuserAgentMetadata- To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
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.
-
streamResourceContent
public static Script<java.lang.String> streamResourceContent (java.lang.String requestId)
Enables streaming of the response for the given requestId. If enabled, the dataReceived event contains the data that was received during streaming.
EXPERIMENTAL- Parameters:
requestId- Identifier of the request to stream.- 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 (bufferedData)
Data that has been buffered until streaming is enabled. (Encoded as a base64 string when passed over JSON)
-
takeResponseBodyForInterceptionAsStream
public static Script<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>
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 (stream)
-
continueInterceptedRequest
public static CommandBuilder<java.lang.Void> continueInterceptedRequest()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 8 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
continueInterceptedRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, javax.json.JsonValue, Torello.Browser.BrowserAPI.Network.AuthChallengeResponse)
-
deleteCookies
public static CommandBuilder<java.lang.Void> deleteCookies()
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:
deleteCookies(java.lang.String, java.lang.String, java.lang.String, java.lang.String, Torello.Browser.BrowserAPI.Network.CookiePartitionKey)
-
emulateNetworkConditions
public static CommandBuilder<java.lang.Void> emulateNetworkConditions()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 8 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
emulateNetworkConditions(boolean, java.lang.Number, java.lang.Number, java.lang.Number, java.lang.String, java.lang.Number, java.lang.Integer, java.lang.Boolean)
-
setCookie
public static CommandBuilder<java.lang.Boolean> setCookie()
Creates a buider for conveniently assigning parameters to this method.Note that the original method expects 14 parameters, and can be cumbersome.- Returns:
CommandBuilderinstance, for assigning parameter values, one by one.- See Also:
setCookie(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean, java.lang.String, java.lang.Number, java.lang.String, java.lang.Boolean, java.lang.String, java.lang.Integer, Torello.Browser.BrowserAPI.Network.CookiePartitionKey)
-
-