Network#
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.
Types#
Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.
- class ResourceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Resource type as it was perceived by the rendering engine.
- DOCUMENT = 'Document'#
- STYLESHEET = 'Stylesheet'#
- IMAGE = 'Image'#
- MEDIA = 'Media'#
- FONT = 'Font'#
- SCRIPT = 'Script'#
- TEXT_TRACK = 'TextTrack'#
- XHR = 'XHR'#
- FETCH = 'Fetch'#
- PREFETCH = 'Prefetch'#
- EVENT_SOURCE = 'EventSource'#
- WEB_SOCKET = 'WebSocket'#
- MANIFEST = 'Manifest'#
- SIGNED_EXCHANGE = 'SignedExchange'#
- PING = 'Ping'#
- CSP_VIOLATION_REPORT = 'CSPViolationReport'#
- PREFLIGHT = 'Preflight'#
- OTHER = 'Other'#
- class ErrorReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Network level fetch failure reason.
- FAILED = 'Failed'#
- ABORTED = 'Aborted'#
- TIMED_OUT = 'TimedOut'#
- ACCESS_DENIED = 'AccessDenied'#
- CONNECTION_CLOSED = 'ConnectionClosed'#
- CONNECTION_RESET = 'ConnectionReset'#
- CONNECTION_REFUSED = 'ConnectionRefused'#
- CONNECTION_ABORTED = 'ConnectionAborted'#
- CONNECTION_FAILED = 'ConnectionFailed'#
- NAME_NOT_RESOLVED = 'NameNotResolved'#
- INTERNET_DISCONNECTED = 'InternetDisconnected'#
- ADDRESS_UNREACHABLE = 'AddressUnreachable'#
- BLOCKED_BY_CLIENT = 'BlockedByClient'#
- BLOCKED_BY_RESPONSE = 'BlockedByResponse'#
- class MonotonicTime(x=0, /)[source]#
Monotonically increasing time in seconds since an arbitrary point in the past.
- class ConnectionType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
The underlying connection technology that the browser is supposedly using.
- NONE = 'none'#
- CELLULAR2G = 'cellular2g'#
- CELLULAR3G = 'cellular3g'#
- CELLULAR4G = 'cellular4g'#
- BLUETOOTH = 'bluetooth'#
- ETHERNET = 'ethernet'#
- WIFI = 'wifi'#
- WIMAX = 'wimax'#
- OTHER = 'other'#
- class CookieSameSite(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Represents the cookie’s ‘SameSite’ status: https://tools.ietf.org/html/draft-west-first-party-cookies
- STRICT = 'Strict'#
- LAX = 'Lax'#
- NONE = 'None'#
- class CookiePriority(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Represents the cookie’s ‘Priority’ status: https://tools.ietf.org/html/draft-west-cookie-priority-00
- LOW = 'Low'#
- MEDIUM = 'Medium'#
- HIGH = 'High'#
- class CookieSourceScheme(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
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.
- UNSET = 'Unset'#
- NON_SECURE = 'NonSecure'#
- SECURE = 'Secure'#
- class ResourceTiming(request_time, proxy_start, proxy_end, dns_start, dns_end, connect_start, connect_end, ssl_start, ssl_end, worker_start, worker_ready, worker_fetch_start, worker_respond_with_settled, send_start, send_end, push_start, push_end, receive_headers_start, receive_headers_end, worker_router_evaluation_start=None, worker_cache_lookup_start=None)[source]#
Timing information for the request.
-
request_time:
float
# Timing’s requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime.
-
request_time:
- class ResourcePriority(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Loading priority of a resource request.
- VERY_LOW = 'VeryLow'#
- LOW = 'Low'#
- MEDIUM = 'Medium'#
- HIGH = 'High'#
- VERY_HIGH = 'VeryHigh'#
- class Request(url, method, headers, initial_priority, referrer_policy, url_fragment=None, post_data=None, has_post_data=None, post_data_entries=None, mixed_content_type=None, is_link_preload=None, trust_token_params=None, is_same_site=None)[source]#
HTTP request data.
-
initial_priority:
ResourcePriority
# Priority of the resource request at the time request is sent.
-
referrer_policy:
str
# //www.w3.org/TR/referrer-policy/
- Type:
The referrer policy of the request, as defined in https
-
has_post_data:
Optional
[bool
] = None# 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.
-
post_data_entries:
Optional
[List
[PostDataEntry
]] = None# Request body elements (post data broken into individual entries).
-
mixed_content_type:
Optional
[MixedContentType
] = None# The mixed content type of the request.
-
trust_token_params:
Optional
[TrustTokenParams
] = None# Set for requests when the TrustToken API is used. Contains the parameters passed by the developer (e.g. via “fetch”) as understood by the backend.
-
initial_priority:
- class SignedCertificateTimestamp(status, origin, log_description, log_id, timestamp, hash_algorithm, signature_algorithm, signature_data)[source]#
Details of a signed certificate timestamp (SCT).
- class SecurityDetails(protocol, key_exchange, cipher, certificate_id, subject_name, san_list, issuer, valid_from, valid_to, signed_certificate_timestamp_list, certificate_transparency_compliance, encrypted_client_hello, key_exchange_group=None, mac=None, server_signature_algorithm=None)[source]#
Security details about a request.
-
certificate_id:
CertificateId
# Certificate ID value.
-
valid_from:
TimeSinceEpoch
# Certificate valid from date.
-
valid_to:
TimeSinceEpoch
# Certificate valid to (expiration) date
-
signed_certificate_timestamp_list:
List
[SignedCertificateTimestamp
]# List of signed certificate timestamps (SCTs).
-
certificate_transparency_compliance:
CertificateTransparencyCompliance
# Whether the request complied with Certificate Transparency policy
-
certificate_id:
- class CertificateTransparencyCompliance(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Whether the request complied with Certificate Transparency policy.
- UNKNOWN = 'unknown'#
- NOT_COMPLIANT = 'not-compliant'#
- COMPLIANT = 'compliant'#
- class BlockedReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
The reason why request was blocked.
- OTHER = 'other'#
- CSP = 'csp'#
- MIXED_CONTENT = 'mixed-content'#
- ORIGIN = 'origin'#
- INSPECTOR = 'inspector'#
- SUBRESOURCE_FILTER = 'subresource-filter'#
- CONTENT_TYPE = 'content-type'#
- COEP_FRAME_RESOURCE_NEEDS_COEP_HEADER = 'coep-frame-resource-needs-coep-header'#
- COOP_SANDBOXED_IFRAME_CANNOT_NAVIGATE_TO_COOP_PAGE = 'coop-sandboxed-iframe-cannot-navigate-to-coop-page'#
- CORP_NOT_SAME_ORIGIN = 'corp-not-same-origin'#
- CORP_NOT_SAME_ORIGIN_AFTER_DEFAULTED_TO_SAME_ORIGIN_BY_COEP = 'corp-not-same-origin-after-defaulted-to-same-origin-by-coep'#
- CORP_NOT_SAME_ORIGIN_AFTER_DEFAULTED_TO_SAME_ORIGIN_BY_DIP = 'corp-not-same-origin-after-defaulted-to-same-origin-by-dip'#
- CORP_NOT_SAME_ORIGIN_AFTER_DEFAULTED_TO_SAME_ORIGIN_BY_COEP_AND_DIP = 'corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip'#
- CORP_NOT_SAME_SITE = 'corp-not-same-site'#
- class CorsError(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
The reason why request was blocked.
- DISALLOWED_BY_MODE = 'DisallowedByMode'#
- INVALID_RESPONSE = 'InvalidResponse'#
- WILDCARD_ORIGIN_NOT_ALLOWED = 'WildcardOriginNotAllowed'#
- MISSING_ALLOW_ORIGIN_HEADER = 'MissingAllowOriginHeader'#
- MULTIPLE_ALLOW_ORIGIN_VALUES = 'MultipleAllowOriginValues'#
- INVALID_ALLOW_ORIGIN_VALUE = 'InvalidAllowOriginValue'#
- ALLOW_ORIGIN_MISMATCH = 'AllowOriginMismatch'#
- INVALID_ALLOW_CREDENTIALS = 'InvalidAllowCredentials'#
- CORS_DISABLED_SCHEME = 'CorsDisabledScheme'#
- PREFLIGHT_INVALID_STATUS = 'PreflightInvalidStatus'#
- PREFLIGHT_DISALLOWED_REDIRECT = 'PreflightDisallowedRedirect'#
- PREFLIGHT_WILDCARD_ORIGIN_NOT_ALLOWED = 'PreflightWildcardOriginNotAllowed'#
- PREFLIGHT_MISSING_ALLOW_ORIGIN_HEADER = 'PreflightMissingAllowOriginHeader'#
- PREFLIGHT_MULTIPLE_ALLOW_ORIGIN_VALUES = 'PreflightMultipleAllowOriginValues'#
- PREFLIGHT_INVALID_ALLOW_ORIGIN_VALUE = 'PreflightInvalidAllowOriginValue'#
- PREFLIGHT_ALLOW_ORIGIN_MISMATCH = 'PreflightAllowOriginMismatch'#
- PREFLIGHT_INVALID_ALLOW_CREDENTIALS = 'PreflightInvalidAllowCredentials'#
- PREFLIGHT_MISSING_ALLOW_EXTERNAL = 'PreflightMissingAllowExternal'#
- PREFLIGHT_INVALID_ALLOW_EXTERNAL = 'PreflightInvalidAllowExternal'#
- PREFLIGHT_MISSING_ALLOW_PRIVATE_NETWORK = 'PreflightMissingAllowPrivateNetwork'#
- PREFLIGHT_INVALID_ALLOW_PRIVATE_NETWORK = 'PreflightInvalidAllowPrivateNetwork'#
- INVALID_ALLOW_METHODS_PREFLIGHT_RESPONSE = 'InvalidAllowMethodsPreflightResponse'#
- INVALID_ALLOW_HEADERS_PREFLIGHT_RESPONSE = 'InvalidAllowHeadersPreflightResponse'#
- METHOD_DISALLOWED_BY_PREFLIGHT_RESPONSE = 'MethodDisallowedByPreflightResponse'#
- HEADER_DISALLOWED_BY_PREFLIGHT_RESPONSE = 'HeaderDisallowedByPreflightResponse'#
- REDIRECT_CONTAINS_CREDENTIALS = 'RedirectContainsCredentials'#
- INSECURE_PRIVATE_NETWORK = 'InsecurePrivateNetwork'#
- INVALID_PRIVATE_NETWORK_ACCESS = 'InvalidPrivateNetworkAccess'#
- UNEXPECTED_PRIVATE_NETWORK_ACCESS = 'UnexpectedPrivateNetworkAccess'#
- NO_CORS_REDIRECT_MODE_NOT_FOLLOW = 'NoCorsRedirectModeNotFollow'#
- PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_ID = 'PreflightMissingPrivateNetworkAccessId'#
- PREFLIGHT_MISSING_PRIVATE_NETWORK_ACCESS_NAME = 'PreflightMissingPrivateNetworkAccessName'#
- PRIVATE_NETWORK_ACCESS_PERMISSION_UNAVAILABLE = 'PrivateNetworkAccessPermissionUnavailable'#
- PRIVATE_NETWORK_ACCESS_PERMISSION_DENIED = 'PrivateNetworkAccessPermissionDenied'#
- class ServiceWorkerResponseSource(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Source of serviceworker response.
- CACHE_STORAGE = 'cache-storage'#
- HTTP_CACHE = 'http-cache'#
- FALLBACK_CODE = 'fallback-code'#
- NETWORK = 'network'#
- class TrustTokenParams(operation, refresh_policy, issuers=None)[source]#
Determines what type of Trust Token operation is executed and depending on the type, some additional parameters. The values are specified in third_party/blink/renderer/core/fetch/trust_token.idl.
-
operation:
TrustTokenOperationType
#
-
operation:
- class TrustTokenOperationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- ISSUANCE = 'Issuance'#
- REDEMPTION = 'Redemption'#
- SIGNING = 'Signing'#
- class AlternateProtocolUsage(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
The reason why Chrome uses a specific transport protocol for HTTP semantics.
- ALTERNATIVE_JOB_WON_WITHOUT_RACE = 'alternativeJobWonWithoutRace'#
- ALTERNATIVE_JOB_WON_RACE = 'alternativeJobWonRace'#
- MAIN_JOB_WON_RACE = 'mainJobWonRace'#
- MAPPING_MISSING = 'mappingMissing'#
- BROKEN = 'broken'#
- DNS_ALPN_H3_JOB_WON_WITHOUT_RACE = 'dnsAlpnH3JobWonWithoutRace'#
- DNS_ALPN_H3_JOB_WON_RACE = 'dnsAlpnH3JobWonRace'#
- UNSPECIFIED_REASON = 'unspecifiedReason'#
- class ServiceWorkerRouterSource(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Source of service worker router.
- NETWORK = 'network'#
- CACHE = 'cache'#
- FETCH_EVENT = 'fetch-event'#
- RACE_NETWORK_AND_FETCH_HANDLER = 'race-network-and-fetch-handler'#
- class ServiceWorkerRouterInfo(rule_id_matched=None, matched_source_type=None, actual_source_type=None)[source]#
-
rule_id_matched:
Optional
[int
] = None# ID of the rule matched. If there is a matched rule, this field will be set, otherwiser no value will be set.
-
matched_source_type:
Optional
[ServiceWorkerRouterSource
] = None# The router source of the matched rule. If there is a matched rule, this field will be set, otherwise no value will be set.
-
actual_source_type:
Optional
[ServiceWorkerRouterSource
] = None# The actual router source used.
-
rule_id_matched:
- class Response(url, status, status_text, headers, mime_type, charset, connection_reused, connection_id, encoded_data_length, security_state, headers_text=None, request_headers=None, request_headers_text=None, remote_ip_address=None, remote_port=None, from_disk_cache=None, from_service_worker=None, from_prefetch_cache=None, from_early_hints=None, service_worker_router_info=None, timing=None, service_worker_response_source=None, response_time=None, cache_storage_cache_name=None, protocol=None, alternate_protocol_usage=None, security_details=None)[source]#
HTTP response data.
-
connection_reused:
bool
# Specifies whether physical connection was actually reused for this request.
-
security_state:
SecurityState
# Security state of the request resource.
-
headers_text:
Optional
[str
] = None# HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo.
-
request_headers:
Optional
[Headers
] = None# Refined HTTP request headers that were actually transmitted over the network.
-
request_headers_text:
Optional
[str
] = None# HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo.
-
from_service_worker:
Optional
[bool
] = None# Specifies that the request was served from the ServiceWorker.
-
from_prefetch_cache:
Optional
[bool
] = None# Specifies that the request was served from the prefetch cache.
-
from_early_hints:
Optional
[bool
] = None# Specifies that the request was served from the prefetch cache.
-
service_worker_router_info:
Optional
[ServiceWorkerRouterInfo
] = None# Information about how ServiceWorker Static Router API was used. If this field is set with
matchedSourceType
field, a matching rule is found. If this field is set withoutmatchedSource
, no matching rule is found. Otherwise, the API is not used.
-
timing:
Optional
[ResourceTiming
] = None# Timing information for the given request.
-
service_worker_response_source:
Optional
[ServiceWorkerResponseSource
] = None# Response source of response from ServiceWorker.
-
response_time:
Optional
[TimeSinceEpoch
] = None# The time at which the returned response was generated.
-
alternate_protocol_usage:
Optional
[AlternateProtocolUsage
] = None# The reason why Chrome uses a specific transport protocol for HTTP semantics.
-
security_details:
Optional
[SecurityDetails
] = None# Security details for the request.
-
connection_reused:
- class WebSocketResponse(status, status_text, headers, headers_text=None, request_headers=None, request_headers_text=None)[source]#
WebSocket response data.
- class WebSocketFrame(opcode, mask, payload_data)[source]#
WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.
- class CachedResource(url, type_, body_size, response=None)[source]#
Information about the cached resource.
-
type_:
ResourceType
# Type of this resource.
-
type_:
- class Initiator(type_, stack=None, url=None, line_number=None, column_number=None, request_id=None)[source]#
Information about the request initiator.
-
stack:
Optional
[StackTrace
] = None# Initiator JavaScript stack trace, set for Script only.
-
url:
Optional
[str
] = None# Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
-
line_number:
Optional
[float
] = None# Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
-
stack:
- class CookiePartitionKey(top_level_site, has_cross_site_ancestor)[source]#
cookiePartitionKey object The representation of the components of the key that are created by the cookiePartitionKey class contained in net/cookies/cookie_partition_key.h.
- class Cookie(name, value, domain, path, size, http_only, secure, session, priority, same_party, source_scheme, source_port, expires=None, same_site=None, partition_key=None, partition_key_opaque=None)[source]#
Cookie object
-
priority:
CookiePriority
# Cookie Priority
-
source_scheme:
CookieSourceScheme
# Cookie source scheme type.
-
source_port:
int
# 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.
-
expires:
Optional
[float
] = None# Cookie expiration date as the number of seconds since the UNIX epoch.
-
same_site:
Optional
[CookieSameSite
] = None# Cookie SameSite type.
-
partition_key:
Optional
[CookiePartitionKey
] = None# Cookie partition key.
-
priority:
- class SetCookieBlockedReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Types of reasons why a cookie may not be stored from a response.
- SECURE_ONLY = 'SecureOnly'#
- SAME_SITE_STRICT = 'SameSiteStrict'#
- SAME_SITE_LAX = 'SameSiteLax'#
- SAME_SITE_UNSPECIFIED_TREATED_AS_LAX = 'SameSiteUnspecifiedTreatedAsLax'#
- SAME_SITE_NONE_INSECURE = 'SameSiteNoneInsecure'#
- USER_PREFERENCES = 'UserPreferences'#
- THIRD_PARTY_PHASEOUT = 'ThirdPartyPhaseout'#
- THIRD_PARTY_BLOCKED_IN_FIRST_PARTY_SET = 'ThirdPartyBlockedInFirstPartySet'#
- SYNTAX_ERROR = 'SyntaxError'#
- SCHEME_NOT_SUPPORTED = 'SchemeNotSupported'#
- OVERWRITE_SECURE = 'OverwriteSecure'#
- INVALID_DOMAIN = 'InvalidDomain'#
- INVALID_PREFIX = 'InvalidPrefix'#
- UNKNOWN_ERROR = 'UnknownError'#
- SCHEMEFUL_SAME_SITE_STRICT = 'SchemefulSameSiteStrict'#
- SCHEMEFUL_SAME_SITE_LAX = 'SchemefulSameSiteLax'#
- SCHEMEFUL_SAME_SITE_UNSPECIFIED_TREATED_AS_LAX = 'SchemefulSameSiteUnspecifiedTreatedAsLax'#
- SAME_PARTY_FROM_CROSS_PARTY_CONTEXT = 'SamePartyFromCrossPartyContext'#
- SAME_PARTY_CONFLICTS_WITH_OTHER_ATTRIBUTES = 'SamePartyConflictsWithOtherAttributes'#
- NAME_VALUE_PAIR_EXCEEDS_MAX_SIZE = 'NameValuePairExceedsMaxSize'#
- DISALLOWED_CHARACTER = 'DisallowedCharacter'#
- NO_COOKIE_CONTENT = 'NoCookieContent'#
- class CookieBlockedReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Types of reasons why a cookie may not be sent with a request.
- SECURE_ONLY = 'SecureOnly'#
- NOT_ON_PATH = 'NotOnPath'#
- DOMAIN_MISMATCH = 'DomainMismatch'#
- SAME_SITE_STRICT = 'SameSiteStrict'#
- SAME_SITE_LAX = 'SameSiteLax'#
- SAME_SITE_UNSPECIFIED_TREATED_AS_LAX = 'SameSiteUnspecifiedTreatedAsLax'#
- SAME_SITE_NONE_INSECURE = 'SameSiteNoneInsecure'#
- USER_PREFERENCES = 'UserPreferences'#
- THIRD_PARTY_PHASEOUT = 'ThirdPartyPhaseout'#
- THIRD_PARTY_BLOCKED_IN_FIRST_PARTY_SET = 'ThirdPartyBlockedInFirstPartySet'#
- UNKNOWN_ERROR = 'UnknownError'#
- SCHEMEFUL_SAME_SITE_STRICT = 'SchemefulSameSiteStrict'#
- SCHEMEFUL_SAME_SITE_LAX = 'SchemefulSameSiteLax'#
- SCHEMEFUL_SAME_SITE_UNSPECIFIED_TREATED_AS_LAX = 'SchemefulSameSiteUnspecifiedTreatedAsLax'#
- SAME_PARTY_FROM_CROSS_PARTY_CONTEXT = 'SamePartyFromCrossPartyContext'#
- NAME_VALUE_PAIR_EXCEEDS_MAX_SIZE = 'NameValuePairExceedsMaxSize'#
- class CookieExemptionReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request.
- NONE = 'None'#
- USER_SETTING = 'UserSetting'#
- TPCD_METADATA = 'TPCDMetadata'#
- TPCD_DEPRECATION_TRIAL = 'TPCDDeprecationTrial'#
- TPCD_HEURISTICS = 'TPCDHeuristics'#
- ENTERPRISE_POLICY = 'EnterprisePolicy'#
- STORAGE_ACCESS = 'StorageAccess'#
- TOP_LEVEL_STORAGE_ACCESS = 'TopLevelStorageAccess'#
- CORS_OPT_IN = 'CorsOptIn'#
- SCHEME = 'Scheme'#
- class BlockedSetCookieWithReason(blocked_reasons, cookie_line, cookie=None)[source]#
A cookie which was not stored from a response with the corresponding reason.
-
blocked_reasons:
List
[SetCookieBlockedReason
]# The reason(s) this cookie was blocked.
-
blocked_reasons:
- class ExemptedSetCookieWithReason(exemption_reason, cookie_line, cookie)[source]#
A cookie should have been blocked by 3PCD but is exempted and stored from a response with the corresponding reason. A cookie could only have at most one exemption reason.
-
exemption_reason:
CookieExemptionReason
# The reason the cookie was exempted.
-
exemption_reason:
- class AssociatedCookie(cookie, blocked_reasons, exemption_reason=None)[source]#
A cookie associated with the request which may or may not be sent with it. Includes the cookies itself and reasons for blocking or exemption.
-
blocked_reasons:
List
[CookieBlockedReason
]# The reason(s) the cookie was blocked. If empty means the cookie is included.
-
exemption_reason:
Optional
[CookieExemptionReason
] = None# The reason the cookie should have been blocked by 3PCD but is exempted. A cookie could only have at most one exemption reason.
-
blocked_reasons:
- class CookieParam(name, value, url=None, domain=None, path=None, secure=None, http_only=None, same_site=None, expires=None, priority=None, same_party=None, source_scheme=None, source_port=None, partition_key=None)[source]#
Cookie parameter object
-
url:
Optional
[str
] = None# 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.
-
same_site:
Optional
[CookieSameSite
] = None# Cookie SameSite type.
-
expires:
Optional
[TimeSinceEpoch
] = None# Cookie expiration date, session cookie if not set
-
priority:
Optional
[CookiePriority
] = None# Cookie Priority.
-
source_scheme:
Optional
[CookieSourceScheme
] = None# Cookie source scheme type.
-
source_port:
Optional
[int
] = None# 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.
-
partition_key:
Optional
[CookiePartitionKey
] = None# Cookie partition key. If not set, the cookie will be set as not partitioned.
-
url:
- class AuthChallenge(origin, scheme, realm, source=None)[source]#
Authorization challenge for HTTP status code 401 or 407.
- class AuthChallengeResponse(response, username=None, password=None)[source]#
Response to an AuthChallenge.
-
response:
str
# The decision on what to do in response to the authorization challenge. Default means deferring to the default behavior of the net stack, which will likely either the Cancel authentication or display a popup dialog box.
-
response:
- class InterceptionStage(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Stages of the interception to begin intercepting. Request will intercept before the request is sent. Response will intercept after the response is received.
- REQUEST = 'Request'#
- HEADERS_RECEIVED = 'HeadersReceived'#
- class RequestPattern(url_pattern=None, resource_type=None, interception_stage=None)[source]#
Request pattern for interception.
-
url_pattern:
Optional
[str
] = None# Wildcards (
'*'
-> zero or more,'?'
-> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to"*"
.
-
resource_type:
Optional
[ResourceType
] = None# If set, only requests for matching resource types will be intercepted.
-
interception_stage:
Optional
[InterceptionStage
] = None# Stage at which to begin intercepting requests. Default is Request.
-
url_pattern:
- class SignedExchangeSignature(label, signature, integrity, validity_url, date, expires, cert_url=None, cert_sha256=None, certificates=None)[source]#
Information about a signed exchange signature. https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1
- class SignedExchangeHeader(request_url, response_code, response_headers, signatures, header_integrity)[source]#
Information about a signed exchange header. https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation
-
signatures:
List
[SignedExchangeSignature
]# Signed exchange response signature.
-
signatures:
- class SignedExchangeErrorField(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Field type for a signed exchange related error.
- SIGNATURE_SIG = 'signatureSig'#
- SIGNATURE_INTEGRITY = 'signatureIntegrity'#
- SIGNATURE_CERT_URL = 'signatureCertUrl'#
- SIGNATURE_CERT_SHA256 = 'signatureCertSha256'#
- SIGNATURE_VALIDITY_URL = 'signatureValidityUrl'#
- SIGNATURE_TIMESTAMPS = 'signatureTimestamps'#
- class SignedExchangeError(message, signature_index=None, error_field=None)[source]#
Information about a signed exchange response.
-
error_field:
Optional
[SignedExchangeErrorField
] = None# The field which caused the error.
-
error_field:
- class SignedExchangeInfo(outer_response, header=None, security_details=None, errors=None)[source]#
Information about a signed exchange response.
-
outer_response:
Response
# The outer response of signed HTTP exchange which was received from network.
-
header:
Optional
[SignedExchangeHeader
] = None# Information about the signed exchange header.
-
security_details:
Optional
[SecurityDetails
] = None# Security details for the signed exchange header.
-
errors:
Optional
[List
[SignedExchangeError
]] = None# Errors occurred while handling the signed exchange.
-
outer_response:
- class ContentEncoding(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
List of content encodings supported by the backend.
- DEFLATE = 'deflate'#
- GZIP = 'gzip'#
- BR = 'br'#
- ZSTD = 'zstd'#
- class PrivateNetworkRequestPolicy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- ALLOW = 'Allow'#
- BLOCK_FROM_INSECURE_TO_MORE_PRIVATE = 'BlockFromInsecureToMorePrivate'#
- WARN_FROM_INSECURE_TO_MORE_PRIVATE = 'WarnFromInsecureToMorePrivate'#
- PREFLIGHT_BLOCK = 'PreflightBlock'#
- PREFLIGHT_WARN = 'PreflightWarn'#
- class IPAddressSpace(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- LOCAL = 'Local'#
- PRIVATE = 'Private'#
- PUBLIC = 'Public'#
- UNKNOWN = 'Unknown'#
- class ClientSecurityState(initiator_is_secure_context, initiator_ip_address_space, private_network_request_policy)[source]#
-
-
initiator_ip_address_space:
IPAddressSpace
#
-
private_network_request_policy:
PrivateNetworkRequestPolicy
#
-
initiator_ip_address_space:
- class CrossOriginOpenerPolicyValue(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- SAME_ORIGIN = 'SameOrigin'#
- SAME_ORIGIN_ALLOW_POPUPS = 'SameOriginAllowPopups'#
- RESTRICT_PROPERTIES = 'RestrictProperties'#
- UNSAFE_NONE = 'UnsafeNone'#
- SAME_ORIGIN_PLUS_COEP = 'SameOriginPlusCoep'#
- RESTRICT_PROPERTIES_PLUS_COEP = 'RestrictPropertiesPlusCoep'#
- class CrossOriginOpenerPolicyStatus(value, report_only_value, reporting_endpoint=None, report_only_reporting_endpoint=None)[source]#
-
-
report_only_value:
CrossOriginOpenerPolicyValue
#
-
report_only_value:
- class CrossOriginEmbedderPolicyValue(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- NONE = 'None'#
- CREDENTIALLESS = 'Credentialless'#
- REQUIRE_CORP = 'RequireCorp'#
- class CrossOriginEmbedderPolicyStatus(value, report_only_value, reporting_endpoint=None, report_only_reporting_endpoint=None)[source]#
-
-
report_only_value:
CrossOriginEmbedderPolicyValue
#
-
report_only_value:
- class ContentSecurityPolicySource(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- HTTP = 'HTTP'#
- META = 'Meta'#
- class ContentSecurityPolicyStatus(effective_directives, is_enforced, source)[source]#
-
-
source:
ContentSecurityPolicySource
#
-
source:
- class SecurityIsolationStatus(coop=None, coep=None, csp=None)[source]#
-
coop:
Optional
[CrossOriginOpenerPolicyStatus
] = None#
-
coep:
Optional
[CrossOriginEmbedderPolicyStatus
] = None#
-
csp:
Optional
[List
[ContentSecurityPolicyStatus
]] = None#
-
coop:
- class ReportStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
The status of a Reporting API report.
- QUEUED = 'Queued'#
- PENDING = 'Pending'#
- MARKED_FOR_REMOVAL = 'MarkedForRemoval'#
- SUCCESS = 'Success'#
- class ReportingApiReport(id_, initiator_url, destination, type_, timestamp, depth, completed_attempts, body, status)[source]#
An object representing a report generated by the Reporting API.
-
type_:
str
# The type of the report (specifies the set of data that is contained in the report body).
-
timestamp:
TimeSinceEpoch
# When the report was generated.
-
completed_attempts:
int
# The number of delivery attempts made so far, not including an active attempt.
-
status:
ReportStatus
#
-
type_:
- class LoadNetworkResourcePageResult(success, net_error=None, net_error_name=None, http_status_code=None, stream=None, headers=None)[source]#
An object providing the result of a network resource load.
-
stream:
Optional
[StreamHandle
] = None# If successful, one of the following two fields holds the result.
-
stream:
Commands#
Each command is a generator function. The return
type Generator[x, y, z]
indicates that the generator
yields arguments of type x
, it must be resumed with
an argument of type y
, and it returns type z
. In
this library, types x
and y
are the same for all
commands, and z
is the return type you should pay attention
to. For more information, see
Getting Started: Commands.
- can_clear_browser_cache()[source]#
Tells whether clearing browser cache is supported.
Deprecated since version 1.3.
- Return type:
- Returns:
True if browser cache can be cleared.
Deprecated since version 1.3.
- can_clear_browser_cookies()[source]#
Tells whether clearing browser cookies is supported.
Deprecated since version 1.3.
- Return type:
- Returns:
True if browser cookies can be cleared.
Deprecated since version 1.3.
- can_emulate_network_conditions()[source]#
Tells whether emulation of network conditions is supported.
Deprecated since version 1.3.
- Return type:
- Returns:
True if emulation of network conditions is supported.
Deprecated since version 1.3.
- clear_accepted_encodings_override()[source]#
Clears accepted encodings set by setAcceptedEncodings
EXPERIMENTAL
- continue_intercepted_request(interception_id, error_reason=None, raw_response=None, url=None, method=None, post_data=None, headers=None, auth_challenge_response=None)[source]#
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.
Deprecated since version 1.3.
EXPERIMENTAL
- Parameters:
interception_id (
InterceptionId
) –error_reason (
Optional
[ErrorReason
]) – (Optional) If set this causes the request to fail with the given reason. Passing`Aborted``
for requests marked with``isNavigationRequest`
also cancels the navigation. Must not be set in response to an authChallenge.raw_response (
Optional
[str
]) – (Optional) 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)url (
Optional
[str
]) – (Optional) 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.method (
Optional
[str
]) – (Optional) If set this allows the request method to be overridden. Must not be set in response to an authChallenge.post_data (
Optional
[str
]) – (Optional) If set this allows postData to be set. Must not be set in response to an authChallenge.headers (
Optional
[Headers
]) – (Optional) If set this allows the request headers to be changed. Must not be set in response to an authChallenge.auth_challenge_response (
Optional
[AuthChallengeResponse
]) – (Optional) Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
- Return type:
Deprecated since version 1.3.
- delete_cookies(name, url=None, domain=None, path=None, partition_key=None)[source]#
Deletes browser cookies with matching name and url or domain/path/partitionKey pair.
- Parameters:
name (
str
) – Name of the cookies to remove.url (
Optional
[str
]) – (Optional) If specified, deletes all the cookies with the given name where domain and path match provided URL.domain (
Optional
[str
]) – (Optional) If specified, deletes only cookies with the exact domain.path (
Optional
[str
]) – (Optional) If specified, deletes only cookies with the exact path.partition_key (
Optional
[CookiePartitionKey
]) – (EXPERIMENTAL) (Optional) If specified, deletes only cookies with the the given name and partitionKey where all partition key attributes match the cookie partition key attribute.
- Return type:
- disable()[source]#
Disables network tracking, prevents network events from being sent to the client.
- emulate_network_conditions(offline, latency, download_throughput, upload_throughput, connection_type=None, packet_loss=None, packet_queue_length=None, packet_reordering=None)[source]#
Activates emulation of network conditions.
- Parameters:
offline (
bool
) – True to emulate internet disconnection.latency (
float
) – Minimum latency from request sent to response headers received (ms).download_throughput (
float
) – Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.upload_throughput (
float
) – Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.connection_type (
Optional
[ConnectionType
]) – (Optional) Connection type if known.packet_loss (
Optional
[float
]) – (EXPERIMENTAL) (Optional) WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.packet_queue_length (
Optional
[int
]) – (EXPERIMENTAL) (Optional) WebRTC packet queue length (packet). 0 removes any queue length limitations.packet_reordering (
Optional
[bool
]) – (EXPERIMENTAL) (Optional) WebRTC packetReordering feature.
- Return type:
- enable(max_total_buffer_size=None, max_resource_buffer_size=None, max_post_data_size=None)[source]#
Enables network tracking, network events will now be delivered to the client.
- Parameters:
max_total_buffer_size (
Optional
[int
]) – (EXPERIMENTAL) (Optional) Buffer size in bytes to use when preserving network payloads (XHRs, etc).max_resource_buffer_size (
Optional
[int
]) – (EXPERIMENTAL) (Optional) Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).max_post_data_size (
Optional
[int
]) – (Optional) Longest post body size (in bytes) that would be included in requestWillBeSent notification
- Return type:
- enable_reporting_api(enable)[source]#
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
- get_all_cookies()[source]#
Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the
cookies
field. Deprecated. Use Storage.getCookies instead.Deprecated since version 1.3.
- Return type:
- Returns:
Array of cookie objects.
Deprecated since version 1.3.
- get_cookies(urls=None)[source]#
Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the
cookies
field.
- get_request_post_data(request_id)[source]#
Returns post data sent with the request. Returns an error when no data was sent with the request.
- get_response_body_for_interception(interception_id)[source]#
Returns content served for the given currently intercepted request.
EXPERIMENTAL
- get_security_isolation_status(frame_id=None)[source]#
Returns information about the COEP/COOP isolation status.
EXPERIMENTAL
- load_network_resource(url, options, frame_id=None)[source]#
Fetches the resource and returns the content.
EXPERIMENTAL
- Parameters:
frame_id (
Optional
[FrameId
]) – (Optional) Frame id to get the resource for. Mandatory for frame targets, and should be omitted for worker targets.url (
str
) – URL of the resource to get content for.options (
LoadNetworkResourceOptions
) – Options for the request.
- Return type:
Generator
[Dict
[str
,Any
],Dict
[str
,Any
],LoadNetworkResourcePageResult
]- Returns:
- replay_xhr(request_id)[source]#
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
- search_in_response_body(request_id, query, case_sensitive=None, is_regex=None)[source]#
Searches for given string in response content.
EXPERIMENTAL
- set_accepted_encodings(encodings)[source]#
Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.
EXPERIMENTAL
- set_attach_debug_stack(enabled)[source]#
Specifies whether to attach a page script stack id in requests
EXPERIMENTAL
- set_cache_disabled(cache_disabled)[source]#
Toggles ignoring cache for each request. If
true
, cache will not be used.
- set_cookie(name, value, url=None, domain=None, path=None, secure=None, http_only=None, same_site=None, expires=None, priority=None, same_party=None, source_scheme=None, source_port=None, partition_key=None)[source]#
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
- Parameters:
name (
str
) – Cookie name.value (
str
) – Cookie value.url (
Optional
[str
]) – (Optional) 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.secure (
Optional
[bool
]) – (Optional) True if cookie is secure.http_only (
Optional
[bool
]) – (Optional) True if cookie is http-only.same_site (
Optional
[CookieSameSite
]) – (Optional) Cookie SameSite type.expires (
Optional
[TimeSinceEpoch
]) – (Optional) Cookie expiration date, session cookie if not setpriority (
Optional
[CookiePriority
]) – (EXPERIMENTAL) (Optional) Cookie Priority type.same_party (
Optional
[bool
]) – (EXPERIMENTAL) (Optional) True if cookie is SameParty.source_scheme (
Optional
[CookieSourceScheme
]) – (EXPERIMENTAL) (Optional) Cookie source scheme type.source_port (
Optional
[int
]) – (EXPERIMENTAL) (Optional) 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.partition_key (
Optional
[CookiePartitionKey
]) – (EXPERIMENTAL) (Optional) Cookie partition key. If not set, the cookie will be set as not partitioned.
- Return type:
- Returns:
Always set to true. If an error occurs, the response indicates protocol error.
- set_extra_http_headers(headers)[source]#
Specifies whether to always send extra HTTP headers with the requests from this page.
- set_request_interception(patterns)[source]#
Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.
Deprecated since version 1.3.
EXPERIMENTAL
- Parameters:
patterns (
List
[RequestPattern
]) – Requests matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call.- Return type:
Deprecated since version 1.3.
- set_user_agent_override(user_agent, accept_language=None, platform=None, user_agent_metadata=None)[source]#
Allows overriding user agent with the given string.
- Parameters:
user_agent (
str
) – User agent to use.accept_language (
Optional
[str
]) – (Optional) Browser language to emulate.platform (
Optional
[str
]) – (Optional) The platform navigator.platform should return.user_agent_metadata (
Optional
[UserAgentMetadata
]) – (EXPERIMENTAL) (Optional) To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
- Return type:
- stream_resource_content(request_id)[source]#
Enables streaming of the response for the given requestId. If enabled, the dataReceived event contains the data that was received during streaming.
EXPERIMENTAL
- take_response_body_for_interception_as_stream(interception_id)[source]#
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:
interception_id (
InterceptionId
) –- Return type:
- Returns:
Events#
Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.
- class DataReceived(request_id, timestamp, data_length, encoded_data_length, data)[source]#
Fired when data chunk was received over the network.
-
timestamp:
MonotonicTime
# Timestamp.
-
timestamp:
- class EventSourceMessageReceived(request_id, timestamp, event_name, event_id, data)[source]#
Fired when EventSource message is received.
-
timestamp:
MonotonicTime
# Timestamp.
-
timestamp:
- class LoadingFailed(request_id, timestamp, type_, error_text, canceled, blocked_reason, cors_error_status)[source]#
Fired when HTTP request has failed to load.
-
timestamp:
MonotonicTime
# Timestamp.
-
type_:
ResourceType
# Resource type.
-
error_text:
str
# //cs.chromium.org/chromium/src/net/base/net_error_list.h
- Type:
Error message. List of network errors
- Type:
https
-
blocked_reason:
Optional
[BlockedReason
]# The reason why loading was blocked, if any.
-
cors_error_status:
Optional
[CorsErrorStatus
]# The reason why loading was blocked by CORS, if any.
-
timestamp:
- class LoadingFinished(request_id, timestamp, encoded_data_length)[source]#
Fired when HTTP request has finished loading.
-
timestamp:
MonotonicTime
# Timestamp.
-
timestamp:
- class RequestIntercepted(interception_id, request, frame_id, resource_type, is_navigation_request, is_download, redirect_url, auth_challenge, response_error_reason, response_status_code, response_headers, request_id)[source]#
EXPERIMENTAL
Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked. Deprecated, use Fetch.requestPaused instead.
Deprecated since version 1.3.
-
interception_id:
InterceptionId
# Each request the page makes will have a unique id, however if any redirects are encountered while processing that fetch, they will be reported with the same id as the original fetch. Likewise if HTTP authentication is needed then the same fetch id will be used.
-
resource_type:
ResourceType
# How the requested resource will be used.
Whether this is a navigation request, which can abort the navigation completely.
-
is_download:
Optional
[bool
]# Set if the request is a navigation that will result in a download. Only present after response is received from the server (i.e. HeadersReceived stage).
-
auth_challenge:
Optional
[AuthChallenge
]# Details of the Authorization Challenge encountered. If this is set then continueInterceptedRequest must contain an authChallengeResponse.
-
response_error_reason:
Optional
[ErrorReason
]# Response error if intercepted at response stage or if redirect occurred while intercepting request.
-
response_status_code:
Optional
[int
]# Response code if intercepted at response stage or if redirect occurred while intercepting request or auth retry occurred.
-
interception_id:
- class RequestWillBeSent(request_id, loader_id, document_url, request, timestamp, wall_time, initiator, redirect_has_extra_info, redirect_response, type_, frame_id, has_user_gesture)[source]#
Fired when page is about to send HTTP request.
-
timestamp:
MonotonicTime
# Timestamp.
-
wall_time:
TimeSinceEpoch
# Timestamp.
-
redirect_has_extra_info:
bool
# In the case that redirectResponse is populated, this flag indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted for the request which was just redirected.
-
type_:
Optional
[ResourceType
]# Type of this resource.
-
timestamp:
- class ResourceChangedPriority(request_id, new_priority, timestamp)[source]#
EXPERIMENTAL
Fired when resource loading priority is changed
-
new_priority:
ResourcePriority
# New priority
-
timestamp:
MonotonicTime
# Timestamp.
-
new_priority:
- class SignedExchangeReceived(request_id, info)[source]#
EXPERIMENTAL
Fired when a signed exchange was received over the network
-
info:
SignedExchangeInfo
# Information about the signed exchange response.
-
info:
- class ResponseReceived(request_id, loader_id, timestamp, type_, response, has_extra_info, frame_id)[source]#
Fired when HTTP response is available.
-
timestamp:
MonotonicTime
# Timestamp.
-
type_:
ResourceType
# Resource type.
-
timestamp:
- class WebSocketClosed(request_id, timestamp)[source]#
Fired when WebSocket is closed.
-
timestamp:
MonotonicTime
# Timestamp.
-
timestamp:
- class WebSocketFrameError(request_id, timestamp, error_message)[source]#
Fired when WebSocket message error occurs.
-
timestamp:
MonotonicTime
# Timestamp.
-
timestamp:
- class WebSocketFrameReceived(request_id, timestamp, response)[source]#
Fired when WebSocket message is received.
-
timestamp:
MonotonicTime
# Timestamp.
-
response:
WebSocketFrame
# WebSocket response data.
-
timestamp:
- class WebSocketFrameSent(request_id, timestamp, response)[source]#
Fired when WebSocket message is sent.
-
timestamp:
MonotonicTime
# Timestamp.
-
response:
WebSocketFrame
# WebSocket response data.
-
timestamp:
- class WebSocketHandshakeResponseReceived(request_id, timestamp, response)[source]#
Fired when WebSocket handshake response becomes available.
-
timestamp:
MonotonicTime
# Timestamp.
-
response:
WebSocketResponse
# WebSocket response data.
-
timestamp:
- class WebSocketWillSendHandshakeRequest(request_id, timestamp, wall_time, request)[source]#
Fired when WebSocket is about to initiate handshake.
-
timestamp:
MonotonicTime
# Timestamp.
-
wall_time:
TimeSinceEpoch
# UTC Timestamp.
-
request:
WebSocketRequest
# WebSocket request data.
-
timestamp:
- class WebTransportCreated(transport_id, url, timestamp, initiator)[source]#
Fired upon WebTransport creation.
-
timestamp:
MonotonicTime
# Timestamp.
-
timestamp:
- class WebTransportConnectionEstablished(transport_id, timestamp)[source]#
Fired when WebTransport handshake is finished.
-
timestamp:
MonotonicTime
# Timestamp.
-
timestamp:
- class WebTransportClosed(transport_id, timestamp)[source]#
Fired when WebTransport is disposed.
-
timestamp:
MonotonicTime
# Timestamp.
-
timestamp:
- class RequestWillBeSentExtraInfo(request_id, associated_cookies, headers, connect_timing, client_security_state, site_has_cookie_in_other_partition)[source]#
EXPERIMENTAL
Fired when additional information about a requestWillBeSent event is available from the network stack. Not every requestWillBeSent event will have an additional requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent or requestWillBeSentExtraInfo will be fired first for the same request.
-
request_id:
RequestId
# Request identifier. Used to match this information to an existing requestWillBeSent event.
-
associated_cookies:
List
[AssociatedCookie
]# A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReasons field set.
-
connect_timing:
ConnectTiming
# Connection timing information for the request.
-
client_security_state:
Optional
[ClientSecurityState
]# The client security state set for the request.
-
request_id:
- class ResponseReceivedExtraInfo(request_id, blocked_cookies, headers, resource_ip_address_space, status_code, headers_text, cookie_partition_key, cookie_partition_key_opaque, exempted_cookies)[source]#
EXPERIMENTAL
Fired when additional information about a responseReceived event is available from the network stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for it, and responseReceivedExtraInfo may be fired before or after responseReceived.
-
request_id:
RequestId
# Request identifier. Used to match this information to another responseReceived event.
-
blocked_cookies:
List
[BlockedSetCookieWithReason
]# A list of cookies which were not stored from the response along with the corresponding reasons for blocking. The cookies here may not be valid due to syntax errors, which are represented by the invalid cookie line string instead of a proper cookie.
-
resource_ip_address_space:
IPAddressSpace
# The IP address space of the resource. The address space can only be determined once the transport established the connection, so we can’t send it in
requestWillBeSentExtraInfo
.
-
status_code:
int
# The status code of the response. This is useful in cases the request failed and no responseReceived event is triggered, which is the case for, e.g., CORS errors. This is also the correct status code for cached requests, where the status in responseReceived is a 200 and this will be 304.
-
headers_text:
Optional
[str
]# Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC.
-
cookie_partition_key:
Optional
[CookiePartitionKey
]# The cookie partition key that will be used to store partitioned cookies set in this response. Only sent when partitioned cookies are enabled.
-
cookie_partition_key_opaque:
Optional
[bool
]# True if partitioned cookies are enabled, but the partition key is not serializable to string.
-
exempted_cookies:
Optional
[List
[ExemptedSetCookieWithReason
]]# A list of cookies which should have been blocked by 3PCD but are exempted and stored from the response with the corresponding reason.
-
request_id:
- class ResponseReceivedEarlyHints(request_id, headers)[source]#
EXPERIMENTAL
Fired when 103 Early Hints headers is received in addition to the common response. Not every responseReceived event will have an responseReceivedEarlyHints fired. Only one responseReceivedEarlyHints may be fired for eached responseReceived event.
- class TrustTokenOperationDone(status, type_, request_id, top_level_origin, issuer_origin, issued_token_count)[source]#
EXPERIMENTAL
Fired exactly once for each Trust Token operation. Depending on the type of the operation and whether the operation succeeded or failed, the event is fired before the corresponding request was sent or after the response was received.
-
status:
str
# Detailed success or error status of the operation. ‘AlreadyExists’ also signifies a successful operation, as the result of the operation already exists und thus, the operation was abort preemptively (e.g. a cache hit).
-
type_:
TrustTokenOperationType
#
-
top_level_origin:
Optional
[str
]# Top level origin. The context in which the operation was attempted.
-
status:
- class SubresourceWebBundleMetadataReceived(request_id, urls)[source]#
EXPERIMENTAL
Fired once when parsing the .wbn file has succeeded. The event contains the information about the web bundle contents.
- class SubresourceWebBundleMetadataError(request_id, error_message)[source]#
EXPERIMENTAL
Fired once when parsing the .wbn file has failed.
- class SubresourceWebBundleInnerResponseParsed(inner_request_id, inner_request_url, bundle_request_id)[source]#
EXPERIMENTAL
Fired when handling requests for resources within a .wbn file. Note: this will only be fired for resources that are requested by the webpage.
- class SubresourceWebBundleInnerResponseError(inner_request_id, inner_request_url, error_message, bundle_request_id)[source]#
EXPERIMENTAL
Fired when request for resources within a .wbn file failed.
- class ReportingApiReportAdded(report)[source]#
EXPERIMENTAL
Is sent whenever a new report is added. And after ‘enableReportingApi’ for all existing reports.
-
report:
ReportingApiReport
#
-
report:
- class ReportingApiReportUpdated(report)[source]#
EXPERIMENTAL
-
report:
ReportingApiReport
#
-
report: