Table of Contents

Interface IPage

Namespace
Selenium.WebDriver.BiDi.Cdp.Page
Assembly
Selenium.WebDriver.BiDi.Cdp.dll

Actions and events related to the inspected page belong to the page domain.

public interface IPage

Properties

BackForwardCacheNotUsed

Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do not assume any ordering with the Page.frameNavigated event. This event is fired only for main-frame history navigation where the document changes (non-same-document navigations), when bfcache navigation fails.

[Experimental("BIDICDP001")]
IEventSource<BackForwardCacheNotUsedEventArgs> BackForwardCacheNotUsed { get; }

Property Value

IEventSource<BackForwardCacheNotUsedEventArgs>

Remarks

Event args (BackForwardCacheNotUsedEventArgs):

  • LoaderId - The loader id for the associated navigation.
  • FrameId - The frame id of the associated frame.
  • NotRestoredExplanations - Array of reasons why the page could not be cached. This must not be empty.
  • NotRestoredExplanationsTree - Tree structure of reasons why the page could not be cached for each frame.

CompilationCacheProduced

Issued for every compilation cache generated.

[Experimental("BIDICDP001")]
IEventSource<CompilationCacheProducedEventArgs> CompilationCacheProduced { get; }

Property Value

IEventSource<CompilationCacheProducedEventArgs>

Remarks

Event args (CompilationCacheProducedEventArgs):

  • Url
  • Data - Base64-encoded data (Encoded as a base64 string when passed over JSON)

DocumentOpened

Fired when opening document to write to.

[Experimental("BIDICDP001")]
IEventSource<DocumentOpenedEventArgs> DocumentOpened { get; }

Property Value

IEventSource<DocumentOpenedEventArgs>

Remarks

Event args (DocumentOpenedEventArgs):

  • Frame - Frame object.

DomContentEventFired

IEventSource<DomContentEventFiredEventArgs> DomContentEventFired { get; }

Property Value

IEventSource<DomContentEventFiredEventArgs>

Remarks

Event args (DomContentEventFiredEventArgs):

  • Timestamp

DownloadProgress

Fired when download makes progress. Last call has |done| == true. Deprecated. Use Browser.downloadProgress instead.

[Experimental("BIDICDP001")]
[Obsolete]
IEventSource<DownloadProgressEventArgs> DownloadProgress { get; }

Property Value

IEventSource<DownloadProgressEventArgs>

Remarks

Event args (DownloadProgressEventArgs):

  • Guid - Global unique identifier of the download.
  • TotalBytes - Total expected bytes to download.
  • ReceivedBytes - Total bytes received.
  • State - Download status.

DownloadWillBegin

Fired when page is about to start a download. Deprecated. Use Browser.downloadWillBegin instead.

[Experimental("BIDICDP001")]
[Obsolete]
IEventSource<DownloadWillBeginEventArgs> DownloadWillBegin { get; }

Property Value

IEventSource<DownloadWillBeginEventArgs>

Remarks

Event args (DownloadWillBeginEventArgs):

  • FrameId - Id of the frame that caused download to begin.
  • Guid - Global unique identifier of the download.
  • Url - URL of the resource being downloaded.
  • SuggestedFilename - Suggested file name of the resource (the actual name of the file saved on disk may differ).

FileChooserOpened

Emitted only when page.interceptFileChooser is enabled.

IEventSource<FileChooserOpenedEventArgs> FileChooserOpened { get; }

Property Value

IEventSource<FileChooserOpenedEventArgs>

Remarks

Event args (FileChooserOpenedEventArgs):

  • FrameId - Id of the frame containing input node.
  • Mode - Input mode.
  • BackendNodeId - Input node id. Only present for file choosers opened via an <input type="file"> element.

FrameAttached

Fired when frame has been attached to its parent.

IEventSource<FrameAttachedEventArgs> FrameAttached { get; }

Property Value

IEventSource<FrameAttachedEventArgs>

Remarks

Event args (FrameAttachedEventArgs):

  • FrameId - Id of the frame that has been attached.
  • ParentFrameId - Parent frame identifier.
  • Stack - JavaScript stack trace of when frame was attached, only set if frame initiated from script.

FrameClearedScheduledNavigation

Fired when frame no longer has a scheduled navigation.

[Obsolete]
IEventSource<FrameClearedScheduledNavigationEventArgs> FrameClearedScheduledNavigation { get; }

Property Value

IEventSource<FrameClearedScheduledNavigationEventArgs>

Remarks

Event args (FrameClearedScheduledNavigationEventArgs):

  • FrameId - Id of the frame that has cleared its scheduled navigation.

FrameDetached

Fired when frame has been detached from its parent.

IEventSource<FrameDetachedEventArgs> FrameDetached { get; }

Property Value

IEventSource<FrameDetachedEventArgs>

Remarks

Event args (FrameDetachedEventArgs):

  • FrameId - Id of the frame that has been detached.
  • Reason

FrameNavigated

Fired once navigation of the frame has completed. Frame is now associated with the new loader.

IEventSource<FrameNavigatedEventArgs> FrameNavigated { get; }

Property Value

IEventSource<FrameNavigatedEventArgs>

Remarks

Event args (FrameNavigatedEventArgs):

  • Frame - Frame object.
  • Type

FrameRequestedNavigation

Fired when a renderer-initiated navigation is requested. Navigation may still be cancelled after the event is issued.

[Experimental("BIDICDP001")]
IEventSource<FrameRequestedNavigationEventArgs> FrameRequestedNavigation { get; }

Property Value

IEventSource<FrameRequestedNavigationEventArgs>

Remarks

Event args (FrameRequestedNavigationEventArgs):

  • FrameId - Id of the frame that is being navigated.
  • Reason - The reason for the navigation.
  • Url - The destination URL for the requested navigation.
  • Disposition - The disposition for the navigation.

FrameResized

[Experimental("BIDICDP001")]
IEventSource<FrameResizedEventArgs> FrameResized { get; }

Property Value

IEventSource<FrameResizedEventArgs>

FrameScheduledNavigation

Fired when frame schedules a potential navigation.

[Obsolete]
IEventSource<FrameScheduledNavigationEventArgs> FrameScheduledNavigation { get; }

Property Value

IEventSource<FrameScheduledNavigationEventArgs>

Remarks

Event args (FrameScheduledNavigationEventArgs):

  • FrameId - Id of the frame that has scheduled a navigation.
  • Delay - Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start.
  • Reason - The reason for the navigation.
  • Url - The destination URL for the scheduled navigation.

FrameStartedLoading

Fired when frame has started loading.

[Experimental("BIDICDP001")]
IEventSource<FrameStartedLoadingEventArgs> FrameStartedLoading { get; }

Property Value

IEventSource<FrameStartedLoadingEventArgs>

Remarks

Event args (FrameStartedLoadingEventArgs):

  • FrameId - Id of the frame that has started loading.

FrameStartedNavigating

Fired when a navigation starts. This event is fired for both renderer-initiated and browser-initiated navigations. For renderer-initiated navigations, the event is fired after frameRequestedNavigation. Navigation may still be cancelled after the event is issued. Multiple events can be fired for a single navigation, for example, when a same-document navigation becomes a cross-document navigation (such as in the case of a frameset).

[Experimental("BIDICDP001")]
IEventSource<FrameStartedNavigatingEventArgs> FrameStartedNavigating { get; }

Property Value

IEventSource<FrameStartedNavigatingEventArgs>

Remarks

Event args (FrameStartedNavigatingEventArgs):

  • FrameId - ID of the frame that is being navigated.
  • Url - The URL the navigation started with. The final URL can be different.
  • LoaderId - Loader identifier. Even though it is present in case of same-document navigation, the previously committed loaderId would not change unless the navigation changes from a same-document to a cross-document navigation.
  • NavigationType

FrameStoppedLoading

Fired when frame has stopped loading.

[Experimental("BIDICDP001")]
IEventSource<FrameStoppedLoadingEventArgs> FrameStoppedLoading { get; }

Property Value

IEventSource<FrameStoppedLoadingEventArgs>

Remarks

Event args (FrameStoppedLoadingEventArgs):

  • FrameId - Id of the frame that has stopped loading.

FrameSubtreeWillBeDetached

Fired before frame subtree is detached. Emitted before any frame of the subtree is actually detached.

[Experimental("BIDICDP001")]
IEventSource<FrameSubtreeWillBeDetachedEventArgs> FrameSubtreeWillBeDetached { get; }

Property Value

IEventSource<FrameSubtreeWillBeDetachedEventArgs>

Remarks

Event args (FrameSubtreeWillBeDetachedEventArgs):

  • FrameId - Id of the frame that is the root of the subtree that will be detached.

InterstitialHidden

Fired when interstitial page was hidden

IEventSource<InterstitialHiddenEventArgs> InterstitialHidden { get; }

Property Value

IEventSource<InterstitialHiddenEventArgs>

InterstitialShown

Fired when interstitial page was shown

IEventSource<InterstitialShownEventArgs> InterstitialShown { get; }

Property Value

IEventSource<InterstitialShownEventArgs>

JavascriptDialogClosed

Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.

IEventSource<JavascriptDialogClosedEventArgs> JavascriptDialogClosed { get; }

Property Value

IEventSource<JavascriptDialogClosedEventArgs>

Remarks

Event args (JavascriptDialogClosedEventArgs):

  • FrameId - Frame id.
  • Result - Whether dialog was confirmed.
  • UserInput - User input in case of prompt.

JavascriptDialogOpening

Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.

IEventSource<JavascriptDialogOpeningEventArgs> JavascriptDialogOpening { get; }

Property Value

IEventSource<JavascriptDialogOpeningEventArgs>

Remarks

Event args (JavascriptDialogOpeningEventArgs):

  • Url - Frame url.
  • FrameId - Frame id.
  • Message - Message that will be displayed by the dialog.
  • Type - Dialog type.
  • HasBrowserHandler - True iff browser is capable showing or acting on the given dialog. When browser has no dialog handler for given target, calling alert while Page domain is engaged will stall the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog.
  • DefaultPrompt - Default dialog prompt.

LifecycleEvent

Fired for lifecycle events (navigation, load, paint, etc) in the current target (including local frames).

IEventSource<LifecycleEventEventArgs> LifecycleEvent { get; }

Property Value

IEventSource<LifecycleEventEventArgs>

Remarks

Event args (LifecycleEventEventArgs):

  • FrameId - Id of the frame.
  • LoaderId - Loader identifier. Empty string if the request is fetched from worker.
  • Name
  • Timestamp

LoadEventFired

IEventSource<LoadEventFiredEventArgs> LoadEventFired { get; }

Property Value

IEventSource<LoadEventFiredEventArgs>

Remarks

Event args (LoadEventFiredEventArgs):

  • Timestamp

NavigatedWithinDocument

Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation.

