Interface IPage
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
urlstringdatastringBase64-encoded data (Encoded as a base64 string when passed over JSON)
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
scriptSourcestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sourcestringworldNamestringIf 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.
includeCommandLineAPIbool?Specifies whether command line API should be available to the script, defaults to false.
runImmediatelybool?If true, runs the script immediately on existing execution contexts or worlds. Default: false.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
formatstringImage compression format (defaults to png).
qualitylong?Compression quality from range [0..100] (jpeg only).
clipViewportCapture the screenshot of a given region only.
fromSurfacebool?Capture the screenshot from the surface, rather than the view. Defaults to true.
captureBeyondViewportbool?Capture the screenshot beyond the viewport. Defaults to false.
optimizeForSpeedbool?Optimize image encoding for speed, not for resulting size (defaults to false)
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
formatstringFormat (defaults to mhtml).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
frameIdFrameIdId of the frame in which the isolated world should be created.
worldNamestringAn optional name which is reported in the Execution Context.
grantUniveralAccessbool?Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.
contentSecurityPolicystringAn 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.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
cookieNamestringName of the cookie to remove.
urlstringURL to match cooke domain and path.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
enableFileChooserOpenedEventbool?If true, the Page.fileChooserOpened event will be emitted regardless of the state set by Page.setInterceptFileChooserDialog command (default: false).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
messagestringMessage to be displayed in the report.
groupstringSpecifies the endpoint group to deliver the report to.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
frameIdFrameIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
includeActionableInformationbool?Whether to include actionable information. Defaults to true.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
manifestIdstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
frameIdFrameIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
frameIdFrameIdsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
frameIdFrameIdFrame id to get resource for.
urlstringURL of the resource to get content for.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
acceptboolWhether to accept or dismiss the dialog.
promptTextstringThe text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
urlstringURL to navigate the page to.
referrerstringReferrer URL.
transitionTypeTransitionType?Intended transition type.
frameIdFrameIdFrame id to navigate, if not specified navigates the top frame.
referrerPolicyReferrerPolicy?Referrer-policy used for the navigation.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
entryIdlongUnique id of the entry to navigate to.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
landscapebool?Paper orientation. Defaults to false.
displayHeaderFooterbool?Display header and footer. Defaults to false.
printBackgroundbool?Print background graphics. Defaults to false.
scaledouble?Scale of the webpage rendering. Defaults to 1.
paperWidthdouble?Paper width in inches. Defaults to 8.5 inches.
paperHeightdouble?Paper height in inches. Defaults to 11 inches.
marginTopdouble?Top margin in inches. Defaults to 1cm (~0.4 inches).
marginBottomdouble?Bottom margin in inches. Defaults to 1cm (~0.4 inches).
marginLeftdouble?Left margin in inches. Defaults to 1cm (~0.4 inches).
marginRightdouble?Right margin in inches. Defaults to 1cm (~0.4 inches).
pageRangesstringPaper 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.
headerTemplatestringHTML 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.
footerTemplatestringHTML template for the print footer. Should use the same format as the headerTemplate.
preferCSSPageSizebool?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.
transferModestringreturn as stream
generateTaggedPDFbool?Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice.
generateDocumentOutlinebool?Whether or not to embed the document outline into the PDF.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
scriptsImmutableArray<CompilationCacheParams>sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
ignoreCachebool?If true, browser cache is ignored (as if the user pressed Shift+refresh).
scriptToEvaluateOnLoadstringIf set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin.
loaderIdLoaderIdIf 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.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
identifierScriptIdentifiersessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
identifierScriptIdentifiersessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionIdlongFrame number.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
frameIdFrameIdFrame id for resource to search in.
urlstringURL of the resource to search in.
querystringString to search for.
caseSensitivebool?If true, search is case sensitive.
isRegexbool?If true, treats string parameter as regex.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
enabledboolWhether to block ads.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
enabledboolWhether to bypass page CSP.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
widthlongOverriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
heightlongOverriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
deviceScaleFactordoubleOverriding device scale factor value. 0 disables the override.
mobileboolWhether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
scaledouble?Scale to apply to resulting view image.
screenWidthlong?Overriding screen width value in pixels (minimum 0, maximum 10000000).
screenHeightlong?Overriding screen height value in pixels (minimum 0, maximum 10000000).
positionXlong?Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
positionYlong?Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
dontSetVisibleSizebool?Do not set visible view size, rely upon explicit setVisibleSize call.
screenOrientationScreenOrientationScreen orientation override.
viewportViewportThe viewport dimensions and scale. If not set, the override is cleared.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
alphadoubleMock alpha
betadoubleMock beta
gammadoubleMock gamma
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
frameIdFrameIdFrame id to set HTML for.
htmlstringHTML content to set.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
behaviorstringWhether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
downloadPathstringThe default path to save downloaded files to. This is required if behavior is set to 'allow'
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
fontFamiliesFontFamiliesSpecifies font families to set. If a font family is not specified, it won't be changed.
forScriptsImmutableArray<ScriptFontFamilies>?Specifies font families to set for individual scripts.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
fontSizesFontSizesSpecifies font sizes to set. If a font size is not specified, it won't be changed.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
latitudedouble?Mock latitude
longitudedouble?Mock longitude
accuracydouble?Mock accuracy
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
enabledboolcancelbool?If true, cancels the dialog by emitting relevant events (if any) in addition to not showing it if the interception is enabled (default: false).
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
enabledboolIf true, starts emitting lifecycle events.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
isAllowedboolsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetPrerenderingAllowedResult>
A task representing the asynchronous operation, containing a SetPrerenderingAllowedResult.
SetRPHRegistrationModeAsync(string, string?, CancellationToken)
Extensions for Custom Handlers API: https://html.spec.whatwg.org/multipage/system-state.html#rph-automation
[Experimental("BIDICDP001")]
Task<SetRPHRegistrationModeResult> SetRPHRegistrationModeAsync(string mode, string? session = null, CancellationToken cancellationToken = default)
Parameters
modestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetRPHRegistrationModeResult>
A task representing the asynchronous operation, containing a SetRPHRegistrationModeResult.
SetSPCTransactionModeAsync(string, string?, CancellationToken)
Sets the Secure Payment Confirmation transaction mode. https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode
[Experimental("BIDICDP001")]
Task<SetSPCTransactionModeResult> SetSPCTransactionModeAsync(string mode, string? session = null, CancellationToken cancellationToken = default)
Parameters
modestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
enabledboolWhether the touch event emulation should be enabled.
configurationstringTouch/gesture events configuration. Default: current platform.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
statestringTarget lifecycle state
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
audiobool?maxWidthlong?Maximum frame width in pixels.
maxHeightlong?Maximum frame height in pixels.
frameRatelong?Maximum frame rate in frames per second.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
formatstringImage compression format.
qualitylong?Compression quality from range [0..100].
maxWidthlong?Maximum screenshot width.
maxHeightlong?Maximum screenshot height.
everyNthFramelong?Send every n-th frame. Must be a positive integer.
maxFramesInFlightlong?Maximum number of frames sent until screencastFrameAck is required. Defaults to 3. Must be a positive integer.
sendLastFramebool?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.
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA 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
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<WaitForDebuggerResult>
A task representing the asynchronous operation, containing a WaitForDebuggerResult.