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

  • BlockedReasonOther

    Represents the other protocol value.

  • BlockedReasonCsp

    Represents the csp protocol value.

  • BlockedReasonMixedContent

    Represents the mixed-content protocol value.

  • BlockedReasonOrigin

    Represents the origin protocol value.

  • BlockedReasonInspector

    Represents the inspector protocol value.

  • BlockedReasonSubresourceFilter

    Represents the subresource-filter protocol value.

  • BlockedReasonContentType

    Represents the content-type protocol value.

  • BlockedReasonCoepFrameResourceNeedsCoepHeader

    Represents the coep-frame-resource-needs-coep-header protocol value.

  • BlockedReasonCoopSandboxedIframeCannotNavigateToCoopPage

    Represents the coop-sandboxed-iframe-cannot-navigate-to-coop-page protocol value.

  • BlockedReasonCorpNotSameOrigin

    Represents the corp-not-same-origin protocol value.

  • BlockedReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoep

    Represents the corp-not-same-origin-after-defaulted-to-same-origin-by-coep protocol value.

  • BlockedReasonCorpNotSameSite

    Represents the corp-not-same-site protocol 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

  • CertificateTransparencyComplianceUnknown

    Represents the unknown protocol value.

  • CertificateTransparencyComplianceNotCompliant

    Represents the not-compliant protocol value.

  • CertificateTransparencyComplianceCompliant

    Represents the compliant protocol value.

The underlying connection technology that the browser is supposedly using.

pub type ConnectionType {
  ConnectionTypeNone
  ConnectionTypeCellular2g
  ConnectionTypeCellular3g
  ConnectionTypeCellular4g
  ConnectionTypeBluetooth
  ConnectionTypeEthernet
  ConnectionTypeWifi
  ConnectionTypeWimax
  ConnectionTypeOther
}

Constructors

  • ConnectionTypeNone

    Represents the none protocol value.

  • ConnectionTypeCellular2g

    Represents the cellular2g protocol value.

  • ConnectionTypeCellular3g

    Represents the cellular3g protocol value.

  • ConnectionTypeCellular4g

    Represents the cellular4g protocol value.

  • ConnectionTypeBluetooth

    Represents the bluetooth protocol value.

  • ConnectionTypeEthernet

    Represents the ethernet protocol value.

  • ConnectionTypeWifi

    Represents the wifi protocol value.

  • ConnectionTypeWimax

    Represents the wimax protocol value.

  • ConnectionTypeOther

    Represents the other protocol 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

Represents the cookie’s ‘SameSite’ status: https://tools.ietf.org/html/draft-west-first-party-cookies

pub type CookieSameSite {
  CookieSameSiteStrict
  CookieSameSiteLax
  CookieSameSiteNone
}

Constructors

  • CookieSameSiteStrict

    Represents the Strict protocol value.

  • CookieSameSiteLax

    Represents the Lax protocol value.

  • CookieSameSiteNone

    Represents the None protocol 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

  • CorsErrorDisallowedByMode

    Represents the DisallowedByMode protocol value.

  • CorsErrorInvalidResponse

    Represents the InvalidResponse protocol value.

  • CorsErrorWildcardOriginNotAllowed

    Represents the WildcardOriginNotAllowed protocol value.

  • CorsErrorMissingAllowOriginHeader

    Represents the MissingAllowOriginHeader protocol value.

  • CorsErrorMultipleAllowOriginValues

    Represents the MultipleAllowOriginValues protocol value.

  • CorsErrorInvalidAllowOriginValue

    Represents the InvalidAllowOriginValue protocol value.

  • CorsErrorAllowOriginMismatch

    Represents the AllowOriginMismatch protocol value.

  • CorsErrorInvalidAllowCredentials

    Represents the InvalidAllowCredentials protocol value.

  • CorsErrorCorsDisabledScheme

    Represents the CorsDisabledScheme protocol value.

  • CorsErrorPreflightInvalidStatus

    Represents the PreflightInvalidStatus protocol value.

  • CorsErrorPreflightDisallowedRedirect

    Represents the PreflightDisallowedRedirect protocol value.

  • CorsErrorPreflightWildcardOriginNotAllowed

    Represents the PreflightWildcardOriginNotAllowed protocol value.

  • CorsErrorPreflightMissingAllowOriginHeader

    Represents the PreflightMissingAllowOriginHeader protocol value.

  • CorsErrorPreflightMultipleAllowOriginValues

    Represents the PreflightMultipleAllowOriginValues protocol value.

  • CorsErrorPreflightInvalidAllowOriginValue

    Represents the PreflightInvalidAllowOriginValue protocol value.

  • CorsErrorPreflightAllowOriginMismatch

    Represents the PreflightAllowOriginMismatch protocol value.

  • CorsErrorPreflightInvalidAllowCredentials

    Represents the PreflightInvalidAllowCredentials protocol value.

  • CorsErrorPreflightMissingAllowExternal

    Represents the PreflightMissingAllowExternal protocol value.

  • CorsErrorPreflightInvalidAllowExternal

    Represents the PreflightInvalidAllowExternal protocol value.

  • CorsErrorPreflightMissingAllowPrivateNetwork

    Represents the PreflightMissingAllowPrivateNetwork protocol value.

  • CorsErrorPreflightInvalidAllowPrivateNetwork

    Represents the PreflightInvalidAllowPrivateNetwork protocol value.

  • CorsErrorInvalidAllowMethodsPreflightResponse

    Represents the InvalidAllowMethodsPreflightResponse protocol value.

  • CorsErrorInvalidAllowHeadersPreflightResponse

    Represents the InvalidAllowHeadersPreflightResponse protocol value.

  • CorsErrorMethodDisallowedByPreflightResponse

    Represents the MethodDisallowedByPreflightResponse protocol value.

  • CorsErrorHeaderDisallowedByPreflightResponse

    Represents the HeaderDisallowedByPreflightResponse protocol value.

  • CorsErrorRedirectContainsCredentials

    Represents the RedirectContainsCredentials protocol value.

  • CorsErrorInsecurePrivateNetwork

    Represents the InsecurePrivateNetwork protocol value.

  • CorsErrorInvalidPrivateNetworkAccess

    Represents the InvalidPrivateNetworkAccess protocol value.

  • CorsErrorUnexpectedPrivateNetworkAccess

    Represents the UnexpectedPrivateNetworkAccess protocol value.

  • CorsErrorNoCorsRedirectModeNotFollow

    Represents the NoCorsRedirectModeNotFollow protocol value.

  • CorsErrorPreflightMissingPrivateNetworkAccessId

    Represents the PreflightMissingPrivateNetworkAccessId protocol value.

  • CorsErrorPreflightMissingPrivateNetworkAccessName

    Represents the PreflightMissingPrivateNetworkAccessName protocol value.

  • CorsErrorPrivateNetworkAccessPermissionUnavailable

    Represents the PrivateNetworkAccessPermissionUnavailable protocol value.

  • CorsErrorPrivateNetworkAccessPermissionDenied

    Represents the PrivateNetworkAccessPermissionDenied protocol value.

Represents the Chrome DevTools Protocol CorsErrorStatus value.

pub type CorsErrorStatus {
  CorsErrorStatus(
    cors_error: CorsError,
    failed_parameter: String,
  )
}

Constructors

  • CorsErrorStatus(cors_error: CorsError, failed_parameter: String)

    Represents the CorsErrorStatus protocol value.

Network level fetch failure reason.

pub type ErrorReason {
  ErrorReasonFailed
  ErrorReasonAborted
  ErrorReasonTimedOut
  ErrorReasonAccessDenied
  ErrorReasonConnectionClosed
  ErrorReasonConnectionReset
  ErrorReasonConnectionRefused
  ErrorReasonConnectionAborted
  ErrorReasonConnectionFailed
  ErrorReasonNameNotResolved
  ErrorReasonInternetDisconnected
  ErrorReasonAddressUnreachable
  ErrorReasonBlockedByClient
  ErrorReasonBlockedByResponse
}

Constructors

  • ErrorReasonFailed

    Represents the Failed protocol value.

  • ErrorReasonAborted

    Represents the Aborted protocol value.

  • ErrorReasonTimedOut

    Represents the TimedOut protocol value.

  • ErrorReasonAccessDenied

    Represents the AccessDenied protocol value.

  • ErrorReasonConnectionClosed

    Represents the ConnectionClosed protocol value.

  • ErrorReasonConnectionReset

    Represents the ConnectionReset protocol value.

  • ErrorReasonConnectionRefused

    Represents the ConnectionRefused protocol value.

  • ErrorReasonConnectionAborted

    Represents the ConnectionAborted protocol value.

  • ErrorReasonConnectionFailed

    Represents the ConnectionFailed protocol value.

  • ErrorReasonNameNotResolved

    Represents the NameNotResolved protocol value.

  • ErrorReasonInternetDisconnected

    Represents the InternetDisconnected protocol value.

  • ErrorReasonAddressUnreachable

    Represents the AddressUnreachable protocol value.

  • ErrorReasonBlockedByClient

    Represents the BlockedByClient protocol value.

  • ErrorReasonBlockedByResponse

    Represents the BlockedByResponse protocol 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.

Request / response headers as keys / values of JSON object.

pub type Headers {
  Headers(dict.Dict(String, String))
}

Constructors

  • Headers(dict.Dict(String, String))

    Represents the Headers protocol value.

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

  • InitiatorTypeParser

    Represents the parser protocol value.

  • InitiatorTypeScript

    Represents the script protocol value.

  • InitiatorTypePreload

    Represents the preload protocol value.

  • InitiatorTypeSignedExchange

    Represents the SignedExchange protocol value.

  • InitiatorTypePreflight

    Represents the preflight protocol value.

  • InitiatorTypeOther

    Represents the other protocol 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

  • RequestReferrerPolicyUnsafeUrl

    Represents the unsafe-url protocol value.

  • RequestReferrerPolicyNoReferrerWhenDowngrade

    Represents the no-referrer-when-downgrade protocol value.

  • RequestReferrerPolicyNoReferrer

    Represents the no-referrer protocol value.

  • RequestReferrerPolicyOrigin

    Represents the origin protocol value.

  • RequestReferrerPolicyOriginWhenCrossOrigin

    Represents the origin-when-cross-origin protocol value.

  • RequestReferrerPolicySameOrigin

    Represents the same-origin protocol value.

  • RequestReferrerPolicyStrictOrigin

    Represents the strict-origin protocol value.

  • RequestReferrerPolicyStrictOriginWhenCrossOrigin

    Represents the strict-origin-when-cross-origin protocol value.

Loading priority of a resource request.

pub type ResourcePriority {
  ResourcePriorityVeryLow
  ResourcePriorityLow
  ResourcePriorityMedium
  ResourcePriorityHigh
  ResourcePriorityVeryHigh
}

Constructors

  • ResourcePriorityVeryLow

    Represents the VeryLow protocol value.

  • ResourcePriorityLow

    Represents the Low protocol value.

  • ResourcePriorityMedium

    Represents the Medium protocol value.

  • ResourcePriorityHigh

    Represents the High protocol value.

  • ResourcePriorityVeryHigh

    Represents the VeryHigh protocol 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

  • ResourceTypeDocument

    Represents the Document protocol value.

  • ResourceTypeStylesheet

    Represents the Stylesheet protocol value.

  • ResourceTypeImage

    Represents the Image protocol value.

  • ResourceTypeMedia

    Represents the Media protocol value.

  • ResourceTypeFont

    Represents the Font protocol value.

  • ResourceTypeScript

    Represents the Script protocol value.

  • ResourceTypeTextTrack

    Represents the TextTrack protocol value.

  • ResourceTypeXhr

    Represents the XHR protocol value.

  • ResourceTypeFetch

    Represents the Fetch protocol value.

  • ResourceTypePrefetch

    Represents the Prefetch protocol value.

  • ResourceTypeEventSource

    Represents the EventSource protocol value.

  • ResourceTypeWebSocket

    Represents the WebSocket protocol value.

  • ResourceTypeManifest

    Represents the Manifest protocol value.

  • ResourceTypeSignedExchange

    Represents the SignedExchange protocol value.

  • ResourceTypePing

    Represents the Ping protocol value.

  • ResourceTypeCspViolationReport

    Represents the CSPViolationReport protocol value.

  • ResourceTypePreflight

    Represents the Preflight protocol value.

  • ResourceTypeOther

    Represents the Other protocol 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

  • ServiceWorkerResponseSourceCacheStorage

    Represents the cache-storage protocol value.

  • ServiceWorkerResponseSourceHttpCache

    Represents the http-cache protocol value.

  • ServiceWorkerResponseSourceFallbackCode

    Represents the fallback-code protocol value.

  • ServiceWorkerResponseSourceNetwork

    Represents the network protocol value.

Source of service worker router.

pub type ServiceWorkerRouterSource {
  ServiceWorkerRouterSourceNetwork
  ServiceWorkerRouterSourceCache
  ServiceWorkerRouterSourceFetchEvent
  ServiceWorkerRouterSourceRaceNetworkAndFetchHandler
}

Constructors

  • ServiceWorkerRouterSourceNetwork

    Represents the network protocol value.

  • ServiceWorkerRouterSourceCache

    Represents the cache protocol value.

  • ServiceWorkerRouterSourceFetchEvent

    Represents the fetch-event protocol value.

  • ServiceWorkerRouterSourceRaceNetworkAndFetchHandler

    Represents the race-network-and-fetch-handler protocol 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 request data.

pub type WebSocketRequest {
  WebSocketRequest(headers: Headers)
}

Constructors

  • WebSocketRequest(headers: Headers)

    Represents the WebSocketRequest protocol value.

    Arguments

    headers

    HTTP request headers.

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:

Search Document