[Experimental("BIDICDP001")]
IEventSource<NavigatedWithinDocumentEventArgs> NavigatedWithinDocument { get; }

Property Value

IEventSource<NavigatedWithinDocumentEventArgs>

Remarks

Event args (NavigatedWithinDocumentEventArgs):

  • FrameId - Id of the frame.
  • Url - Frame's new url.
  • NavigationType - Navigation type

ScreencastFrame

Compressed image data requested by the startScreencast.

[Experimental("BIDICDP001")]
IEventSource<ScreencastFrameEventArgs> ScreencastFrame { get; }

Property Value

IEventSource<ScreencastFrameEventArgs>

Remarks

Event args (ScreencastFrameEventArgs):

  • Data - Base64-encoded compressed image. (Encoded as a base64 string when passed over JSON)
  • Metadata - Screencast frame metadata.
  • SessionId - Frame number.

ScreencastVisibilityChanged

Fired when the page with currently enabled screencast was shown or hidden `.

[Experimental("BIDICDP001")]
IEventSource<ScreencastVisibilityChangedEventArgs> ScreencastVisibilityChanged { get; }

Property Value

IEventSource<ScreencastVisibilityChangedEventArgs>

Remarks

Event args (ScreencastVisibilityChangedEventArgs):

  • Visible - True if the page is visible.

WindowOpen

Fired when a new window is going to be opened, via window.open(), link click, form submission, etc.

IEventSource<WindowOpenEventArgs> WindowOpen { get; }

Property Value

IEventSource<WindowOpenEventArgs>

Remarks

Event args (WindowOpenEventArgs):

  • Url - The URL for the new window.
  • WindowName - Window name.
  • WindowFeatures - An array of enabled window features.
  • UserGesture - Whether or not it was triggered by user gesture.

Methods

AddCompilationCacheAsync(string, string, string?, CancellationToken)

Seeds compilation cache for given url. Compilation cache does not survive cross-process navigation.

[Experimental("BIDICDP001")]
Task<AddCompilationCacheResult> AddCompilationCacheAsync(string url, string data, string? session = null, CancellationToken cancellationToken = default)

Parameters

url string
data string

Base64-encoded data (Encoded as a base64 string when passed over JSON)

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<AddCompilationCacheResult>

A task representing the asynchronous operation, containing a AddCompilationCacheResult.

AddScriptToEvaluateOnLoadAsync(string, string?, CancellationToken)

Deprecated, please use addScriptToEvaluateOnNewDocument instead.

[Experimental("BIDICDP001")]
[Obsolete]
Task<AddScriptToEvaluateOnLoadResult> AddScriptToEvaluateOnLoadAsync(string scriptSource, string? session = null, CancellationToken cancellationToken = default)

Parameters

scriptSource string
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<AddScriptToEvaluateOnLoadResult>

A task representing the asynchronous operation, containing a AddScriptToEvaluateOnLoadResult.

AddScriptToEvaluateOnNewDocumentAsync(string, string?, bool?, bool?, string?, CancellationToken)

Evaluates given script in every frame upon creation (before loading frame's scripts).

Task<AddScriptToEvaluateOnNewDocumentResult> AddScriptToEvaluateOnNewDocumentAsync(string source, string? worldName = null, bool? includeCommandLineAPI = null, bool? runImmediately = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

source string
worldName string

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.

includeCommandLineAPI bool?

Specifies whether command line API should be available to the script, defaults to false.

runImmediately bool?

If true, runs the script immediately on existing execution contexts or worlds. Default: false.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<AddScriptToEvaluateOnNewDocumentResult>

A task representing the asynchronous operation, containing a AddScriptToEvaluateOnNewDocumentResult.

BringToFrontAsync(string?, CancellationToken)

Brings page to front (activates tab).

Task<BringToFrontResult> BringToFrontAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<BringToFrontResult>

A task representing the asynchronous operation, containing a BringToFrontResult.

CaptureScreenshotAsync(string?, long?, Viewport?, bool?, bool?, bool?, string?, CancellationToken)

Capture page screenshot.

Task<CaptureScreenshotResult> CaptureScreenshotAsync(string? format = null, long? quality = null, Viewport? clip = null, bool? fromSurface = null, bool? captureBeyondViewport = null, bool? optimizeForSpeed = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

format string

Image compression format (defaults to png).

quality long?

Compression quality from range [0..100] (jpeg only).

clip Viewport

Capture the screenshot of a given region only.

fromSurface bool?

Capture the screenshot from the surface, rather than the view. Defaults to true.

captureBeyondViewport bool?

Capture the screenshot beyond the viewport. Defaults to false.

optimizeForSpeed bool?

Optimize image encoding for speed, not for resulting size (defaults to false)

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<CaptureScreenshotResult>

A task representing the asynchronous operation, containing a CaptureScreenshotResult.

CaptureSnapshotAsync(string?, string?, CancellationToken)

Returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles.

[Experimental("BIDICDP001")]
Task<CaptureSnapshotResult> CaptureSnapshotAsync(string? format = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

format string

Format (defaults to mhtml).

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<CaptureSnapshotResult>

A task representing the asynchronous operation, containing a CaptureSnapshotResult.

ClearCompilationCacheAsync(string?, CancellationToken)

Clears seeded compilation cache.

[Experimental("BIDICDP001")]
Task<ClearCompilationCacheResult> ClearCompilationCacheAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ClearCompilationCacheResult>

A task representing the asynchronous operation, containing a ClearCompilationCacheResult.

ClearDeviceMetricsOverrideAsync(string?, CancellationToken)

Clears the overridden device metrics.

[Experimental("BIDICDP001")]
[Obsolete]
Task<ClearDeviceMetricsOverrideResult> ClearDeviceMetricsOverrideAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ClearDeviceMetricsOverrideResult>

A task representing the asynchronous operation, containing a ClearDeviceMetricsOverrideResult.

ClearDeviceOrientationOverrideAsync(string?, CancellationToken)

Clears the overridden Device Orientation.

[Experimental("BIDICDP001")]
[Obsolete]
Task<ClearDeviceOrientationOverrideResult> ClearDeviceOrientationOverrideAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ClearDeviceOrientationOverrideResult>

A task representing the asynchronous operation, containing a ClearDeviceOrientationOverrideResult.

ClearGeolocationOverrideAsync(string?, CancellationToken)

Clears the overridden Geolocation Position and Error.

[Obsolete]
Task<ClearGeolocationOverrideResult> ClearGeolocationOverrideAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ClearGeolocationOverrideResult>

A task representing the asynchronous operation, containing a ClearGeolocationOverrideResult.

CloseAsync(string?, CancellationToken)

Tries to close page, running its beforeunload hooks, if any.

Task<CloseResult> CloseAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<CloseResult>

A task representing the asynchronous operation, containing a CloseResult.

CrashAsync(string?, CancellationToken)

Crashes renderer on the IO thread, generates minidumps.

[Experimental("BIDICDP001")]
Task<CrashResult> CrashAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<CrashResult>

A task representing the asynchronous operation, containing a CrashResult.

CreateIsolatedWorldAsync(FrameId, string?, bool?, string?, string?, CancellationToken)

Creates an isolated world for the given frame.

Task<CreateIsolatedWorldResult> CreateIsolatedWorldAsync(FrameId frameId, string? worldName = null, bool? grantUniveralAccess = null, string? contentSecurityPolicy = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId

Id of the frame in which the isolated world should be created.

worldName string

An optional name which is reported in the Execution Context.

grantUniveralAccess bool?

Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.

contentSecurityPolicy string

An optional content security policy to set for the isolated world. If omitted, any existing CSP for the world will be cleared. Note that clearing or updating the CSP does not immediately affect the active context in the same document because LocalDOMWindow caches the ContentSecurityPolicy object. The change takes effect on subsequent navigations when a new window context is created.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<CreateIsolatedWorldResult>

A task representing the asynchronous operation, containing a CreateIsolatedWorldResult.

DeleteCookieAsync(string, string, string?, CancellationToken)

Deletes browser cookie with given name, domain and path.

[Experimental("BIDICDP001")]
[Obsolete]
Task<DeleteCookieResult> DeleteCookieAsync(string cookieName, string url, string? session = null, CancellationToken cancellationToken = default)

Parameters

cookieName string

Name of the cookie to remove.

url string

URL to match cooke domain and path.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<DeleteCookieResult>

A task representing the asynchronous operation, containing a DeleteCookieResult.

DisableAsync(string?, CancellationToken)

Disables page domain notifications.

Task<DisableResult> DisableAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<DisableResult>

A task representing the asynchronous operation, containing a DisableResult.

EnableAsync(bool?, string?, CancellationToken)

Enables page domain notifications.

Task<EnableResult> EnableAsync(bool? enableFileChooserOpenedEvent = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

enableFileChooserOpenedEvent bool?

If true, the Page.fileChooserOpened event will be emitted regardless of the state set by Page.setInterceptFileChooserDialog command (default: false).

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<EnableResult>

A task representing the asynchronous operation, containing a EnableResult.

GenerateTestReportAsync(string, string?, string?, CancellationToken)

Generates a report for testing.

[Experimental("BIDICDP001")]
Task<GenerateTestReportResult> GenerateTestReportAsync(string message, string? group = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

message string

Message to be displayed in the report.

group string

Specifies the endpoint group to deliver the report to.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GenerateTestReportResult>

A task representing the asynchronous operation, containing a GenerateTestReportResult.

GetAdScriptAncestryAsync(FrameId, string?, CancellationToken)

[Experimental("BIDICDP001")]
Task<GetAdScriptAncestryResult> GetAdScriptAncestryAsync(FrameId frameId, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetAdScriptAncestryResult>

A task representing the asynchronous operation, containing a GetAdScriptAncestryResult.

GetAnnotatedPageContentAsync(bool?, string?, CancellationToken)

Get the annotated page content for the main frame. This is an experimental command that is subject to change.

[Experimental("BIDICDP001")]
Task<GetAnnotatedPageContentResult> GetAnnotatedPageContentAsync(bool? includeActionableInformation = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

includeActionableInformation bool?

Whether to include actionable information. Defaults to true.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetAnnotatedPageContentResult>

A task representing the asynchronous operation, containing a GetAnnotatedPageContentResult.

GetAppIdAsync(string?, CancellationToken)

Returns the unique (PWA) app id. Only returns values if the feature flag 'WebAppEnableManifestId' is enabled

[Experimental("BIDICDP001")]
Task<GetAppIdResult> GetAppIdAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetAppIdResult>

A task representing the asynchronous operation, containing a GetAppIdResult.

GetAppManifestAsync(string?, string?, CancellationToken)

Gets the processed manifest for this current document. This API always waits for the manifest to be loaded. If manifestId is provided, and it does not match the manifest of the current document, this API errors out. If there is not a loaded page, this API errors out immediately.

Task<GetAppManifestResult> GetAppManifestAsync(string? manifestId = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

manifestId string
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetAppManifestResult>

A task representing the asynchronous operation, containing a GetAppManifestResult.

GetFrameTreeAsync(string?, CancellationToken)

Returns present frame tree structure.

Task<GetFrameTreeResult> GetFrameTreeAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetFrameTreeResult>

A task representing the asynchronous operation, containing a GetFrameTreeResult.

GetInstallabilityErrorsAsync(string?, CancellationToken)

[Experimental("BIDICDP001")]
Task<GetInstallabilityErrorsResult> GetInstallabilityErrorsAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetInstallabilityErrorsResult>

A task representing the asynchronous operation, containing a GetInstallabilityErrorsResult.

GetLayoutMetricsAsync(string?, CancellationToken)

Returns metrics relating to the layouting of the page, such as viewport bounds/scale.

Task<GetLayoutMetricsResult> GetLayoutMetricsAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetLayoutMetricsResult>

A task representing the asynchronous operation, containing a GetLayoutMetricsResult.

GetManifestIconsAsync(string?, CancellationToken)

Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation.

[Experimental("BIDICDP001")]
[Obsolete]
Task<GetManifestIconsResult> GetManifestIconsAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetManifestIconsResult>

A task representing the asynchronous operation, containing a GetManifestIconsResult.

GetNavigationHistoryAsync(string?, CancellationToken)

Returns navigation history for the current page.

Task<GetNavigationHistoryResult> GetNavigationHistoryAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetNavigationHistoryResult>

A task representing the asynchronous operation, containing a GetNavigationHistoryResult.

GetOriginTrialsAsync(FrameId, string?, CancellationToken)

Get Origin Trials on given frame.

[Experimental("BIDICDP001")]
Task<GetOriginTrialsResult> GetOriginTrialsAsync(FrameId frameId, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetOriginTrialsResult>

A task representing the asynchronous operation, containing a GetOriginTrialsResult.

GetPermissionsPolicyStateAsync(FrameId, string?, CancellationToken)

Get Permissions Policy state on given frame.

[Experimental("BIDICDP001")]
Task<GetPermissionsPolicyStateResult> GetPermissionsPolicyStateAsync(FrameId frameId, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetPermissionsPolicyStateResult>

A task representing the asynchronous operation, containing a GetPermissionsPolicyStateResult.

GetResourceContentAsync(FrameId, string, string?, CancellationToken)

Returns content of the given resource.

[Experimental("BIDICDP001")]
Task<GetResourceContentResult> GetResourceContentAsync(FrameId frameId, string url, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId

Frame id to get resource for.

url string

URL of the resource to get content for.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetResourceContentResult>

A task representing the asynchronous operation, containing a GetResourceContentResult.

GetResourceTreeAsync(string?, CancellationToken)

Returns present frame / resource tree structure.

[Experimental("BIDICDP001")]
Task<GetResourceTreeResult> GetResourceTreeAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetResourceTreeResult>

A task representing the asynchronous operation, containing a GetResourceTreeResult.

HandleJavaScriptDialogAsync(bool, string?, string?, CancellationToken)

Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

Task<HandleJavaScriptDialogResult> HandleJavaScriptDialogAsync(bool accept, string? promptText = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

accept bool

Whether to accept or dismiss the dialog.

promptText string

The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<HandleJavaScriptDialogResult>

A task representing the asynchronous operation, containing a HandleJavaScriptDialogResult.

NavigateAsync(string, string?, TransitionType?, FrameId?, ReferrerPolicy?, string?, CancellationToken)

Navigates current page to the given URL.

Task<NavigateResult> NavigateAsync(string url, string? referrer = null, TransitionType? transitionType = null, FrameId? frameId = null, ReferrerPolicy? referrerPolicy = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

url string

URL to navigate the page to.

referrer string

Referrer URL.

transitionType TransitionType?

Intended transition type.

frameId FrameId

Frame id to navigate, if not specified navigates the top frame.

referrerPolicy ReferrerPolicy?

Referrer-policy used for the navigation.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<NavigateResult>

A task representing the asynchronous operation, containing a NavigateResult.

NavigateToHistoryEntryAsync(long, string?, CancellationToken)

Navigates current page to the given history entry.

Task<NavigateToHistoryEntryResult> NavigateToHistoryEntryAsync(long entryId, string? session = null, CancellationToken cancellationToken = default)

Parameters

entryId long

Unique id of the entry to navigate to.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<NavigateToHistoryEntryResult>

A task representing the asynchronous operation, containing a NavigateToHistoryEntryResult.

PrintToPDFAsync(bool?, bool?, bool?, double?, double?, double?, double?, double?, double?, double?, string?, string?, string?, bool?, string?, bool?, bool?, string?, CancellationToken)

Print page as PDF.

Task<PrintToPDFResult> PrintToPDFAsync(bool? landscape = null, bool? displayHeaderFooter = null, bool? printBackground = null, double? scale = null, double? paperWidth = null, double? paperHeight = null, double? marginTop = null, double? marginBottom = null, double? marginLeft = null, double? marginRight = null, string? pageRanges = null, string? headerTemplate = null, string? footerTemplate = null, bool? preferCSSPageSize = null, string? transferMode = null, bool? generateTaggedPDF = null, bool? generateDocumentOutline = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

landscape bool?

Paper orientation. Defaults to false.

displayHeaderFooter bool?

Display header and footer. Defaults to false.

printBackground bool?

Print background graphics. Defaults to false.

scale double?

Scale of the webpage rendering. Defaults to 1.

paperWidth double?

Paper width in inches. Defaults to 8.5 inches.

paperHeight double?

Paper height in inches. Defaults to 11 inches.

marginTop double?

Top margin in inches. Defaults to 1cm (~0.4 inches).

marginBottom double?

Bottom margin in inches. Defaults to 1cm (~0.4 inches).

marginLeft double?

Left margin in inches. Defaults to 1cm (~0.4 inches).

marginRight double?

Right margin in inches. Defaults to 1cm (~0.4 inches).

pageRanges string

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.

headerTemplate string

HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:

  • date: formatted print date
  • title: document title
  • url: document location
  • pageNumber: current page number
  • totalPages: total pages in the document

For example, <span class=title></span> would generate span containing the title.

footerTemplate string

HTML template for the print footer. Should use the same format as the headerTemplate.

preferCSSPageSize bool?

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.

transferMode string

return as stream

generateTaggedPDF bool?

Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice.

generateDocumentOutline bool?

Whether or not to embed the document outline into the PDF.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<PrintToPDFResult>

A task representing the asynchronous operation, containing a PrintToPDFResult.

ProduceCompilationCacheAsync(ImmutableArray<CompilationCacheParams>, string?, CancellationToken)

Requests backend to produce compilation cache for the specified scripts. scripts are appended 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.

[Experimental("BIDICDP001")]
Task<ProduceCompilationCacheResult> ProduceCompilationCacheAsync(ImmutableArray<CompilationCacheParams> scripts, string? session = null, CancellationToken cancellationToken = default)

Parameters

scripts ImmutableArray<CompilationCacheParams>
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ProduceCompilationCacheResult>

A task representing the asynchronous operation, containing a ProduceCompilationCacheResult.

ReloadAsync(bool?, string?, LoaderId?, string?, CancellationToken)

Reloads given page optionally ignoring the cache.

Task<ReloadResult> ReloadAsync(bool? ignoreCache = null, string? scriptToEvaluateOnLoad = null, LoaderId? loaderId = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

ignoreCache bool?

If true, browser cache is ignored (as if the user pressed Shift+refresh).

scriptToEvaluateOnLoad string

If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin.

loaderId LoaderId

If set, an error will be thrown if the target page's main frame's loader id does not match the provided id. This prevents accidentally reloading an unintended target in case there's a racing navigation.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ReloadResult>

A task representing the asynchronous operation, containing a ReloadResult.

RemoveScriptToEvaluateOnLoadAsync(ScriptIdentifier, string?, CancellationToken)

Deprecated, please use removeScriptToEvaluateOnNewDocument instead.

[Experimental("BIDICDP001")]
[Obsolete]
Task<RemoveScriptToEvaluateOnLoadResult> RemoveScriptToEvaluateOnLoadAsync(ScriptIdentifier identifier, string? session = null, CancellationToken cancellationToken = default)

Parameters

identifier ScriptIdentifier
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<RemoveScriptToEvaluateOnLoadResult>

A task representing the asynchronous operation, containing a RemoveScriptToEvaluateOnLoadResult.

RemoveScriptToEvaluateOnNewDocumentAsync(ScriptIdentifier, string?, CancellationToken)

Removes given script from the list.

Task<RemoveScriptToEvaluateOnNewDocumentResult> RemoveScriptToEvaluateOnNewDocumentAsync(ScriptIdentifier identifier, string? session = null, CancellationToken cancellationToken = default)

Parameters

identifier ScriptIdentifier
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<RemoveScriptToEvaluateOnNewDocumentResult>

A task representing the asynchronous operation, containing a RemoveScriptToEvaluateOnNewDocumentResult.

ResetNavigationHistoryAsync(string?, CancellationToken)

Resets navigation history for the current page.

Task<ResetNavigationHistoryResult> ResetNavigationHistoryAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ResetNavigationHistoryResult>

A task representing the asynchronous operation, containing a ResetNavigationHistoryResult.

ScreencastFrameAckAsync(long, string?, CancellationToken)

Acknowledges that a screencast frame has been received by the frontend.

[Experimental("BIDICDP001")]
Task<ScreencastFrameAckResult> ScreencastFrameAckAsync(long sessionId, string? session = null, CancellationToken cancellationToken = default)

Parameters

sessionId long

Frame number.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ScreencastFrameAckResult>

A task representing the asynchronous operation, containing a ScreencastFrameAckResult.

SearchInResourceAsync(FrameId, string, string, bool?, bool?, string?, CancellationToken)

Searches for given string in resource content.

[Experimental("BIDICDP001")]
Task<SearchInResourceResult> SearchInResourceAsync(FrameId frameId, string url, string query, bool? caseSensitive = null, bool? isRegex = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId

Frame id for resource to search in.

url string

URL of the resource to search in.

query string

String to search for.

caseSensitive bool?

If true, search is case sensitive.

isRegex bool?

If true, treats string parameter as regex.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SearchInResourceResult>

A task representing the asynchronous operation, containing a SearchInResourceResult.

SetAdBlockingEnabledAsync(bool, string?, CancellationToken)

Enable Chrome's experimental ad filter on all sites.

[Experimental("BIDICDP001")]
Task<SetAdBlockingEnabledResult> SetAdBlockingEnabledAsync(bool enabled, string? session = null, CancellationToken cancellationToken = default)

Parameters

enabled bool

Whether to block ads.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetAdBlockingEnabledResult>

A task representing the asynchronous operation, containing a SetAdBlockingEnabledResult.

SetBypassCSPAsync(bool, string?, CancellationToken)

Enable page Content Security Policy by-passing.

Task<SetBypassCSPResult> SetBypassCSPAsync(bool enabled, string? session = null, CancellationToken cancellationToken = default)

Parameters

enabled bool

Whether to bypass page CSP.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetBypassCSPResult>

A task representing the asynchronous operation, containing a SetBypassCSPResult.

SetDeviceMetricsOverrideAsync(long, long, double, bool, double?, long?, long?, long?, long?, bool?, ScreenOrientation?, Viewport?, string?, CancellationToken)

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).

[Experimental("BIDICDP001")]
[Obsolete]
Task<SetDeviceMetricsOverrideResult> SetDeviceMetricsOverrideAsync(long width, long height, double deviceScaleFactor, bool mobile, double? scale = null, long? screenWidth = null, long? screenHeight = null, long? positionX = null, long? positionY = null, bool? dontSetVisibleSize = null, ScreenOrientation? screenOrientation = null, Viewport? viewport = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

width long

Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.

height long

Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.

deviceScaleFactor double

Overriding device scale factor value. 0 disables the override.

mobile bool

Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.

scale double?

Scale to apply to resulting view image.

screenWidth long?

Overriding screen width value in pixels (minimum 0, maximum 10000000).

screenHeight long?

Overriding screen height value in pixels (minimum 0, maximum 10000000).

positionX long?

Overriding view X position on screen in pixels (minimum 0, maximum 10000000).

positionY long?

Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).

dontSetVisibleSize bool?

Do not set visible view size, rely upon explicit setVisibleSize call.

screenOrientation ScreenOrientation

Screen orientation override.

viewport Viewport

The viewport dimensions and scale. If not set, the override is cleared.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetDeviceMetricsOverrideResult>

A task representing the asynchronous operation, containing a SetDeviceMetricsOverrideResult.

SetDeviceOrientationOverrideAsync(double, double, double, string?, CancellationToken)

Overrides the Device Orientation.

[Experimental("BIDICDP001")]
[Obsolete]
Task<SetDeviceOrientationOverrideResult> SetDeviceOrientationOverrideAsync(double alpha, double beta, double gamma, string? session = null, CancellationToken cancellationToken = default)

Parameters

alpha double

Mock alpha

beta double

Mock beta

gamma double

Mock gamma

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetDeviceOrientationOverrideResult>

A task representing the asynchronous operation, containing a SetDeviceOrientationOverrideResult.

SetDocumentContentAsync(FrameId, string, string?, CancellationToken)

Sets given markup as the document's HTML.

Task<SetDocumentContentResult> SetDocumentContentAsync(FrameId frameId, string html, string? session = null, CancellationToken cancellationToken = default)

Parameters

frameId FrameId

Frame id to set HTML for.

html string

HTML content to set.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetDocumentContentResult>

A task representing the asynchronous operation, containing a SetDocumentContentResult.

SetDownloadBehaviorAsync(string, string?, string?, CancellationToken)

Set the behavior when downloading a file.

[Experimental("BIDICDP001")]
[Obsolete]
Task<SetDownloadBehaviorResult> SetDownloadBehaviorAsync(string behavior, string? downloadPath = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

behavior string

Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).

downloadPath string

The default path to save downloaded files to. This is required if behavior is set to 'allow'

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetDownloadBehaviorResult>

A task representing the asynchronous operation, containing a SetDownloadBehaviorResult.

SetFontFamiliesAsync(FontFamilies, ImmutableArray<ScriptFontFamilies>?, string?, CancellationToken)

Set generic font families.

[Experimental("BIDICDP001")]
Task<SetFontFamiliesResult> SetFontFamiliesAsync(FontFamilies fontFamilies, ImmutableArray<ScriptFontFamilies>? forScripts = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

fontFamilies FontFamilies

Specifies font families to set. If a font family is not specified, it won't be changed.

forScripts ImmutableArray<ScriptFontFamilies>?

Specifies font families to set for individual scripts.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetFontFamiliesResult>

A task representing the asynchronous operation, containing a SetFontFamiliesResult.

SetFontSizesAsync(FontSizes, string?, CancellationToken)

Set default font sizes.

[Experimental("BIDICDP001")]
Task<SetFontSizesResult> SetFontSizesAsync(FontSizes fontSizes, string? session = null, CancellationToken cancellationToken = default)

Parameters

fontSizes FontSizes

Specifies font sizes to set. If a font size is not specified, it won't be changed.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetFontSizesResult>

A task representing the asynchronous operation, containing a SetFontSizesResult.

SetGeolocationOverrideAsync(double?, double?, double?, string?, CancellationToken)

Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.

[Obsolete]
Task<SetGeolocationOverrideResult> SetGeolocationOverrideAsync(double? latitude = null, double? longitude = null, double? accuracy = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

latitude double?

Mock latitude

longitude double?

Mock longitude

accuracy double?

Mock accuracy

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetGeolocationOverrideResult>

A task representing the asynchronous operation, containing a SetGeolocationOverrideResult.

SetInterceptFileChooserDialogAsync(bool, bool?, string?, CancellationToken)

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.

Task<SetInterceptFileChooserDialogResult> SetInterceptFileChooserDialogAsync(bool enabled, bool? cancel = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

enabled bool
cancel bool?

If true, cancels the dialog by emitting relevant events (if any) in addition to not showing it if the interception is enabled (default: false).

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetInterceptFileChooserDialogResult>

A task representing the asynchronous operation, containing a SetInterceptFileChooserDialogResult.

SetLifecycleEventsEnabledAsync(bool, string?, CancellationToken)

Controls whether page will emit lifecycle events.

Task<SetLifecycleEventsEnabledResult> SetLifecycleEventsEnabledAsync(bool enabled, string? session = null, CancellationToken cancellationToken = default)

Parameters

enabled bool

If true, starts emitting lifecycle events.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetLifecycleEventsEnabledResult>

A task representing the asynchronous operation, containing a SetLifecycleEventsEnabledResult.

SetPrerenderingAllowedAsync(bool, string?, CancellationToken)

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.

[Experimental("BIDICDP001")]
Task<SetPrerenderingAllowedResult> SetPrerenderingAllowedAsync(bool isAllowed, string? session = null, CancellationToken cancellationToken = default)

Parameters

isAllowed bool
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetPrerenderingAllowedResult>

A task representing the asynchronous operation, containing a SetPrerenderingAllowedResult.

SetRPHRegistrationModeAsync(string, string?, CancellationToken)

[Experimental("BIDICDP001")]
Task<SetRPHRegistrationModeResult> SetRPHRegistrationModeAsync(string mode, string? session = null, CancellationToken cancellationToken = default)

Parameters

mode string
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetRPHRegistrationModeResult>

A task representing the asynchronous operation, containing a SetRPHRegistrationModeResult.

SetSPCTransactionModeAsync(string, string?, CancellationToken)

[Experimental("BIDICDP001")]
Task<SetSPCTransactionModeResult> SetSPCTransactionModeAsync(string mode, string? session = null, CancellationToken cancellationToken = default)

Parameters

mode string
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetSPCTransactionModeResult>

A task representing the asynchronous operation, containing a SetSPCTransactionModeResult.

SetTouchEmulationEnabledAsync(bool, string?, string?, CancellationToken)

Toggles mouse event-based touch event emulation.

[Experimental("BIDICDP001")]
[Obsolete]
Task<SetTouchEmulationEnabledResult> SetTouchEmulationEnabledAsync(bool enabled, string? configuration = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

enabled bool

Whether the touch event emulation should be enabled.

configuration string

Touch/gesture events configuration. Default: current platform.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetTouchEmulationEnabledResult>

A task representing the asynchronous operation, containing a SetTouchEmulationEnabledResult.

SetWebLifecycleStateAsync(string, string?, CancellationToken)

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/

[Experimental("BIDICDP001")]
Task<SetWebLifecycleStateResult> SetWebLifecycleStateAsync(string state, string? session = null, CancellationToken cancellationToken = default)

Parameters

state string

Target lifecycle state

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetWebLifecycleStateResult>

A task representing the asynchronous operation, containing a SetWebLifecycleStateResult.

StartScreenRecordingAsync(bool?, long?, long?, long?, string?, CancellationToken)

Starts screencast video recording.

[Experimental("BIDICDP001")]
Task<StartScreenRecordingResult> StartScreenRecordingAsync(bool? audio = null, long? maxWidth = null, long? maxHeight = null, long? frameRate = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

audio bool?
maxWidth long?

Maximum frame width in pixels.

maxHeight long?

Maximum frame height in pixels.

frameRate long?

Maximum frame rate in frames per second.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StartScreenRecordingResult>

A task representing the asynchronous operation, containing a StartScreenRecordingResult.

StartScreencastAsync(string?, long?, long?, long?, long?, long?, bool?, string?, CancellationToken)

Starts sending each frame using the screencastFrame event.

[Experimental("BIDICDP001")]
Task<StartScreencastResult> StartScreencastAsync(string? format = null, long? quality = null, long? maxWidth = null, long? maxHeight = null, long? everyNthFrame = null, long? maxFramesInFlight = null, bool? sendLastFrame = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

format string

Image compression format.

quality long?

Compression quality from range [0..100].

maxWidth long?

Maximum screenshot width.

maxHeight long?

Maximum screenshot height.

everyNthFrame long?

Send every n-th frame. Must be a positive integer.

maxFramesInFlight long?

Maximum number of frames sent until screencastFrameAck is required. Defaults to 3. Must be a positive integer.

sendLastFrame bool?

By default, after screencastFrameAck arrives, the next produced frame is sent. Passing this flag enables storing the last produced frame in memory, which is immediately sent upon screencastFrameAck. This way, overall performance is traded for a better latency.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StartScreencastResult>

A task representing the asynchronous operation, containing a StartScreencastResult.

StopLoadingAsync(string?, CancellationToken)

Force the page stop all navigations and pending resource fetches.

Task<StopLoadingResult> StopLoadingAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StopLoadingResult>

A task representing the asynchronous operation, containing a StopLoadingResult.

StopScreenRecordingAsync(string?, CancellationToken)

Stops screencast video recording.

[Experimental("BIDICDP001")]
Task<StopScreenRecordingResult> StopScreenRecordingAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StopScreenRecordingResult>

A task representing the asynchronous operation, containing a StopScreenRecordingResult.

StopScreencastAsync(string?, CancellationToken)

Stops sending each frame in the screencastFrame.

[Experimental("BIDICDP001")]
Task<StopScreencastResult> StopScreencastAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StopScreencastResult>

A task representing the asynchronous operation, containing a StopScreencastResult.

WaitForDebuggerAsync(string?, CancellationToken)

Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger.

[Experimental("BIDICDP001")]
Task<WaitForDebuggerResult> WaitForDebuggerAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<WaitForDebuggerResult>

A task representing the asynchronous operation, containing a WaitForDebuggerResult.