Tungsten v0.1.0 Tungsten.CDP.Network View Source
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.
Link to this section Summary
Link to this section Types
cdp_auth_challenge_response_type() View Source
Response to an AuthChallenge.
cdp_auth_challenge_type() View Source
Authorization challenge for HTTP status code 401 or 407.
cdp_blocked_reason_type()
View Source
cdp_blocked_reason_type() ::
:"collapsed-by-client"
| :"content-type"
| :"subresource-filter"
| :inspector
| :origin
| :"mixed-content"
| :csp
| :other
cdp_blocked_reason_type() :: :"collapsed-by-client" | :"content-type" | :"subresource-filter" | :inspector | :origin | :"mixed-content" | :csp | :other
The reason why request was blocked.
cdp_cached_resource_type()
View Source
cdp_cached_resource_type() :: %{
:url => String.t(),
:type => cdp_resource_type_type(),
optional(:response) => cdp_response_type(),
:body_size => integer() | float()
}
cdp_cached_resource_type() :: %{
:url => String.t(),
:type => cdp_resource_type_type(),
optional(:response) => cdp_response_type(),
:body_size => integer() | float()
}
Information about the cached resource.
cdp_certificate_transparency_compliance_type()
View Source
cdp_certificate_transparency_compliance_type() ::
:compliant | :"not-compliant" | :unknown
cdp_certificate_transparency_compliance_type() :: :compliant | :"not-compliant" | :unknown
Network.CertificateTransparencyCompliance
Whether the request complied with Certificate Transparency policy.
cdp_connection_type_type()
View Source
cdp_connection_type_type() ::
:other
| :wimax
| :wifi
| :ethernet
| :bluetooth
| :cellular4g
| :cellular3g
| :cellular2g
| :none
cdp_connection_type_type() :: :other | :wimax | :wifi | :ethernet | :bluetooth | :cellular4g | :cellular3g | :cellular2g | :none
The underlying connection technology that the browser is supposedly using.
cdp_cookie_param_type()
View Source
cdp_cookie_param_type() :: %{
:name => String.t(),
:value => String.t(),
optional(:url) => String.t(),
optional(:domain) => String.t(),
optional(:path) => String.t(),
optional(:secure) => boolean(),
optional(:http_only) => boolean(),
optional(:same_site) => cdp_cookie_same_site_type(),
optional(:expires) => cdp_time_since_epoch_type()
}
cdp_cookie_param_type() :: %{
:name => String.t(),
:value => String.t(),
optional(:url) => String.t(),
optional(:domain) => String.t(),
optional(:path) => String.t(),
optional(:secure) => boolean(),
optional(:http_only) => boolean(),
optional(:same_site) => cdp_cookie_same_site_type(),
optional(:expires) => cdp_time_since_epoch_type()
}
Cookie parameter object
cdp_cookie_same_site_type()
View Source
cdp_cookie_same_site_type() :: :lax | :strict
cdp_cookie_same_site_type() :: :lax | :strict
Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies
cdp_cookie_type() View Source
Cookie object
cdp_error_reason_type()
View Source
cdp_error_reason_type() ::
:blocked_by_response
| :blocked_by_client
| :address_unreachable
| :internet_disconnected
| :name_not_resolved
| :connection_failed
| :connection_aborted
| :connection_refused
| :connection_reset
| :connection_closed
| :access_denied
| :timed_out
| :aborted
| :failed
cdp_error_reason_type() :: :blocked_by_response | :blocked_by_client | :address_unreachable | :internet_disconnected | :name_not_resolved | :connection_failed | :connection_aborted | :connection_refused | :connection_reset | :connection_closed | :access_denied | :timed_out | :aborted | :failed
Network level fetch failure reason.
cdp_headers_type()
View Source
cdp_headers_type() :: map()
cdp_headers_type() :: map()
Request / response headers as keys / values of JSON object.
cdp_initiator_type()
View Source
cdp_initiator_type() :: %{
:type => :other | :signed_exchange | :preload | :script | :parser,
optional(:stack) => Tungsten.CDP.Runtime.cdp_stack_trace_type(),
optional(:url) => String.t(),
optional(:line_number) => integer() | float()
}
cdp_initiator_type() :: %{
:type => :other | :signed_exchange | :preload | :script | :parser,
optional(:stack) => Tungsten.CDP.Runtime.cdp_stack_trace_type(),
optional(:url) => String.t(),
optional(:line_number) => integer() | float()
}
Information about the request initiator.
cdp_interception_id_type()
View Source
cdp_interception_id_type() :: String.t()
cdp_interception_id_type() :: String.t()
Unique intercepted request identifier.
cdp_interception_stage_type()
View Source
cdp_interception_stage_type() :: :headers_received | :request
cdp_interception_stage_type() :: :headers_received | :request
Stages of the interception to begin intercepting. Request will intercept before the request is sent. Response will intercept after the response is received.
cdp_loader_id_type()
View Source
cdp_loader_id_type() :: String.t()
cdp_loader_id_type() :: String.t()
Unique loader identifier.
cdp_monotonic_time_type() View Source
Monotonically increasing time in seconds since an arbitrary point in the past.
cdp_request_id_type()
View Source
cdp_request_id_type() :: String.t()
cdp_request_id_type() :: String.t()
Unique request identifier.
cdp_request_pattern_type()
View Source
cdp_request_pattern_type() :: %{
optional(:url_pattern) => String.t(),
optional(:resource_type) => cdp_resource_type_type(),
optional(:interception_stage) => cdp_interception_stage_type()
}
cdp_request_pattern_type() :: %{
optional(:url_pattern) => String.t(),
optional(:resource_type) => cdp_resource_type_type(),
optional(:interception_stage) => cdp_interception_stage_type()
}
Request pattern for interception.
cdp_request_type()
View Source
cdp_request_type() :: %{
:url => String.t(),
optional(:url_fragment) => String.t(),
:method => String.t(),
:headers => cdp_headers_type(),
optional(:post_data) => String.t(),
optional(:has_post_data) => boolean(),
optional(:mixed_content_type) =>
Tungsten.CDP.Security.cdp_mixed_content_type_type(),
:initial_priority => cdp_resource_priority_type(),
:referrer_policy =>
:"strict-origin-when-cross-origin"
| :"strict-origin"
| :"same-origin"
| :"origin-when-cross-origin"
| :origin
| :"no-referrer"
| :"no-referrer-when-downgrade"
| :"unsafe-url",
optional(:is_link_preload) => boolean()
}
cdp_request_type() :: %{
:url => String.t(),
optional(:url_fragment) => String.t(),
:method => String.t(),
:headers => cdp_headers_type(),
optional(:post_data) => String.t(),
optional(:has_post_data) => boolean(),
optional(:mixed_content_type) =>
Tungsten.CDP.Security.cdp_mixed_content_type_type(),
:initial_priority => cdp_resource_priority_type(),
:referrer_policy =>
:"strict-origin-when-cross-origin"
| :"strict-origin"
| :"same-origin"
| :"origin-when-cross-origin"
| :origin
| :"no-referrer"
| :"no-referrer-when-downgrade"
| :"unsafe-url",
optional(:is_link_preload) => boolean()
}
HTTP request data.
cdp_resource_priority_type()
View Source
cdp_resource_priority_type() :: :very_high | :high | :medium | :low | :very_low
cdp_resource_priority_type() :: :very_high | :high | :medium | :low | :very_low
Loading priority of a resource request.
cdp_resource_timing_type()
View Source
cdp_resource_timing_type() :: %{
request_time: integer() | float(),
proxy_start: integer() | float(),
proxy_end: integer() | float(),
dns_start: integer() | float(),
dns_end: integer() | float(),
connect_start: integer() | float(),
connect_end: integer() | float(),
ssl_start: integer() | float(),
ssl_end: integer() | float(),
worker_start: integer() | float(),
worker_ready: integer() | float(),
send_start: integer() | float(),
send_end: integer() | float(),
push_start: integer() | float(),
push_end: integer() | float(),
receive_headers_end: integer() | float()
}
cdp_resource_timing_type() :: %{
request_time: integer() | float(),
proxy_start: integer() | float(),
proxy_end: integer() | float(),
dns_start: integer() | float(),
dns_end: integer() | float(),
connect_start: integer() | float(),
connect_end: integer() | float(),
ssl_start: integer() | float(),
ssl_end: integer() | float(),
worker_start: integer() | float(),
worker_ready: integer() | float(),
send_start: integer() | float(),
send_end: integer() | float(),
push_start: integer() | float(),
push_end: integer() | float(),
receive_headers_end: integer() | float()
}
Timing information for the request.
cdp_resource_type_type()
View Source
cdp_resource_type_type() ::
:other
| :csp_violation_report
| :ping
| :signed_exchange
| :manifest
| :web_socket
| :event_source
| :fetch
| :xhr
| :text_track
| :script
| :font
| :media
| :image
| :stylesheet
| :document
cdp_resource_type_type() :: :other | :csp_violation_report | :ping | :signed_exchange | :manifest | :web_socket | :event_source | :fetch | :xhr | :text_track | :script | :font | :media | :image | :stylesheet | :document
Resource type as it was perceived by the rendering engine.
cdp_response_type()
View Source
cdp_response_type() :: %{
:url => String.t(),
:status => integer(),
:status_text => String.t(),
:headers => cdp_headers_type(),
optional(:headers_text) => String.t(),
:mime_type => String.t(),
optional(:request_headers) => cdp_headers_type(),
optional(:request_headers_text) => String.t(),
:connection_reused => boolean(),
:connection_id => integer() | float(),
optional(:remote_ip_address) => String.t(),
optional(:remote_port) => integer(),
optional(:from_disk_cache) => boolean(),
optional(:from_service_worker) => boolean(),
:encoded_data_length => integer() | float(),
optional(:timing) => cdp_resource_timing_type(),
optional(:protocol) => String.t(),
:security_state => Tungsten.CDP.Security.cdp_security_state_type(),
optional(:security_details) => cdp_security_details_type()
}
cdp_response_type() :: %{
:url => String.t(),
:status => integer(),
:status_text => String.t(),
:headers => cdp_headers_type(),
optional(:headers_text) => String.t(),
:mime_type => String.t(),
optional(:request_headers) => cdp_headers_type(),
optional(:request_headers_text) => String.t(),
:connection_reused => boolean(),
:connection_id => integer() | float(),
optional(:remote_ip_address) => String.t(),
optional(:remote_port) => integer(),
optional(:from_disk_cache) => boolean(),
optional(:from_service_worker) => boolean(),
:encoded_data_length => integer() | float(),
optional(:timing) => cdp_resource_timing_type(),
optional(:protocol) => String.t(),
:security_state => Tungsten.CDP.Security.cdp_security_state_type(),
optional(:security_details) => cdp_security_details_type()
}
HTTP response data.
cdp_security_details_type()
View Source
cdp_security_details_type() :: %{
:protocol => String.t(),
:key_exchange => String.t(),
optional(:key_exchange_group) => String.t(),
:cipher => String.t(),
optional(:mac) => String.t(),
:certificate_id => Tungsten.CDP.Security.cdp_certificate_id_type(),
:subject_name => String.t(),
:san_list => [String.t()],
:issuer => String.t(),
:valid_from => cdp_time_since_epoch_type(),
:valid_to => cdp_time_since_epoch_type(),
:signed_certificate_timestamp_list => [
cdp_signed_certificate_timestamp_type()
],
:certificate_transparency_compliance =>
cdp_certificate_transparency_compliance_type()
}
cdp_security_details_type() :: %{
:protocol => String.t(),
:key_exchange => String.t(),
optional(:key_exchange_group) => String.t(),
:cipher => String.t(),
optional(:mac) => String.t(),
:certificate_id => Tungsten.CDP.Security.cdp_certificate_id_type(),
:subject_name => String.t(),
:san_list => [String.t()],
:issuer => String.t(),
:valid_from => cdp_time_since_epoch_type(),
:valid_to => cdp_time_since_epoch_type(),
:signed_certificate_timestamp_list => [
cdp_signed_certificate_timestamp_type()
],
:certificate_transparency_compliance =>
cdp_certificate_transparency_compliance_type()
}
Security details about a request.
cdp_signed_certificate_timestamp_type() View Source
Network.SignedCertificateTimestamp
Details of a signed certificate timestamp (SCT).
cdp_signed_exchange_error_field_type()
View Source
cdp_signed_exchange_error_field_type() ::
:signature_timestamps
| :signature_validity_url
| :signature_cert_sha256
| :signature_cert_url
| :signature_integrity
| :signature_sig
cdp_signed_exchange_error_field_type() :: :signature_timestamps | :signature_validity_url | :signature_cert_sha256 | :signature_cert_url | :signature_integrity | :signature_sig
Network.SignedExchangeErrorField
Field type for a signed exchange related error.
cdp_signed_exchange_error_type()
View Source
cdp_signed_exchange_error_type() :: %{
:message => String.t(),
optional(:signature_index) => integer(),
optional(:error_field) => cdp_signed_exchange_error_field_type()
}
cdp_signed_exchange_error_type() :: %{
:message => String.t(),
optional(:signature_index) => integer(),
optional(:error_field) => cdp_signed_exchange_error_field_type()
}
Information about a signed exchange response.
cdp_signed_exchange_header_type()
View Source
cdp_signed_exchange_header_type() :: %{
request_url: String.t(),
response_code: integer(),
response_headers: cdp_headers_type(),
signatures: [cdp_signed_exchange_signature_type()]
}
cdp_signed_exchange_header_type() :: %{
request_url: String.t(),
response_code: integer(),
response_headers: cdp_headers_type(),
signatures: [cdp_signed_exchange_signature_type()]
}
Information about a signed exchange header. https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation
cdp_signed_exchange_info_type()
View Source
cdp_signed_exchange_info_type() :: %{
:outer_response => cdp_response_type(),
optional(:header) => cdp_signed_exchange_header_type(),
optional(:security_details) => cdp_security_details_type(),
optional(:errors) => [cdp_signed_exchange_error_type()]
}
cdp_signed_exchange_info_type() :: %{
:outer_response => cdp_response_type(),
optional(:header) => cdp_signed_exchange_header_type(),
optional(:security_details) => cdp_security_details_type(),
optional(:errors) => [cdp_signed_exchange_error_type()]
}
Information about a signed exchange response.
cdp_signed_exchange_signature_type()
View Source
cdp_signed_exchange_signature_type() :: %{
:label => String.t(),
:signature => String.t(),
:integrity => String.t(),
optional(:cert_url) => String.t(),
optional(:cert_sha256) => String.t(),
:validity_url => String.t(),
:date => integer(),
:expires => integer(),
optional(:certificates) => [String.t()]
}
cdp_signed_exchange_signature_type() :: %{
:label => String.t(),
:signature => String.t(),
:integrity => String.t(),
optional(:cert_url) => String.t(),
optional(:cert_sha256) => String.t(),
:validity_url => String.t(),
:date => integer(),
:expires => integer(),
optional(:certificates) => [String.t()]
}
Network.SignedExchangeSignature
Information about a signed exchange signature. https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1
cdp_time_since_epoch_type() View Source
UTC time in seconds, counted from January 1, 1970.
cdp_web_socket_frame_type() View Source
WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.
cdp_web_socket_request_type()
View Source
cdp_web_socket_request_type() :: %{headers: cdp_headers_type()}
cdp_web_socket_request_type() :: %{headers: cdp_headers_type()}
WebSocket request data.
cdp_web_socket_response_type()
View Source
cdp_web_socket_response_type() :: %{
:status => integer(),
:status_text => String.t(),
:headers => cdp_headers_type(),
optional(:headers_text) => String.t(),
optional(:request_headers) => cdp_headers_type(),
optional(:request_headers_text) => String.t()
}
cdp_web_socket_response_type() :: %{
:status => integer(),
:status_text => String.t(),
:headers => cdp_headers_type(),
optional(:headers_text) => String.t(),
optional(:request_headers) => cdp_headers_type(),
optional(:request_headers_text) => String.t()
}
WebSocket response data.
Link to this section Functions
can_clear_browser_cache(session, parameters \\ %{}, options \\ [])
View Source
can_clear_browser_cache(
GenServer.server(),
map(),
Tungsten.Connection.exec_options()
) :: {:ok, %{result: boolean()}} | {:error, term()}
can_clear_browser_cache( GenServer.server(), map(), Tungsten.Connection.exec_options() ) :: {:ok, %{result: boolean()}} | {:error, term()}
Tells whether clearing browser cache is supported.
can_clear_browser_cookies(session, parameters \\ %{}, options \\ [])
View Source
can_clear_browser_cookies(
GenServer.server(),
map(),
Tungsten.Connection.exec_options()
) :: {:ok, %{result: boolean()}} | {:error, term()}
can_clear_browser_cookies( GenServer.server(), map(), Tungsten.Connection.exec_options() ) :: {:ok, %{result: boolean()}} | {:error, term()}
Network.canClearBrowserCookies
Tells whether clearing browser cookies is supported.
can_emulate_network_conditions(session, parameters \\ %{}, options \\ [])
View Source
can_emulate_network_conditions(
GenServer.server(),
map(),
Tungsten.Connection.exec_options()
) :: {:ok, %{result: boolean()}} | {:error, term()}
can_emulate_network_conditions( GenServer.server(), map(), Tungsten.Connection.exec_options() ) :: {:ok, %{result: boolean()}} | {:error, term()}
Network.canEmulateNetworkConditions
Tells whether emulation of network conditions is supported.
clear_browser_cache(session, parameters \\ %{}, options \\ [])
View Source
clear_browser_cache(
GenServer.server(),
map(),
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
clear_browser_cache( GenServer.server(), map(), Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Clears browser cache.
clear_browser_cookies(session, parameters \\ %{}, options \\ [])
View Source
clear_browser_cookies(
GenServer.server(),
map(),
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
clear_browser_cookies( GenServer.server(), map(), Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Clears browser cookies.
continue_intercepted_request(session, parameters, options \\ [])
View Source
continue_intercepted_request(
GenServer.server(),
%{
:interception_id => cdp_interception_id_type(),
optional(:error_reason) => cdp_error_reason_type(),
optional(:raw_response) => String.t(),
optional(:url) => String.t(),
optional(:method) => String.t(),
optional(:post_data) => String.t(),
optional(:headers) => cdp_headers_type(),
optional(:auth_challenge_response) => cdp_auth_challenge_response_type()
},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
continue_intercepted_request( GenServer.server(), %{ :interception_id => cdp_interception_id_type(), optional(:error_reason) => cdp_error_reason_type(), optional(:raw_response) => String.t(), optional(:url) => String.t(), optional(:method) => String.t(), optional(:post_data) => String.t(), optional(:headers) => cdp_headers_type(), optional(:auth_challenge_response) => cdp_auth_challenge_response_type() }, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Network.continueInterceptedRequest
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.
delete_cookies(session, parameters, options \\ [])
View Source
delete_cookies(
GenServer.server(),
%{
:name => String.t(),
optional(:url) => String.t(),
optional(:domain) => String.t(),
optional(:path) => String.t()
},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
delete_cookies( GenServer.server(), %{ :name => String.t(), optional(:url) => String.t(), optional(:domain) => String.t(), optional(:path) => String.t() }, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Deletes browser cookies with matching name and url or domain/path pair.
disable(session, parameters \\ %{}, options \\ [])
View Source
disable(GenServer.server(), map(), Tungsten.Connection.exec_options()) ::
{:ok, map()} | {:error, term()}
disable(GenServer.server(), map(), Tungsten.Connection.exec_options()) :: {:ok, map()} | {:error, term()}
Disables network tracking, prevents network events from being sent to the client.
emulate_network_conditions(session, parameters, options \\ [])
View Source
emulate_network_conditions(
GenServer.server(),
%{
:offline => boolean(),
:latency => integer() | float(),
:download_throughput => integer() | float(),
:upload_throughput => integer() | float(),
optional(:connection_type) => cdp_connection_type_type()
},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
emulate_network_conditions( GenServer.server(), %{ :offline => boolean(), :latency => integer() | float(), :download_throughput => integer() | float(), :upload_throughput => integer() | float(), optional(:connection_type) => cdp_connection_type_type() }, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Network.emulateNetworkConditions
Activates emulation of network conditions.
enable(session, parameters \\ %{}, options \\ [])
View Source
enable(
GenServer.server(),
%{
optional(:max_total_buffer_size) => integer(),
optional(:max_resource_buffer_size) => integer(),
optional(:max_post_data_size) => integer()
},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
enable( GenServer.server(), %{ optional(:max_total_buffer_size) => integer(), optional(:max_resource_buffer_size) => integer(), optional(:max_post_data_size) => integer() }, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Enables network tracking, network events will now be delivered to the client.
get_all_cookies(session, parameters \\ %{}, options \\ [])
View Source
get_all_cookies(GenServer.server(), map(), Tungsten.Connection.exec_options()) ::
{:ok, %{cookies: [cdp_cookie_type()]}} | {:error, term()}
get_all_cookies(GenServer.server(), map(), Tungsten.Connection.exec_options()) :: {:ok, %{cookies: [cdp_cookie_type()]}} | {:error, term()}
Returns all browser cookies. Depending on the backend support, will return detailed cookie
information in the cookies field.
get_certificate(session, parameters, options \\ [])
View Source
get_certificate(
GenServer.server(),
%{origin: String.t()},
Tungsten.Connection.exec_options()
) :: {:ok, %{table_names: [String.t()]}} | {:error, term()}
get_certificate( GenServer.server(), %{origin: String.t()}, Tungsten.Connection.exec_options() ) :: {:ok, %{table_names: [String.t()]}} | {:error, term()}
Returns the DER-encoded certificate.
get_cookies(session, parameters \\ %{}, options \\ [])
View Source
get_cookies(
GenServer.server(),
%{optional(:urls) => [String.t()]},
Tungsten.Connection.exec_options()
) :: {:ok, %{cookies: [cdp_cookie_type()]}} | {:error, term()}
get_cookies( GenServer.server(), %{optional(:urls) => [String.t()]}, Tungsten.Connection.exec_options() ) :: {:ok, %{cookies: [cdp_cookie_type()]}} | {:error, term()}
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(session, parameters, options \\ [])
View Source
get_request_post_data(
GenServer.server(),
%{request_id: cdp_request_id_type()},
Tungsten.Connection.exec_options()
) :: {:ok, %{post_data: String.t()}} | {:error, term()}
get_request_post_data( GenServer.server(), %{request_id: cdp_request_id_type()}, Tungsten.Connection.exec_options() ) :: {:ok, %{post_data: String.t()}} | {:error, term()}
Returns post data sent with the request. Returns an error when no data was sent with the request.
get_response_body(session, parameters, options \\ [])
View Source
get_response_body(
GenServer.server(),
%{request_id: cdp_request_id_type()},
Tungsten.Connection.exec_options()
) :: {:ok, %{body: String.t(), base64_encoded: boolean()}} | {:error, term()}
get_response_body( GenServer.server(), %{request_id: cdp_request_id_type()}, Tungsten.Connection.exec_options() ) :: {:ok, %{body: String.t(), base64_encoded: boolean()}} | {:error, term()}
Returns content served for the given request.
get_response_body_for_interception(session, parameters, options \\ [])
View Source
get_response_body_for_interception(
GenServer.server(),
%{interception_id: cdp_interception_id_type()},
Tungsten.Connection.exec_options()
) :: {:ok, %{body: String.t(), base64_encoded: boolean()}} | {:error, term()}
get_response_body_for_interception( GenServer.server(), %{interception_id: cdp_interception_id_type()}, Tungsten.Connection.exec_options() ) :: {:ok, %{body: String.t(), base64_encoded: boolean()}} | {:error, term()}
Network.getResponseBodyForInterception
Returns content served for the given currently intercepted request.
replay_xhr(session, parameters, options \\ [])
View Source
replay_xhr(
GenServer.server(),
%{request_id: cdp_request_id_type()},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
replay_xhr( GenServer.server(), %{request_id: cdp_request_id_type()}, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
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.
search_in_response_body(session, parameters, options \\ [])
View Source
search_in_response_body(
GenServer.server(),
%{
:request_id => cdp_request_id_type(),
:query => String.t(),
optional(:case_sensitive) => boolean(),
optional(:is_regex) => boolean()
},
Tungsten.Connection.exec_options()
) ::
{:ok, %{result: [Tungsten.CDP.Debugger.cdp_search_match_type()]}}
| {:error, term()}
search_in_response_body( GenServer.server(), %{ :request_id => cdp_request_id_type(), :query => String.t(), optional(:case_sensitive) => boolean(), optional(:is_regex) => boolean() }, Tungsten.Connection.exec_options() ) :: {:ok, %{result: [Tungsten.CDP.Debugger.cdp_search_match_type()]}} | {:error, term()}
Searches for given string in response content.
set_blocked_ur_ls(session, parameters, options \\ [])
View Source
set_blocked_ur_ls(
GenServer.server(),
%{urls: [String.t()]},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
set_blocked_ur_ls( GenServer.server(), %{urls: [String.t()]}, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Blocks URLs from loading.
set_bypass_service_worker(session, parameters, options \\ [])
View Source
set_bypass_service_worker(
GenServer.server(),
%{bypass: boolean()},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
set_bypass_service_worker( GenServer.server(), %{bypass: boolean()}, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Network.setBypassServiceWorker
Toggles ignoring of service worker for each request.
set_cache_disabled(session, parameters, options \\ [])
View Source
set_cache_disabled(
GenServer.server(),
%{cache_disabled: boolean()},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
set_cache_disabled( GenServer.server(), %{cache_disabled: boolean()}, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Toggles ignoring cache for each request. If true, cache will not be used.
set_cookie(session, parameters, options \\ [])
View Source
set_cookie(
GenServer.server(),
%{
:name => String.t(),
:value => String.t(),
optional(:url) => String.t(),
optional(:domain) => String.t(),
optional(:path) => String.t(),
optional(:secure) => boolean(),
optional(:http_only) => boolean(),
optional(:same_site) => cdp_cookie_same_site_type(),
optional(:expires) => cdp_time_since_epoch_type()
},
Tungsten.Connection.exec_options()
) :: {:ok, %{success: boolean()}} | {:error, term()}
set_cookie( GenServer.server(), %{ :name => String.t(), :value => String.t(), optional(:url) => String.t(), optional(:domain) => String.t(), optional(:path) => String.t(), optional(:secure) => boolean(), optional(:http_only) => boolean(), optional(:same_site) => cdp_cookie_same_site_type(), optional(:expires) => cdp_time_since_epoch_type() }, Tungsten.Connection.exec_options() ) :: {:ok, %{success: boolean()}} | {:error, term()}
Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
set_cookies(session, parameters, options \\ [])
View Source
set_cookies(
GenServer.server(),
%{cookies: [cdp_cookie_param_type()]},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
set_cookies( GenServer.server(), %{cookies: [cdp_cookie_param_type()]}, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Sets given cookies.
set_data_size_limits_for_test(session, parameters, options \\ [])
View Source
set_data_size_limits_for_test(
GenServer.server(),
%{max_total_size: integer(), max_resource_size: integer()},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
set_data_size_limits_for_test( GenServer.server(), %{max_total_size: integer(), max_resource_size: integer()}, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Network.setDataSizeLimitsForTest
For testing.
set_extra_http_headers(session, parameters, options \\ [])
View Source
set_extra_http_headers(
GenServer.server(),
%{headers: cdp_headers_type()},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
set_extra_http_headers( GenServer.server(), %{headers: cdp_headers_type()}, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Specifies whether to always send extra HTTP headers with the requests from this page.
set_request_interception(session, parameters, options \\ [])
View Source
set_request_interception(
GenServer.server(),
%{patterns: [cdp_request_pattern_type()]},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
set_request_interception( GenServer.server(), %{patterns: [cdp_request_pattern_type()]}, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Network.setRequestInterception
Sets the requests to intercept that match the provided patterns and optionally resource types.
set_user_agent_override(session, parameters, options \\ [])
View Source
set_user_agent_override(
GenServer.server(),
%{
:user_agent => String.t(),
optional(:accept_language) => String.t(),
optional(:platform) => String.t()
},
Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}
set_user_agent_override( GenServer.server(), %{ :user_agent => String.t(), optional(:accept_language) => String.t(), optional(:platform) => String.t() }, Tungsten.Connection.exec_options() ) :: {:ok, map()} | {:error, term()}
Allows overriding user agent with the given string.
take_response_body_for_interception_as_stream(session, parameters, options \\ [])
View Source
take_response_body_for_interception_as_stream(
GenServer.server(),
%{interception_id: cdp_interception_id_type()},
Tungsten.Connection.exec_options()
) ::
{:ok, %{stream: Tungsten.CDP.IO.cdp_stream_handle_type()}} | {:error, term()}
take_response_body_for_interception_as_stream( GenServer.server(), %{interception_id: cdp_interception_id_type()}, Tungsten.Connection.exec_options() ) :: {:ok, %{stream: Tungsten.CDP.IO.cdp_stream_handle_type()}} | {:error, term()}
Network.takeResponseBodyForInterceptionAsStream
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.