glendam/protocol/network
This module is generated from the Chrome DevTools Protocol schema.
Do not edit this file manually. Generator: dev/codegen/generate_bindings.gleam Regenerate with:
gleam run -m codegen/generate_bindings
Protocol version: 1.3
Network Domain
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.
📖 View this domain on the DevTools Protocol API Docs
Types
The reason why request was blocked.
pub type BlockedReason {
BlockedReasonOther
BlockedReasonCsp
BlockedReasonMixedContent
BlockedReasonOrigin
BlockedReasonInspector
BlockedReasonSubresourceFilter
BlockedReasonContentType
BlockedReasonCoepFrameResourceNeedsCoepHeader
BlockedReasonCoopSandboxedIframeCannotNavigateToCoopPage
BlockedReasonCorpNotSameOrigin
BlockedReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoep
BlockedReasonCorpNotSameSite
}
Constructors
-
BlockedReasonOtherRepresents the
otherprotocol value. -
BlockedReasonCspRepresents the
cspprotocol value. -
BlockedReasonMixedContentRepresents the
mixed-contentprotocol value. -
BlockedReasonOriginRepresents the
originprotocol value. -
BlockedReasonInspectorRepresents the
inspectorprotocol value. -
BlockedReasonSubresourceFilterRepresents the
subresource-filterprotocol value. -
BlockedReasonContentTypeRepresents the
content-typeprotocol value. -
BlockedReasonCoepFrameResourceNeedsCoepHeaderRepresents the
coep-frame-resource-needs-coep-headerprotocol value. -
BlockedReasonCoopSandboxedIframeCannotNavigateToCoopPageRepresents the
coop-sandboxed-iframe-cannot-navigate-to-coop-pageprotocol value. -
BlockedReasonCorpNotSameOriginRepresents the
corp-not-same-originprotocol value. -
BlockedReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoepRepresents the
corp-not-same-origin-after-defaulted-to-same-origin-by-coepprotocol value. -
BlockedReasonCorpNotSameSiteRepresents the
corp-not-same-siteprotocol value.
Information about the cached resource.
pub type CachedResource {
CachedResource(
url: String,
type_: ResourceType,
response: option.Option(Response),
body_size: Float,
)
}
Constructors
-
CachedResource( url: String, type_: ResourceType, response: option.Option(Response), body_size: Float, )Represents the CachedResource protocol value.
Arguments
- url
-
Resource URL. This is the url of the original network request.
- type_
-
Type of this resource.
- response
-
Cached response data.
- body_size
-
Cached response body size.
Whether the request complied with Certificate Transparency policy.
pub type CertificateTransparencyCompliance {
CertificateTransparencyComplianceUnknown
CertificateTransparencyComplianceNotCompliant
CertificateTransparencyComplianceCompliant
}
Constructors
-
CertificateTransparencyComplianceUnknownRepresents the
unknownprotocol value. -
CertificateTransparencyComplianceNotCompliantRepresents the
not-compliantprotocol value. -
CertificateTransparencyComplianceCompliantRepresents the
compliantprotocol value.
The underlying connection technology that the browser is supposedly using.
pub type ConnectionType {
ConnectionTypeNone
ConnectionTypeCellular2g
ConnectionTypeCellular3g
ConnectionTypeCellular4g
ConnectionTypeBluetooth
ConnectionTypeEthernet
ConnectionTypeWifi
ConnectionTypeWimax
ConnectionTypeOther
}
Constructors
-
ConnectionTypeNoneRepresents the
noneprotocol value. -
ConnectionTypeCellular2gRepresents the
cellular2gprotocol value. -
ConnectionTypeCellular3gRepresents the
cellular3gprotocol value. -
ConnectionTypeCellular4gRepresents the
cellular4gprotocol value. -
ConnectionTypeBluetoothRepresents the
bluetoothprotocol value. -
ConnectionTypeEthernetRepresents the
ethernetprotocol value. -
ConnectionTypeWifiRepresents the
wifiprotocol value. -
ConnectionTypeWimaxRepresents the
wimaxprotocol value. -
ConnectionTypeOtherRepresents the
otherprotocol value.
Cookie object
pub type Cookie {
Cookie(
name: String,
value: String,
domain: String,
path: String,
expires: Float,
size: Int,
http_only: protocol_support.BooleanSetting,
secure: protocol_support.BooleanSetting,
session: protocol_support.BooleanSetting,
same_site: option.Option(CookieSameSite),
)
}
Constructors
-
Cookie( name: String, value: String, domain: String, path: String, expires: Float, size: Int, http_only: protocol_support.BooleanSetting, secure: protocol_support.BooleanSetting, session: protocol_support.BooleanSetting, same_site: option.Option(CookieSameSite), )Represents the Cookie protocol value.
Arguments
- name
-
Cookie name.
- value
-
Cookie value.
- domain
-
Cookie domain.
- path
-
Cookie path.
- expires
-
Cookie expiration date as the number of seconds since the UNIX epoch.
- size
-
Cookie size.
- http_only
-
True if cookie is http-only.
- secure
-
True if cookie is secure.
- session
-
True in case of session cookie.
- same_site
-
Cookie SameSite type.
Cookie parameter object
pub type CookieParam {
CookieParam(
name: String,
value: String,
url: option.Option(String),
domain: option.Option(String),
path: option.Option(String),
secure: option.Option(protocol_support.BooleanSetting),
http_only: option.Option(protocol_support.BooleanSetting),
same_site: option.Option(CookieSameSite),
expires: option.Option(TimeSinceEpoch),
)
}
Constructors
-
CookieParam( name: String, value: String, url: option.Option(String), domain: option.Option(String), path: option.Option(String), secure: option.Option(protocol_support.BooleanSetting), http_only: option.Option(protocol_support.BooleanSetting), same_site: option.Option(CookieSameSite), expires: option.Option(TimeSinceEpoch), )Represents the CookieParam protocol value.
Arguments
- 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.
- domain
-
Cookie domain.
- path
-
Cookie path.
- secure
-
True if cookie is secure.
- http_only
-
True if cookie is http-only.
- same_site
-
Cookie SameSite type.
- expires
-
Cookie expiration date, session cookie if not set
Represents the cookie’s ‘SameSite’ status: https://tools.ietf.org/html/draft-west-first-party-cookies
pub type CookieSameSite {
CookieSameSiteStrict
CookieSameSiteLax
CookieSameSiteNone
}
Constructors
-
CookieSameSiteStrictRepresents the
Strictprotocol value. -
CookieSameSiteLaxRepresents the
Laxprotocol value. -
CookieSameSiteNoneRepresents the
Noneprotocol value.
The reason why request was blocked.
pub type CorsError {
CorsErrorDisallowedByMode
CorsErrorInvalidResponse
CorsErrorWildcardOriginNotAllowed
CorsErrorMissingAllowOriginHeader
CorsErrorMultipleAllowOriginValues
CorsErrorInvalidAllowOriginValue
CorsErrorAllowOriginMismatch
CorsErrorInvalidAllowCredentials
CorsErrorCorsDisabledScheme
CorsErrorPreflightInvalidStatus
CorsErrorPreflightDisallowedRedirect
CorsErrorPreflightWildcardOriginNotAllowed
CorsErrorPreflightMissingAllowOriginHeader
CorsErrorPreflightMultipleAllowOriginValues
CorsErrorPreflightInvalidAllowOriginValue
CorsErrorPreflightAllowOriginMismatch
CorsErrorPreflightInvalidAllowCredentials
CorsErrorPreflightMissingAllowExternal
CorsErrorPreflightInvalidAllowExternal
CorsErrorPreflightMissingAllowPrivateNetwork
CorsErrorPreflightInvalidAllowPrivateNetwork
CorsErrorInvalidAllowMethodsPreflightResponse
CorsErrorInvalidAllowHeadersPreflightResponse
CorsErrorMethodDisallowedByPreflightResponse
CorsErrorHeaderDisallowedByPreflightResponse
CorsErrorRedirectContainsCredentials
CorsErrorInsecurePrivateNetwork
CorsErrorInvalidPrivateNetworkAccess
CorsErrorUnexpectedPrivateNetworkAccess
CorsErrorNoCorsRedirectModeNotFollow
CorsErrorPreflightMissingPrivateNetworkAccessId
CorsErrorPreflightMissingPrivateNetworkAccessName
CorsErrorPrivateNetworkAccessPermissionUnavailable
CorsErrorPrivateNetworkAccessPermissionDenied
}
Constructors
-
CorsErrorDisallowedByModeRepresents the
DisallowedByModeprotocol value. -
CorsErrorInvalidResponseRepresents the
InvalidResponseprotocol value. -
CorsErrorWildcardOriginNotAllowedRepresents the
WildcardOriginNotAllowedprotocol value. -
CorsErrorMissingAllowOriginHeaderRepresents the
MissingAllowOriginHeaderprotocol value. -
CorsErrorMultipleAllowOriginValuesRepresents the
MultipleAllowOriginValuesprotocol value. -
CorsErrorInvalidAllowOriginValueRepresents the
InvalidAllowOriginValueprotocol value. -
CorsErrorAllowOriginMismatchRepresents the
AllowOriginMismatchprotocol value. -
CorsErrorInvalidAllowCredentialsRepresents the
InvalidAllowCredentialsprotocol value. -
CorsErrorCorsDisabledSchemeRepresents the
CorsDisabledSchemeprotocol value. -
CorsErrorPreflightInvalidStatusRepresents the
PreflightInvalidStatusprotocol value. -
CorsErrorPreflightDisallowedRedirectRepresents the
PreflightDisallowedRedirectprotocol value. -
CorsErrorPreflightWildcardOriginNotAllowedRepresents the
PreflightWildcardOriginNotAllowedprotocol value. -
CorsErrorPreflightMissingAllowOriginHeaderRepresents the
PreflightMissingAllowOriginHeaderprotocol value. -
CorsErrorPreflightMultipleAllowOriginValuesRepresents the
PreflightMultipleAllowOriginValuesprotocol value. -
CorsErrorPreflightInvalidAllowOriginValueRepresents the
PreflightInvalidAllowOriginValueprotocol value. -
CorsErrorPreflightAllowOriginMismatchRepresents the
PreflightAllowOriginMismatchprotocol value. -
CorsErrorPreflightInvalidAllowCredentialsRepresents the
PreflightInvalidAllowCredentialsprotocol value. -
CorsErrorPreflightMissingAllowExternalRepresents the
PreflightMissingAllowExternalprotocol value. -
CorsErrorPreflightInvalidAllowExternalRepresents the
PreflightInvalidAllowExternalprotocol value. -
CorsErrorPreflightMissingAllowPrivateNetworkRepresents the
PreflightMissingAllowPrivateNetworkprotocol value. -
CorsErrorPreflightInvalidAllowPrivateNetworkRepresents the
PreflightInvalidAllowPrivateNetworkprotocol value. -
CorsErrorInvalidAllowMethodsPreflightResponseRepresents the
InvalidAllowMethodsPreflightResponseprotocol value. -
CorsErrorInvalidAllowHeadersPreflightResponseRepresents the
InvalidAllowHeadersPreflightResponseprotocol value. -
CorsErrorMethodDisallowedByPreflightResponseRepresents the
MethodDisallowedByPreflightResponseprotocol value. -
CorsErrorHeaderDisallowedByPreflightResponseRepresents the
HeaderDisallowedByPreflightResponseprotocol value. -
CorsErrorRedirectContainsCredentialsRepresents the
RedirectContainsCredentialsprotocol value. -
CorsErrorInsecurePrivateNetworkRepresents the
InsecurePrivateNetworkprotocol value. -
CorsErrorInvalidPrivateNetworkAccessRepresents the
InvalidPrivateNetworkAccessprotocol value. -
CorsErrorUnexpectedPrivateNetworkAccessRepresents the
UnexpectedPrivateNetworkAccessprotocol value. -
CorsErrorNoCorsRedirectModeNotFollowRepresents the
NoCorsRedirectModeNotFollowprotocol value. -
CorsErrorPreflightMissingPrivateNetworkAccessIdRepresents the
PreflightMissingPrivateNetworkAccessIdprotocol value. -
CorsErrorPreflightMissingPrivateNetworkAccessNameRepresents the
PreflightMissingPrivateNetworkAccessNameprotocol value. -
CorsErrorPrivateNetworkAccessPermissionUnavailableRepresents the
PrivateNetworkAccessPermissionUnavailableprotocol value. -
CorsErrorPrivateNetworkAccessPermissionDeniedRepresents the
PrivateNetworkAccessPermissionDeniedprotocol value.
Network level fetch failure reason.
pub type ErrorReason {
ErrorReasonFailed
ErrorReasonAborted
ErrorReasonTimedOut
ErrorReasonAccessDenied
ErrorReasonConnectionClosed
ErrorReasonConnectionReset
ErrorReasonConnectionRefused
ErrorReasonConnectionAborted
ErrorReasonConnectionFailed
ErrorReasonNameNotResolved
ErrorReasonInternetDisconnected
ErrorReasonAddressUnreachable
ErrorReasonBlockedByClient
ErrorReasonBlockedByResponse
}
Constructors
-
ErrorReasonFailedRepresents the
Failedprotocol value. -
ErrorReasonAbortedRepresents the
Abortedprotocol value. -
ErrorReasonTimedOutRepresents the
TimedOutprotocol value. -
ErrorReasonAccessDeniedRepresents the
AccessDeniedprotocol value. -
ErrorReasonConnectionClosedRepresents the
ConnectionClosedprotocol value. -
ErrorReasonConnectionResetRepresents the
ConnectionResetprotocol value. -
ErrorReasonConnectionRefusedRepresents the
ConnectionRefusedprotocol value. -
ErrorReasonConnectionAbortedRepresents the
ConnectionAbortedprotocol value. -
ErrorReasonConnectionFailedRepresents the
ConnectionFailedprotocol value. -
ErrorReasonNameNotResolvedRepresents the
NameNotResolvedprotocol value. -
ErrorReasonInternetDisconnectedRepresents the
InternetDisconnectedprotocol value. -
ErrorReasonAddressUnreachableRepresents the
AddressUnreachableprotocol value. -
ErrorReasonBlockedByClientRepresents the
BlockedByClientprotocol value. -
ErrorReasonBlockedByResponseRepresents the
BlockedByResponseprotocol value.
This type is not part of the protocol spec, it has been generated dynamically
to represent the response to the command get_cookies
pub type GetCookiesResponse {
GetCookiesResponse(cookies: List(Cookie))
}
Constructors
-
GetCookiesResponse(cookies: List(Cookie))Represents the GetCookiesResponse protocol value.
Arguments
- cookies
-
Array of cookie objects.
This type is not part of the protocol spec, it has been generated dynamically
to represent the response to the command get_request_post_data
pub type GetRequestPostDataResponse {
GetRequestPostDataResponse(post_data: String)
}
Constructors
-
GetRequestPostDataResponse(post_data: String)Represents the GetRequestPostDataResponse protocol value.
Arguments
- post_data
-
Request body string, omitting files from multipart requests
This type is not part of the protocol spec, it has been generated dynamically
to represent the response to the command get_response_body
pub type GetResponseBodyResponse {
GetResponseBodyResponse(
body: String,
base64_encoded: protocol_support.BooleanSetting,
)
}
Constructors
-
GetResponseBodyResponse( body: String, base64_encoded: protocol_support.BooleanSetting, )Represents the GetResponseBodyResponse protocol value.
Arguments
- body
-
Response body.
- base64_encoded
-
True, if content was sent as base64.
Information about the request initiator.
pub type Initiator {
Initiator(
type_: InitiatorType,
stack: option.Option(runtime.StackTrace),
url: option.Option(String),
line_number: option.Option(Float),
column_number: option.Option(Float),
request_id: option.Option(RequestId),
)
}
Constructors
-
Initiator( type_: InitiatorType, stack: option.Option(runtime.StackTrace), url: option.Option(String), line_number: option.Option(Float), column_number: option.Option(Float), request_id: option.Option(RequestId), )Represents the Initiator protocol value.
Arguments
- type_
-
Type of this initiator.
- stack
-
Initiator JavaScript stack trace, set for Script only.
- url
-
Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
- line_number
-
Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
- column_number
-
Initiator column number, set for Parser type or for Script type (when script is importing module) (0-based).
- request_id
-
Set if another request triggered this request (e.g. preflight).
This type is not part of the protocol spec, it has been generated dynamically
to represent the possible values of the enum property type of Initiator
pub type InitiatorType {
InitiatorTypeParser
InitiatorTypeScript
InitiatorTypePreload
InitiatorTypeSignedExchange
InitiatorTypePreflight
InitiatorTypeOther
}
Constructors
-
InitiatorTypeParserRepresents the
parserprotocol value. -
InitiatorTypeScriptRepresents the
scriptprotocol value. -
InitiatorTypePreloadRepresents the
preloadprotocol value. -
InitiatorTypeSignedExchangeRepresents the
SignedExchangeprotocol value. -
InitiatorTypePreflightRepresents the
preflightprotocol value. -
InitiatorTypeOtherRepresents the
otherprotocol value.
Unique intercepted request identifier.
pub type InterceptionId {
InterceptionId(String)
}
Constructors
-
InterceptionId(String)Represents the InterceptionId protocol value.
Unique loader identifier.
pub type LoaderId {
LoaderId(String)
}
Constructors
-
LoaderId(String)Represents the LoaderId protocol value.
Monotonically increasing time in seconds since an arbitrary point in the past.
pub type MonotonicTime {
MonotonicTime(Float)
}
Constructors
-
MonotonicTime(Float)Represents the MonotonicTime protocol value.
Post data entry for HTTP request
pub type PostDataEntry {
PostDataEntry(bytes: option.Option(String))
}
Constructors
-
PostDataEntry(bytes: option.Option(String))Represents the PostDataEntry protocol value.
HTTP request data.
pub type Request {
Request(
url: String,
url_fragment: option.Option(String),
method: String,
headers: Headers,
has_post_data: option.Option(protocol_support.BooleanSetting),
mixed_content_type: option.Option(security.MixedContentType),
initial_priority: ResourcePriority,
referrer_policy: RequestReferrerPolicy,
is_link_preload: option.Option(
protocol_support.BooleanSetting,
),
)
}
Constructors
-
Request( url: String, url_fragment: option.Option(String), method: String, headers: Headers, has_post_data: option.Option(protocol_support.BooleanSetting), mixed_content_type: option.Option(security.MixedContentType), initial_priority: ResourcePriority, referrer_policy: RequestReferrerPolicy, is_link_preload: option.Option(protocol_support.BooleanSetting), )Represents the Request protocol value.
Arguments
- url
-
Request URL (without fragment).
- url_fragment
-
Fragment of the requested URL starting with hash, if present.
- method
-
HTTP request method.
- headers
-
HTTP request headers.
- has_post_data
-
True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
- mixed_content_type
-
The mixed content type of the request.
- initial_priority
-
Priority of the resource request at the time request is sent.
- referrer_policy
-
The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
- is_link_preload
-
Whether is loaded via link preload.
Unique request identifier.
pub type RequestId {
RequestId(String)
}
Constructors
-
RequestId(String)Represents the RequestId protocol value.
This type is not part of the protocol spec, it has been generated dynamically
to represent the possible values of the enum property referrerPolicy of Request
pub type RequestReferrerPolicy {
RequestReferrerPolicyUnsafeUrl
RequestReferrerPolicyNoReferrerWhenDowngrade
RequestReferrerPolicyNoReferrer
RequestReferrerPolicyOrigin
RequestReferrerPolicyOriginWhenCrossOrigin
RequestReferrerPolicySameOrigin
RequestReferrerPolicyStrictOrigin
RequestReferrerPolicyStrictOriginWhenCrossOrigin
}
Constructors
-
RequestReferrerPolicyUnsafeUrlRepresents the
unsafe-urlprotocol value. -
RequestReferrerPolicyNoReferrerWhenDowngradeRepresents the
no-referrer-when-downgradeprotocol value. -
RequestReferrerPolicyNoReferrerRepresents the
no-referrerprotocol value. -
RequestReferrerPolicyOriginRepresents the
originprotocol value. -
RequestReferrerPolicyOriginWhenCrossOriginRepresents the
origin-when-cross-originprotocol value. -
RequestReferrerPolicySameOriginRepresents the
same-originprotocol value. -
RequestReferrerPolicyStrictOriginRepresents the
strict-originprotocol value. -
RequestReferrerPolicyStrictOriginWhenCrossOriginRepresents the
strict-origin-when-cross-originprotocol value.
Loading priority of a resource request.
pub type ResourcePriority {
ResourcePriorityVeryLow
ResourcePriorityLow
ResourcePriorityMedium
ResourcePriorityHigh
ResourcePriorityVeryHigh
}
Constructors
-
ResourcePriorityVeryLowRepresents the
VeryLowprotocol value. -
ResourcePriorityLowRepresents the
Lowprotocol value. -
ResourcePriorityMediumRepresents the
Mediumprotocol value. -
ResourcePriorityHighRepresents the
Highprotocol value. -
ResourcePriorityVeryHighRepresents the
VeryHighprotocol value.
Timing information for the request.
pub type ResourceTiming {
ResourceTiming(
request_time: Float,
proxy_start: Float,
proxy_end: Float,
dns_start: Float,
dns_end: Float,
connect_start: Float,
connect_end: Float,
ssl_start: Float,
ssl_end: Float,
send_start: Float,
send_end: Float,
receive_headers_end: Float,
)
}
Constructors
-
ResourceTiming( request_time: Float, proxy_start: Float, proxy_end: Float, dns_start: Float, dns_end: Float, connect_start: Float, connect_end: Float, ssl_start: Float, ssl_end: Float, send_start: Float, send_end: Float, receive_headers_end: Float, )Represents the ResourceTiming protocol value.
Arguments
- request_time
-
Timing’s requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime.
- proxy_start
-
Started resolving proxy.
- proxy_end
-
Finished resolving proxy.
- dns_start
-
Started DNS address resolve.
- dns_end
-
Finished DNS address resolve.
- connect_start
-
Started connecting to the remote host.
- connect_end
-
Connected to the remote host.
- ssl_start
-
Started SSL handshake.
- ssl_end
-
Finished SSL handshake.
- send_start
-
Started sending request.
- send_end
-
Finished sending request.
- receive_headers_end
-
Finished receiving response headers.
Resource type as it was perceived by the rendering engine.
pub type ResourceType {
ResourceTypeDocument
ResourceTypeStylesheet
ResourceTypeImage
ResourceTypeMedia
ResourceTypeFont
ResourceTypeScript
ResourceTypeTextTrack
ResourceTypeXhr
ResourceTypeFetch
ResourceTypePrefetch
ResourceTypeEventSource
ResourceTypeWebSocket
ResourceTypeManifest
ResourceTypeSignedExchange
ResourceTypePing
ResourceTypeCspViolationReport
ResourceTypePreflight
ResourceTypeOther
}
Constructors
-
ResourceTypeDocumentRepresents the
Documentprotocol value. -
ResourceTypeStylesheetRepresents the
Stylesheetprotocol value. -
ResourceTypeImageRepresents the
Imageprotocol value. -
ResourceTypeMediaRepresents the
Mediaprotocol value. -
ResourceTypeFontRepresents the
Fontprotocol value. -
ResourceTypeScriptRepresents the
Scriptprotocol value. -
ResourceTypeTextTrackRepresents the
TextTrackprotocol value. -
ResourceTypeXhrRepresents the
XHRprotocol value. -
ResourceTypeFetchRepresents the
Fetchprotocol value. -
ResourceTypePrefetchRepresents the
Prefetchprotocol value. -
ResourceTypeEventSourceRepresents the
EventSourceprotocol value. -
ResourceTypeWebSocketRepresents the
WebSocketprotocol value. -
ResourceTypeManifestRepresents the
Manifestprotocol value. -
ResourceTypeSignedExchangeRepresents the
SignedExchangeprotocol value. -
ResourceTypePingRepresents the
Pingprotocol value. -
ResourceTypeCspViolationReportRepresents the
CSPViolationReportprotocol value. -
ResourceTypePreflightRepresents the
Preflightprotocol value. -
ResourceTypeOtherRepresents the
Otherprotocol value.
HTTP response data.
pub type Response {
Response(
url: String,
status: Int,
status_text: String,
headers: Headers,
mime_type: String,
charset: String,
request_headers: option.Option(Headers),
connection_reused: protocol_support.BooleanSetting,
connection_id: Float,
remote_ip_address: option.Option(String),
remote_port: option.Option(Int),
from_disk_cache: option.Option(
protocol_support.BooleanSetting,
),
from_service_worker: option.Option(
protocol_support.BooleanSetting,
),
from_prefetch_cache: option.Option(
protocol_support.BooleanSetting,
),
from_early_hints: option.Option(
protocol_support.BooleanSetting,
),
encoded_data_length: Float,
timing: option.Option(ResourceTiming),
service_worker_response_source: option.Option(
ServiceWorkerResponseSource,
),
response_time: option.Option(TimeSinceEpoch),
cache_storage_cache_name: option.Option(String),
protocol: option.Option(String),
security_state: security.SecurityState,
security_details: option.Option(SecurityDetails),
)
}
Constructors
-
Response( url: String, status: Int, status_text: String, headers: Headers, mime_type: String, charset: String, request_headers: option.Option(Headers), connection_reused: protocol_support.BooleanSetting, connection_id: Float, remote_ip_address: option.Option(String), remote_port: option.Option(Int), from_disk_cache: option.Option(protocol_support.BooleanSetting), from_service_worker: option.Option( protocol_support.BooleanSetting, ), from_prefetch_cache: option.Option( protocol_support.BooleanSetting, ), from_early_hints: option.Option(protocol_support.BooleanSetting), encoded_data_length: Float, timing: option.Option(ResourceTiming), service_worker_response_source: option.Option( ServiceWorkerResponseSource, ), response_time: option.Option(TimeSinceEpoch), cache_storage_cache_name: option.Option(String), protocol: option.Option(String), security_state: security.SecurityState, security_details: option.Option(SecurityDetails), )Represents the Response protocol value.
Arguments
- url
-
Response URL. This URL can be different from CachedResource.url in case of redirect.
- status
-
HTTP response status code.
- status_text
-
HTTP response status text.
- headers
-
HTTP response headers.
- mime_type
-
Resource mimeType as determined by the browser.
- charset
-
Resource charset as determined by the browser (if applicable).
- request_headers
-
Refined HTTP request headers that were actually transmitted over the network.
- connection_reused
-
Specifies whether physical connection was actually reused for this request.
- connection_id
-
Physical connection id that was actually used for this request.
- remote_ip_address
-
Remote IP address.
- remote_port
-
Remote port.
- from_disk_cache
-
Specifies that the request was served from the disk cache.
- from_service_worker
-
Specifies that the request was served from the ServiceWorker.
- from_prefetch_cache
-
Specifies that the request was served from the prefetch cache.
- from_early_hints
-
Specifies that the request was served from the prefetch cache.
- encoded_data_length
-
Total number of bytes received for this request so far.
- timing
-
Timing information for the given request.
- service_worker_response_source
-
Response source of response from ServiceWorker.
- response_time
-
The time at which the returned response was generated.
- cache_storage_cache_name
-
Cache Storage Cache Name.
- protocol
-
Protocol used to fetch this request.
- security_state
-
Security state of the request resource.
- security_details
-
Security details for the request.
Security details about a request.
pub type SecurityDetails {
SecurityDetails(
protocol: String,
key_exchange: String,
key_exchange_group: option.Option(String),
cipher: String,
mac: option.Option(String),
certificate_id: security.CertificateId,
subject_name: String,
san_list: List(String),
issuer: String,
valid_from: TimeSinceEpoch,
valid_to: TimeSinceEpoch,
signed_certificate_timestamp_list: List(
SignedCertificateTimestamp,
),
certificate_transparency_compliance: CertificateTransparencyCompliance,
server_signature_algorithm: option.Option(Int),
encrypted_client_hello: protocol_support.BooleanSetting,
)
}
Constructors
-
SecurityDetails( protocol: String, key_exchange: String, key_exchange_group: option.Option(String), cipher: String, mac: option.Option(String), certificate_id: security.CertificateId, subject_name: String, san_list: List(String), issuer: String, valid_from: TimeSinceEpoch, valid_to: TimeSinceEpoch, signed_certificate_timestamp_list: List( SignedCertificateTimestamp, ), certificate_transparency_compliance: CertificateTransparencyCompliance, server_signature_algorithm: option.Option(Int), encrypted_client_hello: protocol_support.BooleanSetting, )Represents the SecurityDetails protocol value.
Arguments
- protocol
-
Protocol name (e.g. “TLS 1.2” or “QUIC”).
- key_exchange
-
Key Exchange used by the connection, or the empty string if not applicable.
- key_exchange_group
-
(EC)DH group used by the connection, if applicable.
- cipher
-
Cipher name.
- mac
-
TLS MAC. Note that AEAD ciphers do not have separate MACs.
- certificate_id
-
Certificate ID value.
- subject_name
-
Certificate subject name.
- san_list
-
Subject Alternative Name (SAN) DNS names and IP addresses.
- issuer
-
Name of the issuing CA.
- valid_from
-
Certificate valid from date.
- valid_to
-
Certificate valid to (expiration) date
- signed_certificate_timestamp_list
-
List of signed certificate timestamps (SCTs).
- certificate_transparency_compliance
-
Whether the request complied with Certificate Transparency policy
- server_signature_algorithm
-
The signature algorithm used by the server in the TLS server signature, represented as a TLS SignatureScheme code point. Omitted if not applicable or not known.
- encrypted_client_hello
-
Whether the connection used Encrypted ClientHello
Source of serviceworker response.
pub type ServiceWorkerResponseSource {
ServiceWorkerResponseSourceCacheStorage
ServiceWorkerResponseSourceHttpCache
ServiceWorkerResponseSourceFallbackCode
ServiceWorkerResponseSourceNetwork
}
Constructors
-
ServiceWorkerResponseSourceCacheStorageRepresents the
cache-storageprotocol value. -
ServiceWorkerResponseSourceHttpCacheRepresents the
http-cacheprotocol value. -
ServiceWorkerResponseSourceFallbackCodeRepresents the
fallback-codeprotocol value. -
ServiceWorkerResponseSourceNetworkRepresents the
networkprotocol value.
Source of service worker router.
pub type ServiceWorkerRouterSource {
ServiceWorkerRouterSourceNetwork
ServiceWorkerRouterSourceCache
ServiceWorkerRouterSourceFetchEvent
ServiceWorkerRouterSourceRaceNetworkAndFetchHandler
}
Constructors
-
ServiceWorkerRouterSourceNetworkRepresents the
networkprotocol value. -
ServiceWorkerRouterSourceCacheRepresents the
cacheprotocol value. -
ServiceWorkerRouterSourceFetchEventRepresents the
fetch-eventprotocol value. -
ServiceWorkerRouterSourceRaceNetworkAndFetchHandlerRepresents the
race-network-and-fetch-handlerprotocol value.
Details of a signed certificate timestamp (SCT).
pub type SignedCertificateTimestamp {
SignedCertificateTimestamp(
status: String,
origin: String,
log_description: String,
log_id: String,
timestamp: Float,
hash_algorithm: String,
signature_algorithm: String,
signature_data: String,
)
}
Constructors
-
SignedCertificateTimestamp( status: String, origin: String, log_description: String, log_id: String, timestamp: Float, hash_algorithm: String, signature_algorithm: String, signature_data: String, )Represents the SignedCertificateTimestamp protocol value.
Arguments
- status
-
Validation status.
- origin
-
Origin.
- log_description
-
Log name / description.
- log_id
-
Log ID.
- timestamp
-
Issuance date. Unlike TimeSinceEpoch, this contains the number of milliseconds since January 1, 1970, UTC, not the number of seconds.
- hash_algorithm
-
Hash algorithm.
- signature_algorithm
-
Signature algorithm.
- signature_data
-
Signature data.
UTC time in seconds, counted from January 1, 1970.
pub type TimeSinceEpoch {
TimeSinceEpoch(Float)
}
Constructors
-
TimeSinceEpoch(Float)Represents the TimeSinceEpoch protocol value.
WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.
pub type WebSocketFrame {
WebSocketFrame(
opcode: Float,
mask: protocol_support.BooleanSetting,
payload_data: String,
)
}
Constructors
-
WebSocketFrame( opcode: Float, mask: protocol_support.BooleanSetting, payload_data: String, )Represents the WebSocketFrame protocol value.
Arguments
- opcode
-
WebSocket message opcode.
- mask
-
WebSocket message mask.
- payload_data
-
WebSocket message payload data. If the opcode is 1, this is a text message and payloadData is a UTF-8 string. If the opcode isn’t 1, then payloadData is a base64 encoded string representing binary data.
WebSocket response data.
pub type WebSocketResponse {
WebSocketResponse(
status: Int,
status_text: String,
headers: Headers,
headers_text: option.Option(String),
request_headers: option.Option(Headers),
request_headers_text: option.Option(String),
)
}
Constructors
-
WebSocketResponse( status: Int, status_text: String, headers: Headers, headers_text: option.Option(String), request_headers: option.Option(Headers), request_headers_text: option.Option(String), )Represents the WebSocketResponse protocol value.
Arguments
- status
-
HTTP response status code.
- status_text
-
HTTP response status text.
- headers
-
HTTP response headers.
- headers_text
-
HTTP response headers text.
- request_headers
-
HTTP request headers.
- request_headers_text
-
HTTP request headers text.
Values
pub fn clear_browser_cache(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Clears browser cache.
pub fn clear_browser_cookies(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Clears browser cookies.
pub fn delete_cookies(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
name name: String,
url url: option.Option(String),
domain domain: option.Option(String),
path path: option.Option(String),
partition_key partition_key: option.Option(String),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Deletes browser cookies with matching name and url or domain/path/partitionKey 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.domain: If specified, deletes only cookies with the exact domain.path: If specified, deletes only cookies with the exact path.partition_key: If specified, deletes only cookies with the the given name and partitionKey where domain matches provided URL.
Returns:
pub fn disable(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Disables network tracking, prevents network events from being sent to the client.
pub fn emulate_network_conditions(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
offline offline: protocol_support.BooleanSetting,
latency latency: Float,
download_throughput download_throughput: Float,
upload_throughput upload_throughput: Float,
connection_type connection_type: option.Option(ConnectionType),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Activates emulation of network conditions.
Parameters:
offline: True to emulate internet disconnection.latency: Minimum latency from request sent to response headers received (ms).download_throughput: Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.upload_throughput: Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.connection_type: Connection type if known.
Returns:
pub fn enable(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
max_post_data_size max_post_data_size: option.Option(Int),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Enables network tracking, network events will now be delivered to the client.
Parameters:
max_post_data_size: Longest post body size (in bytes) that would be included in requestWillBeSent notification
Returns:
pub fn get_cookies(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
urls urls: option.Option(List(String)),
) -> Result(GetCookiesResponse, chrome.RequestError)
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.
Returns:
cookies: Array of cookie objects.
pub fn get_request_post_data(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
request_id request_id: RequestId,
) -> Result(GetRequestPostDataResponse, chrome.RequestError)
Returns post data sent with the request. Returns an error when no data was sent with the request.
Parameters:
request_id: Identifier of the network request to get content for.
Returns:
post_data: Request body string, omitting files from multipart requests
pub fn get_response_body(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
request_id request_id: RequestId,
) -> Result(GetResponseBodyResponse, chrome.RequestError)
Returns content served for the given request.
Parameters:
request_id: Identifier of the network request to get content for.
Returns:
body: Response body.base64_encoded: True, if content was sent as base64.
pub fn set_bypass_service_worker(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
bypass bypass: protocol_support.BooleanSetting,
) -> Result(dynamic.Dynamic, chrome.RequestError)
Toggles ignoring of service worker for each request.
Parameters:
bypass: Bypass service worker and load from network.
Returns:
pub fn set_cache_disabled(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
cache_disabled cache_disabled: protocol_support.BooleanSetting,
) -> Result(dynamic.Dynamic, chrome.RequestError)
Toggles ignoring cache for each request. If true, cache will not be used.
Parameters:
cache_disabled: Cache disabled state.
Returns:
pub fn set_cookie(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
name name: String,
value value: String,
url url: option.Option(String),
domain domain: option.Option(String),
path path: option.Option(String),
secure secure: option.Option(protocol_support.BooleanSetting),
http_only http_only: option.Option(
protocol_support.BooleanSetting,
),
same_site same_site: option.Option(CookieSameSite),
expires expires: option.Option(TimeSinceEpoch),
) -> Result(dynamic.Dynamic, chrome.RequestError)
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.domain: Cookie domain.path: Cookie path.secure: True if cookie is secure.http_only: True if cookie is http-only.same_site: Cookie SameSite type.expires: Cookie expiration date, session cookie if not set
Returns:
pub fn set_cookies(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
cookies cookies: List(CookieParam),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Sets given cookies.
Parameters:
cookies: Cookies to be set.
Returns:
pub fn set_extra_http_headers(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
headers headers: Headers,
) -> Result(dynamic.Dynamic, chrome.RequestError)
Specifies whether to always send extra HTTP headers with the requests from this page.
Parameters:
headers: Map with extra HTTP headers.
Returns:
pub fn set_user_agent_override(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
user_agent user_agent: String,
accept_language accept_language: option.Option(String),
platform platform: option.Option(String),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Allows overriding user agent with the given string.
Parameters:
user_agent: User agent to use.accept_language: Browser language to emulate.platform: The platform navigator.platform should return.
Returns: