CDPotion.Domain.Page (cdpotion v0.1.4)
Summary
Types
description not provided :(
Indicates whether a frame has been identified as an ad and why.
Indicates whether a frame has been identified as an ad.
Identifies the bottom-most script which caused the frame to be labelled as an ad.
Error while paring app manifest.
Parsed app manifest properties.
Enum of possible auto-reponse for permisison / prompt dialogs.
description not provided :(
description not provided :(
List of not restored reasons for back-forward cache.
Types of not restored reasons for back-forward cache.
description not provided :(
description not provided :(
Per-script compilation cache parameters for Page.produceCompilationCache
Indicates whether the frame is cross-origin isolated and why it is the case.
Javascript dialog type.
Generic font families collection.
Default font sizes.
Information about the Frame on the page.
Unique frame identifier.
Information about the Resource on the page.
Information about the Frame hierarchy along with their cached resources.
Information about the Frame hierarchy.
description not provided :(
The installability error
description not provided :(
Layout viewport position and dimensions.
Navigation history entry.
The type of a frameNavigated event.
description not provided :(
Status for an Origin Trial.
description not provided :(
Origin Trial(https://www.chromium.org/blink/origin-trials) support. Status for an Origin Trial token.
description not provided :(
description not provided :(
description not provided :(
Reason for a permissions policy feature to be disabled.
All Permissions Policy features. This enum should match the one defined in third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5.
description not provided :(
The referring-policy used for the navigation.
Screencast frame metadata.
Font families collection for a script.
Unique script identifier.
Indicates whether the frame is a secure context and why it is the case.
Transition type.
Viewport for capturing screenshot.
Visual viewport position, dimensions, and scale.
Functions
Seeds compilation cache for given url. Compilation cache does not survive cross-process navigation.
Deprecated, please use addScriptToEvaluateOnNewDocument instead.
Evaluates given script in every frame upon creation (before loading frame's scripts).
Brings page to front (activates tab).
Capture page screenshot.
Returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles.
Clears seeded compilation cache.
Clears the overridden device metrics.
Clears the overridden Device Orientation.
Clears the overridden Geolocation Position and Error.
Tries to close page, running its beforeunload hooks, if any.
Crashes renderer on the IO thread, generates minidumps.
Creates an isolated world for the given frame.
Deletes browser cookie with given name, domain and path.
Disables page domain notifications.
Enables page domain notifications.
Generates a report for testing.
Parameters:
- (Required)
frame_id
: description not provided :(
Returns the unique (PWA) app id. Only returns values if the feature flag 'WebAppEnableManifestId' is enabled
Returns all browser cookies for the page and all of its subframes. Depending
on the backend support, will return detailed cookie information in the
cookies
field.
Returns present frame tree structure.
Returns metrics relating to the layouting of the page, such as viewport bounds/scale.
Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation.
Returns navigation history for the current page.
Get Origin Trials on given frame.
Get Permissions Policy state on given frame.
Returns content of the given resource.
Returns present frame / resource tree structure.
Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
Navigates current page to the given URL.
Navigates current page to the given history entry.
Requests backend to produce compilation cache for the specified scripts.
scripts
are appeneded to the list of scripts for which the cache
would be produced. The list may be reset during page navigation.
When script with a matching URL is encountered, the cache is optionally
produced upon backend discretion, based on internal heuristics.
See also: Page.compilationCacheProduced
.
Reloads given page optionally ignoring the cache.
Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
Removes given script from the list.
Resets navigation history for the current page.
Acknowledges that a screencast frame has been received by the frontend.
Searches for given string in resource content.
Enable Chrome's experimental ad filter on all sites.
Enable page Content Security Policy by-passing.
Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).
Overrides the Device Orientation.
Sets given markup as the document's HTML.
Set the behavior when downloading a file.
Set generic font families.
Set default font sizes.
Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.
Intercept file chooser requests and transfer control to protocol clients.
When file chooser interception is enabled, native file chooser dialog is not shown.
Instead, a protocol event Page.fileChooserOpened
is emitted.
Controls whether page will emit lifecycle events.
Enable/disable prerendering manually. This command is a short-term solution for https://crbug.com/1440085. See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA for more details. TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets.
Extensions for Custom Handlers API: https://html.spec.whatwg.org/multipage/system-state.html#rph-automation
Sets the Secure Payment Confirmation transaction mode. https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode
Toggles mouse event-based touch event emulation.
Tries to update the web lifecycle state of the page. It will transition the page to the given state according to: https://github.com/WICG/web-lifecycle/
Starts sending each frame using the screencastFrame
event.
Force the page stop all navigations and pending resource fetches.
Stops sending each frame in the screencastFrame
.
Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger.
Types
ad_frame_explanation()
@type ad_frame_explanation() ::
:ParentIsAd | :CreatedByAdScript | :MatchedBlockingRule
description not provided :(
ad_frame_status()
@type ad_frame_status() :: %{ adFrameType: ad_frame_type(), explanations: [ad_frame_explanation()] | nil }
Indicates whether a frame has been identified as an ad and why.
ad_frame_type()
@type ad_frame_type() :: :none | :child | :root
Indicates whether a frame has been identified as an ad.
ad_script_id()
@type ad_script_id() :: %{ debuggerId: CDPotion.Domain.Runtime.unique_debugger_id(), scriptId: CDPotion.Domain.Runtime.script_id() }
Identifies the bottom-most script which caused the frame to be labelled as an ad.
app_manifest_error()
@type app_manifest_error() :: %{ column: integer(), critical: integer(), line: integer(), message: String.t() }
Error while paring app manifest.
app_manifest_parsed_properties()
@type app_manifest_parsed_properties() :: %{scope: String.t()}
Parsed app manifest properties.
auto_response_mode()
@type auto_response_mode() :: :none | :autoAccept | :autoReject | :autoOptOut
Enum of possible auto-reponse for permisison / prompt dialogs.
back_forward_cache_not_restored_explanation()
@type back_forward_cache_not_restored_explanation() :: %{ context: String.t() | nil, reason: back_forward_cache_not_restored_reason(), type: back_forward_cache_not_restored_reason_type() }
description not provided :(
back_forward_cache_not_restored_explanation_tree()
@type back_forward_cache_not_restored_explanation_tree() :: %{ children: [back_forward_cache_not_restored_explanation_tree()], explanations: [back_forward_cache_not_restored_explanation()], url: String.t() }
description not provided :(
back_forward_cache_not_restored_reason()
@type back_forward_cache_not_restored_reason() ::
:NotPrimaryMainFrame
| :BackForwardCacheDisabled
| :RelatedActiveContentsExist
| :HTTPStatusNotOK
| :SchemeNotHTTPOrHTTPS
| :Loading
| :WasGrantedMediaAccess
| :DisableForRenderFrameHostCalled
| :DomainNotAllowed
| :HTTPMethodNotGET
| :SubframeIsNavigating
| :Timeout
| :CacheLimit
| :JavaScriptExecution
| :RendererProcessKilled
| :RendererProcessCrashed
| :SchedulerTrackedFeatureUsed
| :ConflictingBrowsingInstance
| :CacheFlushed
| :ServiceWorkerVersionActivation
| :SessionRestored
| :ServiceWorkerPostMessage
| :EnteredBackForwardCacheBeforeServiceWorkerHostAdded
| :RenderFrameHostReused_SameSite
| :RenderFrameHostReused_CrossSite
| :ServiceWorkerClaim
| :IgnoreEventAndEvict
| :HaveInnerContents
| :TimeoutPuttingInCache
| :BackForwardCacheDisabledByLowMemory
| :BackForwardCacheDisabledByCommandLine
| :NetworkRequestDatapipeDrainedAsBytesConsumer
| :NetworkRequestRedirected
| :NetworkRequestTimeout
| :NetworkExceedsBufferLimit
| :NavigationCancelledWhileRestoring
| :NotMostRecentNavigationEntry
| :BackForwardCacheDisabledForPrerender
| :UserAgentOverrideDiffers
| :ForegroundCacheLimit
| :BrowsingInstanceNotSwapped
| :BackForwardCacheDisabledForDelegate
| :UnloadHandlerExistsInMainFrame
| :UnloadHandlerExistsInSubFrame
| :ServiceWorkerUnregistration
| :CacheControlNoStore
| :CacheControlNoStoreCookieModified
| :CacheControlNoStoreHTTPOnlyCookieModified
| :NoResponseHead
| :Unknown
| :ActivationNavigationsDisallowedForBug1234857
| :ErrorDocument
| :FencedFramesEmbedder
| :CookieDisabled
| :HTTPAuthRequired
| :CookieFlushed
| :WebSocket
| :WebTransport
| :WebRTC
| :MainResourceHasCacheControlNoStore
| :MainResourceHasCacheControlNoCache
| :SubresourceHasCacheControlNoStore
| :SubresourceHasCacheControlNoCache
| :ContainsPlugins
| :DocumentLoaded
| :DedicatedWorkerOrWorklet
| :OutstandingNetworkRequestOthers
| :RequestedMIDIPermission
| :RequestedAudioCapturePermission
| :RequestedVideoCapturePermission
| :RequestedBackForwardCacheBlockedSensors
| :RequestedBackgroundWorkPermission
| :BroadcastChannel
| :WebXR
| :SharedWorker
| :WebLocks
| :WebHID
| :WebShare
| :RequestedStorageAccessGrant
| :WebNfc
| :OutstandingNetworkRequestFetch
| :OutstandingNetworkRequestXHR
| :AppBanner
| :Printing
| :WebDatabase
| :PictureInPicture
| :Portal
| :SpeechRecognizer
| :IdleManager
| :PaymentManager
| :SpeechSynthesis
| :KeyboardLock
| :WebOTPService
| :OutstandingNetworkRequestDirectSocket
| :InjectedJavascript
| :InjectedStyleSheet
| :KeepaliveRequest
| :IndexedDBEvent
| :Dummy
| :JsNetworkRequestReceivedCacheControlNoStoreResource
| :WebRTCSticky
| :WebTransportSticky
| :WebSocketSticky
| :ContentSecurityHandler
| :ContentWebAuthenticationAPI
| :ContentFileChooser
| :ContentSerial
| :ContentFileSystemAccess
| :ContentMediaDevicesDispatcherHost
| :ContentWebBluetooth
| :ContentWebUSB
| :ContentMediaSessionService
| :ContentScreenReader
| :EmbedderPopupBlockerTabHelper
| :EmbedderSafeBrowsingTriggeredPopupBlocker
| :EmbedderSafeBrowsingThreatDetails
| :EmbedderAppBannerManager
| :EmbedderDomDistillerViewerSource
| :EmbedderDomDistillerSelfDeletingRequestDelegate
| :EmbedderOomInterventionTabHelper
| :EmbedderOfflinePage
| :EmbedderChromePasswordManagerClientBindCredentialManager
| :EmbedderPermissionRequestManager
| :EmbedderModalDialog
| :EmbedderExtensions
| :EmbedderExtensionMessaging
| :EmbedderExtensionMessagingForOpenPort
| :EmbedderExtensionSentMessageToCachedFrame
List of not restored reasons for back-forward cache.
back_forward_cache_not_restored_reason_type()
@type back_forward_cache_not_restored_reason_type() ::
:SupportPending | :PageSupportNeeded | :Circumstantial
Types of not restored reasons for back-forward cache.
compilation_cache_params()
Per-script compilation cache parameters for Page.produceCompilationCache
cross_origin_isolated_context_type()
@type cross_origin_isolated_context_type() ::
:Isolated | :NotIsolated | :NotIsolatedFeatureDisabled
Indicates whether the frame is cross-origin isolated and why it is the case.
dialog_type()
@type dialog_type() :: :alert | :confirm | :prompt | :beforeunload
Javascript dialog type.
font_families()
@type font_families() :: %{ cursive: String.t() | nil, fantasy: String.t() | nil, fixed: String.t() | nil, math: String.t() | nil, sansSerif: String.t() | nil, serif: String.t() | nil, standard: String.t() | nil }
Generic font families collection.
font_sizes()
Default font sizes.
frame()
@type frame() :: %{ adFrameStatus: ad_frame_status() | nil, crossOriginIsolatedContextType: cross_origin_isolated_context_type(), domainAndRegistry: String.t(), gatedAPIFeatures: [gated_api_features()], id: frame_id(), loaderId: CDPotion.Domain.Network.loader_id(), mimeType: String.t(), name: String.t() | nil, parentId: frame_id() | nil, secureContextType: secure_context_type(), securityOrigin: String.t(), unreachableUrl: String.t() | nil, url: String.t(), urlFragment: String.t() | nil }
Information about the Frame on the page.
frame_id()
@type frame_id() :: String.t()
Unique frame identifier.
frame_resource()
@type frame_resource() :: %{ canceled: boolean() | nil, contentSize: number() | nil, failed: boolean() | nil, lastModified: CDPotion.Domain.Network.time_since_epoch() | nil, mimeType: String.t(), type: CDPotion.Domain.Network.resource_type(), url: String.t() }
Information about the Resource on the page.
frame_resource_tree()
@type frame_resource_tree() :: %{ childFrames: [frame_resource_tree()] | nil, frame: frame(), resources: [frame_resource()] }
Information about the Frame hierarchy along with their cached resources.
frame_tree()
@type frame_tree() :: %{childFrames: [frame_tree()] | nil, frame: frame()}
Information about the Frame hierarchy.
gated_api_features()
@type gated_api_features() ::
:SharedArrayBuffers
| :SharedArrayBuffersTransferAllowed
| :PerformanceMeasureMemory
| :PerformanceProfile
description not provided :(
installability_error()
@type installability_error() :: %{ errorArguments: [installability_error_argument()], errorId: String.t() }
The installability error
installability_error_argument()
description not provided :(
layout_viewport()
@type layout_viewport() :: %{ clientHeight: integer(), clientWidth: integer(), pageX: integer(), pageY: integer() }
Layout viewport position and dimensions.
origin_trial()
@type origin_trial() :: %{ status: origin_trial_status(), tokensWithStatus: [origin_trial_token_with_status()], trialName: String.t() }
description not provided :(
origin_trial_status()
@type origin_trial_status() ::
:Enabled | :ValidTokenNotProvided | :OSNotSupported | :TrialNotAllowed
Status for an Origin Trial.
origin_trial_token()
@type origin_trial_token() :: %{ expiryTime: CDPotion.Domain.Network.time_since_epoch(), isThirdParty: boolean(), matchSubDomains: boolean(), origin: String.t(), trialName: String.t(), usageRestriction: origin_trial_usage_restriction() }
description not provided :(
origin_trial_token_status()
@type origin_trial_token_status() ::
:Success
| :NotSupported
| :Insecure
| :Expired
| :WrongOrigin
| :InvalidSignature
| :Malformed
| :WrongVersion
| :FeatureDisabled
| :TokenDisabled
| :FeatureDisabledForUser
| :UnknownTrial
Origin Trial(https://www.chromium.org/blink/origin-trials) support. Status for an Origin Trial token.
origin_trial_token_with_status()
@type origin_trial_token_with_status() :: %{ parsedToken: origin_trial_token() | nil, rawTokenText: String.t(), status: origin_trial_token_status() }
description not provided :(
origin_trial_usage_restriction()
@type origin_trial_usage_restriction() :: :None | :Subset
description not provided :(
permissions_policy_block_locator()
@type permissions_policy_block_locator() :: %{ blockReason: permissions_policy_block_reason(), frameId: frame_id() }
description not provided :(
permissions_policy_block_reason()
@type permissions_policy_block_reason() ::
:Header | :IframeAttribute | :InFencedFrameTree | :InIsolatedApp
Reason for a permissions policy feature to be disabled.
permissions_policy_feature()
@type permissions_policy_feature() ::
:accelerometer
| :"ambient-light-sensor"
| :"attribution-reporting"
| :autoplay
| :bluetooth
| :"browsing-topics"
| :camera
| :"ch-dpr"
| :"ch-device-memory"
| :"ch-downlink"
| :"ch-ect"
| :"ch-prefers-color-scheme"
| :"ch-prefers-reduced-motion"
| :"ch-rtt"
| :"ch-save-data"
| :"ch-ua"
| :"ch-ua-arch"
| :"ch-ua-bitness"
| :"ch-ua-platform"
| :"ch-ua-model"
| :"ch-ua-mobile"
| :"ch-ua-form-factor"
| :"ch-ua-full-version"
| :"ch-ua-full-version-list"
| :"ch-ua-platform-version"
| :"ch-ua-wow64"
| :"ch-viewport-height"
| :"ch-viewport-width"
| :"ch-width"
| :"clipboard-read"
| :"clipboard-write"
| :"compute-pressure"
| :"cross-origin-isolated"
| :"direct-sockets"
| :"display-capture"
| :"document-domain"
| :"encrypted-media"
| :"execution-while-out-of-viewport"
| :"execution-while-not-rendered"
| :"focus-without-user-activation"
| :fullscreen
| :frobulate
| :gamepad
| :geolocation
| :gyroscope
| :hid
| :"identity-credentials-get"
| :"idle-detection"
| :"interest-cohort"
| :"join-ad-interest-group"
| :"keyboard-map"
| :"local-fonts"
| :magnetometer
| :microphone
| :midi
| :"otp-credentials"
| :payment
| :"picture-in-picture"
| :"private-aggregation"
| :"private-state-token-issuance"
| :"private-state-token-redemption"
| :"publickey-credentials-get"
| :"run-ad-auction"
| :"screen-wake-lock"
| :serial
| :"shared-autofill"
| :"shared-storage"
| :"shared-storage-select-url"
| :"smart-card"
| :"storage-access"
| :"sync-xhr"
| :unload
| :usb
| :"vertical-scroll"
| :"web-share"
| :"window-management"
| :"window-placement"
| :"xr-spatial-tracking"
All Permissions Policy features. This enum should match the one defined in third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5.
permissions_policy_feature_state()
@type permissions_policy_feature_state() :: %{ allowed: boolean(), feature: permissions_policy_feature(), locator: permissions_policy_block_locator() | nil }
description not provided :(
referrer_policy()
@type referrer_policy() ::
:noReferrer
| :noReferrerWhenDowngrade
| :origin
| :originWhenCrossOrigin
| :sameOrigin
| :strictOrigin
| :strictOriginWhenCrossOrigin
| :unsafeUrl
The referring-policy used for the navigation.
screencast_frame_metadata()
@type screencast_frame_metadata() :: %{ deviceHeight: number(), deviceWidth: number(), offsetTop: number(), pageScaleFactor: number(), scrollOffsetX: number(), scrollOffsetY: number(), timestamp: CDPotion.Domain.Network.time_since_epoch() | nil }
Screencast frame metadata.
script_font_families()
@type script_font_families() :: %{fontFamilies: font_families(), script: String.t()}
Font families collection for a script.
script_identifier()
@type script_identifier() :: String.t()
Unique script identifier.
secure_context_type()
@type secure_context_type() ::
:Secure | :SecureLocalhost | :InsecureScheme | :InsecureAncestor
Indicates whether the frame is a secure context and why it is the case.
transition_type()
@type transition_type() ::
:link
| :typed
| :address_bar
| :auto_bookmark
| :auto_subframe
| :manual_subframe
| :generated
| :auto_toplevel
| :form_submit
| :reload
| :keyword
| :keyword_generated
| :other
Transition type.
viewport()
@type viewport() :: %{ height: number(), scale: number(), width: number(), x: number(), y: number() }
Viewport for capturing screenshot.
visual_viewport()
@type visual_viewport() :: %{ clientHeight: number(), clientWidth: number(), offsetX: number(), offsetY: number(), pageX: number(), pageY: number(), scale: number(), zoom: number() | nil }
Visual viewport position, dimensions, and scale.
Functions
add_compilation_cache(url, data)
Seeds compilation cache for given url. Compilation cache does not survive cross-process navigation.
Parameters:
- (Required)
url
: description not provided :( - (Required)
data
: Base64-encoded data (Encoded as a base64 string when passed over JSON)
add_script_to_evaluate_on_load(script_source)
Deprecated, please use addScriptToEvaluateOnNewDocument instead.
Parameters:
- (Required)
script_source
: description not provided :(
add_script_to_evaluate_on_new_document(source, world_name \\ nil, include_command_line_api \\ nil, run_immediately \\ nil)
@spec add_script_to_evaluate_on_new_document( String.t(), String.t(), boolean(), boolean() ) :: {String.t(), map()}
Evaluates given script in every frame upon creation (before loading frame's scripts).
Parameters:
- (Required)
source
: description not provided :( - (Optional)
world_name
: If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted. - (Optional)
include_command_line_api
: Specifies whether command line API should be available to the script, defaults to false. - (Optional)
run_immediately
: If true, runs the script immediately on existing execution contexts or worlds. Default: false.
bring_to_front()
Brings page to front (activates tab).
capture_screenshot(format \\ nil, quality \\ nil, clip \\ nil, from_surface \\ nil, capture_beyond_viewport \\ nil, optimize_for_speed \\ nil)
@spec capture_screenshot( String.t(), integer(), viewport(), boolean(), boolean(), boolean() ) :: {String.t(), map()}
Capture page screenshot.
Parameters:
- (Optional)
format
: Image compression format (defaults to png). - (Optional)
quality
: Compression quality from range [0..100] (jpeg only). - (Optional)
clip
: Capture the screenshot of a given region only. - (Optional)
from_surface
: Capture the screenshot from the surface, rather than the view. Defaults to true. - (Optional)
capture_beyond_viewport
: Capture the screenshot beyond the viewport. Defaults to false. - (Optional)
optimize_for_speed
: Optimize image encoding for speed, not for resulting size (defaults to false)
capture_snapshot(format \\ nil)
Returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles.
Parameters:
- (Optional)
format
: Format (defaults to mhtml).
clear_compilation_cache()
Clears seeded compilation cache.
clear_device_metrics_override()
Clears the overridden device metrics.
clear_device_orientation_override()
Clears the overridden Device Orientation.
clear_geolocation_override()
Clears the overridden Geolocation Position and Error.
close()
Tries to close page, running its beforeunload hooks, if any.
crash()
Crashes renderer on the IO thread, generates minidumps.
create_isolated_world(frame_id, world_name \\ nil, grant_univeral_access \\ nil)
Creates an isolated world for the given frame.
Parameters:
- (Required)
frame_id
: Id of the frame in which the isolated world should be created. - (Optional)
world_name
: An optional name which is reported in the Execution Context. - (Optional)
grant_univeral_access
: Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.
delete_cookie(cookie_name, url)
Deletes browser cookie with given name, domain and path.
Parameters:
- (Required)
cookie_name
: Name of the cookie to remove. - (Required)
url
: URL to match cooke domain and path.
disable()
Disables page domain notifications.
enable()
Enables page domain notifications.
generate_test_report(message, group \\ nil)
Generates a report for testing.
Parameters:
- (Required)
message
: Message to be displayed in the report. - (Optional)
group
: Specifies the endpoint group to deliver the report to.
get_ad_script_id(frame_id)
Parameters:
- (Required)
frame_id
: description not provided :(
get_app_id()
Returns the unique (PWA) app id. Only returns values if the feature flag 'WebAppEnableManifestId' is enabled
get_app_manifest()
get_cookies()
Returns all browser cookies for the page and all of its subframes. Depending
on the backend support, will return detailed cookie information in the
cookies
field.
get_frame_tree()
Returns present frame tree structure.
get_installability_errors()
get_layout_metrics()
Returns metrics relating to the layouting of the page, such as viewport bounds/scale.
get_manifest_icons()
Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation.
get_origin_trials(frame_id)
Get Origin Trials on given frame.
Parameters:
- (Required)
frame_id
: description not provided :(
get_permissions_policy_state(frame_id)
Get Permissions Policy state on given frame.
Parameters:
- (Required)
frame_id
: description not provided :(
get_resource_content(frame_id, url)
Returns content of the given resource.
Parameters:
- (Required)
frame_id
: Frame id to get resource for. - (Required)
url
: URL of the resource to get content for.
get_resource_tree()
Returns present frame / resource tree structure.
handle_java_script_dialog(accept, prompt_text \\ nil)
Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
Parameters:
- (Required)
accept
: Whether to accept or dismiss the dialog. - (Optional)
prompt_text
: The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.
print_to_pdf(landscape \\ nil, display_header_footer \\ nil, print_background \\ nil, scale \\ nil, paper_width \\ nil, paper_height \\ nil, margin_top \\ nil, margin_bottom \\ nil, margin_left \\ nil, margin_right \\ nil, page_ranges \\ nil, header_template \\ nil, footer_template \\ nil, prefer_css_page_size \\ nil, transfer_mode \\ nil)
@spec print_to_pdf( boolean(), boolean(), boolean(), number(), number(), number(), number(), number(), number(), number(), String.t(), String.t(), String.t(), boolean(), String.t() ) :: {String.t(), map()}
Print page as PDF.
Parameters:
- (Optional)
landscape
: Paper orientation. Defaults to false. - (Optional)
display_header_footer
: Display header and footer. Defaults to false. - (Optional)
print_background
: Print background graphics. Defaults to false. - (Optional)
scale
: Scale of the webpage rendering. Defaults to 1. - (Optional)
paper_width
: Paper width in inches. Defaults to 8.5 inches. - (Optional)
paper_height
: Paper height in inches. Defaults to 11 inches. - (Optional)
margin_top
: Top margin in inches. Defaults to 1cm (~0.4 inches). - (Optional)
margin_bottom
: Bottom margin in inches. Defaults to 1cm (~0.4 inches). - (Optional)
margin_left
: Left margin in inches. Defaults to 1cm (~0.4 inches). - (Optional)
margin_right
: Right margin in inches. Defaults to 1cm (~0.4 inches). - (Optional)
page_ranges
: Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are printed in the document order, not in the order specified, and no more than once. Defaults to empty string, which implies the entire document is printed. The page numbers are quietly capped to actual page count of the document, and ranges beyond the end of the document are ignored. If this results in no pages to print, an error is reported. It is an error to specify a range with start greater than end. - (Optional)
header_template
: HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: date
: formatted print datetitle
: document titleurl
: document locationpageNumber
: current page numbertotalPages
: total pages in the document For example,<span class=title></span>
would generate span containing the title.- (Optional)
footer_template
: HTML template for the print footer. Should use the same format as theheaderTemplate
. - (Optional)
prefer_css_page_size
: Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. - (Optional)
transfer_mode
: return as stream
produce_compilation_cache(scripts)
@spec produce_compilation_cache([compilation_cache_params()]) :: {String.t(), map()}
Requests backend to produce compilation cache for the specified scripts.
scripts
are appeneded to the list of scripts for which the cache
would be produced. The list may be reset during page navigation.
When script with a matching URL is encountered, the cache is optionally
produced upon backend discretion, based on internal heuristics.
See also: Page.compilationCacheProduced
.
Parameters:
- (Required)
scripts
: description not provided :(
reload(ignore_cache \\ nil, script_to_evaluate_on_load \\ nil)
Reloads given page optionally ignoring the cache.
Parameters:
- (Optional)
ignore_cache
: If true, browser cache is ignored (as if the user pressed Shift+refresh). - (Optional)
script_to_evaluate_on_load
: If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin.
remove_script_to_evaluate_on_load(identifier)
@spec remove_script_to_evaluate_on_load(script_identifier()) :: {String.t(), map()}
Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
Parameters:
- (Required)
identifier
: description not provided :(
remove_script_to_evaluate_on_new_document(identifier)
@spec remove_script_to_evaluate_on_new_document(script_identifier()) :: {String.t(), map()}
Removes given script from the list.
Parameters:
- (Required)
identifier
: description not provided :(
screencast_frame_ack(session_id)
Acknowledges that a screencast frame has been received by the frontend.
Parameters:
- (Required)
session_id
: Frame number.
search_in_resource(frame_id, url, query, case_sensitive \\ nil, is_regex \\ nil)
@spec search_in_resource( frame_id(), String.t(), String.t(), boolean(), boolean() ) :: {String.t(), map()}
Searches for given string in resource content.
Parameters:
- (Required)
frame_id
: Frame id for resource to search in. - (Required)
url
: URL of the resource to search in. - (Required)
query
: String to search for. - (Optional)
case_sensitive
: If true, search is case sensitive. - (Optional)
is_regex
: If true, treats string parameter as regex.
set_ad_blocking_enabled(enabled)
Enable Chrome's experimental ad filter on all sites.
Parameters:
- (Required)
enabled
: Whether to block ads.
set_bypass_csp(enabled)
Enable page Content Security Policy by-passing.
Parameters:
- (Required)
enabled
: Whether to bypass page CSP.
set_device_metrics_override(width, height, device_scale_factor, mobile, scale \\ nil, screen_width \\ nil, screen_height \\ nil, position_x \\ nil, position_y \\ nil, dont_set_visible_size \\ nil, screen_orientation \\ nil, viewport \\ nil)
@spec set_device_metrics_override( integer(), integer(), number(), boolean(), number(), integer(), integer(), integer(), integer(), boolean(), CDPotion.Domain.Emulation.screen_orientation(), viewport() ) :: {String.t(), map()}
Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).
Parameters:
- (Required)
width
: Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. - (Required)
height
: Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override. - (Required)
device_scale_factor
: Overriding device scale factor value. 0 disables the override. - (Required)
mobile
: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more. - (Optional)
scale
: Scale to apply to resulting view image. - (Optional)
screen_width
: Overriding screen width value in pixels (minimum 0, maximum 10000000). - (Optional)
screen_height
: Overriding screen height value in pixels (minimum 0, maximum 10000000). - (Optional)
position_x
: Overriding view X position on screen in pixels (minimum 0, maximum 10000000). - (Optional)
position_y
: Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). - (Optional)
dont_set_visible_size
: Do not set visible view size, rely upon explicit setVisibleSize call. - (Optional)
screen_orientation
: Screen orientation override. - (Optional)
viewport
: The viewport dimensions and scale. If not set, the override is cleared.
set_device_orientation_override(alpha, beta, gamma)
Overrides the Device Orientation.
Parameters:
- (Required)
alpha
: Mock alpha - (Required)
beta
: Mock beta - (Required)
gamma
: Mock gamma
set_document_content(frame_id, html)
Sets given markup as the document's HTML.
Parameters:
- (Required)
frame_id
: Frame id to set HTML for. - (Required)
html
: HTML content to set.
set_download_behavior(behavior, download_path \\ nil)
Set the behavior when downloading a file.
Parameters:
- (Required)
behavior
: Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). - (Optional)
download_path
: The default path to save downloaded files to. This is required if behavior is set to 'allow'
set_font_families(font_families, for_scripts \\ nil)
@spec set_font_families( font_families(), [script_font_families()] ) :: {String.t(), map()}
Set generic font families.
Parameters:
- (Required)
font_families
: Specifies font families to set. If a font family is not specified, it won't be changed. - (Optional)
for_scripts
: Specifies font families to set for individual scripts.
set_font_sizes(font_sizes)
@spec set_font_sizes(font_sizes()) :: {String.t(), map()}
Set default font sizes.
Parameters:
- (Required)
font_sizes
: Specifies font sizes to set. If a font size is not specified, it won't be changed.
set_geolocation_override(latitude \\ nil, longitude \\ nil, accuracy \\ nil)
Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.
Parameters:
- (Optional)
latitude
: Mock latitude - (Optional)
longitude
: Mock longitude - (Optional)
accuracy
: Mock accuracy
set_intercept_file_chooser_dialog(enabled)
Intercept file chooser requests and transfer control to protocol clients.
When file chooser interception is enabled, native file chooser dialog is not shown.
Instead, a protocol event Page.fileChooserOpened
is emitted.
Parameters:
- (Required)
enabled
: description not provided :(
set_lifecycle_events_enabled(enabled)
Controls whether page will emit lifecycle events.
Parameters:
- (Required)
enabled
: If true, starts emitting lifecycle events.
set_prerendering_allowed(is_allowed)
Enable/disable prerendering manually. This command is a short-term solution for https://crbug.com/1440085. See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA for more details. TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets.
Parameters:
- (Required)
is_allowed
: description not provided :(
set_rph_registration_mode(mode)
@spec set_rph_registration_mode(auto_response_mode()) :: {String.t(), map()}
Extensions for Custom Handlers API: https://html.spec.whatwg.org/multipage/system-state.html#rph-automation
Parameters:
- (Required)
mode
: description not provided :(
set_spc_transaction_mode(mode)
@spec set_spc_transaction_mode(auto_response_mode()) :: {String.t(), map()}
Sets the Secure Payment Confirmation transaction mode. https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode
Parameters:
- (Required)
mode
: description not provided :(
set_touch_emulation_enabled(enabled, configuration \\ nil)
Toggles mouse event-based touch event emulation.
Parameters:
- (Required)
enabled
: Whether the touch event emulation should be enabled. - (Optional)
configuration
: Touch/gesture events configuration. Default: current platform.
set_web_lifecycle_state(state)
Tries to update the web lifecycle state of the page. It will transition the page to the given state according to: https://github.com/WICG/web-lifecycle/
Parameters:
- (Required)
state
: Target lifecycle state
start_screencast(format \\ nil, quality \\ nil, max_width \\ nil, max_height \\ nil, every_nth_frame \\ nil)
@spec start_screencast(String.t(), integer(), integer(), integer(), integer()) :: {String.t(), map()}
Starts sending each frame using the screencastFrame
event.
Parameters:
- (Optional)
format
: Image compression format. - (Optional)
quality
: Compression quality from range [0..100]. - (Optional)
max_width
: Maximum screenshot width. - (Optional)
max_height
: Maximum screenshot height. - (Optional)
every_nth_frame
: Send every n-th frame.
stop_loading()
Force the page stop all navigations and pending resource fetches.
stop_screencast()
Stops sending each frame in the screencastFrame
.
wait_for_debugger()
Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger.