Table of Contents

Class PageAdapter

Namespace
OpenQA.Selenium.DevTools.V147.Page
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Page domain to simplify the command interface.

public class PageAdapter
Inheritance
PageAdapter
Inherited Members

Constructors

PageAdapter(IDevToolsSession)

Initializes a new instance of the PageAdapter class.

public PageAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

AddCompilationCache(AddCompilationCacheCommandSettings, CancellationToken, int?, bool)

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

public Task<AddCompilationCacheCommandResponse?> AddCompilationCache(AddCompilationCacheCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddCompilationCacheCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddCompilationCacheCommandResponse>

AddScriptToEvaluateOnLoad(AddScriptToEvaluateOnLoadCommandSettings, CancellationToken, int?, bool)

Deprecated, please use addScriptToEvaluateOnNewDocument instead.

public Task<AddScriptToEvaluateOnLoadCommandResponse> AddScriptToEvaluateOnLoad(AddScriptToEvaluateOnLoadCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddScriptToEvaluateOnLoadCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddScriptToEvaluateOnLoadCommandResponse>

AddScriptToEvaluateOnNewDocument(AddScriptToEvaluateOnNewDocumentCommandSettings, CancellationToken, int?, bool)

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

public Task<AddScriptToEvaluateOnNewDocumentCommandResponse> AddScriptToEvaluateOnNewDocument(AddScriptToEvaluateOnNewDocumentCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddScriptToEvaluateOnNewDocumentCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddScriptToEvaluateOnNewDocumentCommandResponse>

BringToFront(BringToFrontCommandSettings?, CancellationToken, int?, bool)

Brings page to front (activates tab).

public Task<BringToFrontCommandResponse?> BringToFront(BringToFrontCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command BringToFrontCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<BringToFrontCommandResponse>

CaptureScreenshot(CaptureScreenshotCommandSettings, CancellationToken, int?, bool)

Capture page screenshot.

public Task<CaptureScreenshotCommandResponse> CaptureScreenshot(CaptureScreenshotCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CaptureScreenshotCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CaptureScreenshotCommandResponse>

CaptureSnapshot(CaptureSnapshotCommandSettings, CancellationToken, int?, bool)

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

public Task<CaptureSnapshotCommandResponse> CaptureSnapshot(CaptureSnapshotCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CaptureSnapshotCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CaptureSnapshotCommandResponse>

ClearCompilationCache(ClearCompilationCacheCommandSettings?, CancellationToken, int?, bool)

Clears seeded compilation cache.

public Task<ClearCompilationCacheCommandResponse?> ClearCompilationCache(ClearCompilationCacheCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearCompilationCacheCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearCompilationCacheCommandResponse>

ClearDeviceMetricsOverride(ClearDeviceMetricsOverrideCommandSettings?, CancellationToken, int?, bool)

Clears the overridden device metrics.

public Task<ClearDeviceMetricsOverrideCommandResponse?> ClearDeviceMetricsOverride(ClearDeviceMetricsOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearDeviceMetricsOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearDeviceMetricsOverrideCommandResponse>

ClearDeviceOrientationOverride(ClearDeviceOrientationOverrideCommandSettings?, CancellationToken, int?, bool)

Clears the overridden Device Orientation.

public Task<ClearDeviceOrientationOverrideCommandResponse?> ClearDeviceOrientationOverride(ClearDeviceOrientationOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearDeviceOrientationOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearDeviceOrientationOverrideCommandResponse>

ClearGeolocationOverride(ClearGeolocationOverrideCommandSettings?, CancellationToken, int?, bool)

Clears the overridden Geolocation Position and Error.

public Task<ClearGeolocationOverrideCommandResponse?> ClearGeolocationOverride(ClearGeolocationOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearGeolocationOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearGeolocationOverrideCommandResponse>

Close(CloseCommandSettings?, CancellationToken, int?, bool)

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

public Task<CloseCommandResponse?> Close(CloseCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CloseCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CloseCommandResponse>

Crash(CrashCommandSettings?, CancellationToken, int?, bool)

Crashes renderer on the IO thread, generates minidumps.

public Task<CrashCommandResponse?> Crash(CrashCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CrashCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CrashCommandResponse>

CreateIsolatedWorld(CreateIsolatedWorldCommandSettings, CancellationToken, int?, bool)

Creates an isolated world for the given frame.

public Task<CreateIsolatedWorldCommandResponse> CreateIsolatedWorld(CreateIsolatedWorldCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CreateIsolatedWorldCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CreateIsolatedWorldCommandResponse>

DeleteCookie(DeleteCookieCommandSettings, CancellationToken, int?, bool)

Deletes browser cookie with given name, domain and path.

public Task<DeleteCookieCommandResponse?> DeleteCookie(DeleteCookieCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DeleteCookieCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DeleteCookieCommandResponse>

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

Disables page domain notifications.

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

Enable(EnableCommandSettings, CancellationToken, int?, bool)

Enables page domain notifications.

public Task<EnableCommandResponse?> Enable(EnableCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

GenerateTestReport(GenerateTestReportCommandSettings, CancellationToken, int?, bool)

Generates a report for testing.

public Task<GenerateTestReportCommandResponse?> GenerateTestReport(GenerateTestReportCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GenerateTestReportCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GenerateTestReportCommandResponse>

GetAdScriptAncestry(GetAdScriptAncestryCommandSettings, CancellationToken, int?, bool)

getAdScriptAncestry

public Task<GetAdScriptAncestryCommandResponse> GetAdScriptAncestry(GetAdScriptAncestryCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetAdScriptAncestryCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetAdScriptAncestryCommandResponse>

GetAnnotatedPageContent(GetAnnotatedPageContentCommandSettings, CancellationToken, int?, bool)

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

public Task<GetAnnotatedPageContentCommandResponse> GetAnnotatedPageContent(GetAnnotatedPageContentCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetAnnotatedPageContentCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetAnnotatedPageContentCommandResponse>

GetAppId(GetAppIdCommandSettings?, CancellationToken, int?, bool)

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

public Task<GetAppIdCommandResponse> GetAppId(GetAppIdCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetAppIdCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetAppIdCommandResponse>

GetAppManifest(GetAppManifestCommandSettings, CancellationToken, int?, bool)

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.

public Task<GetAppManifestCommandResponse> GetAppManifest(GetAppManifestCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetAppManifestCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetAppManifestCommandResponse>

GetFrameTree(GetFrameTreeCommandSettings?, CancellationToken, int?, bool)

Returns present frame tree structure.

public Task<GetFrameTreeCommandResponse> GetFrameTree(GetFrameTreeCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetFrameTreeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetFrameTreeCommandResponse>

GetInstallabilityErrors(GetInstallabilityErrorsCommandSettings?, CancellationToken, int?, bool)

getInstallabilityErrors

public Task<GetInstallabilityErrorsCommandResponse> GetInstallabilityErrors(GetInstallabilityErrorsCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetInstallabilityErrorsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetInstallabilityErrorsCommandResponse>

GetLayoutMetrics(GetLayoutMetricsCommandSettings?, CancellationToken, int?, bool)

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

public Task<GetLayoutMetricsCommandResponse> GetLayoutMetrics(GetLayoutMetricsCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetLayoutMetricsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetLayoutMetricsCommandResponse>

GetManifestIcons(GetManifestIconsCommandSettings?, CancellationToken, int?, bool)

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

public Task<GetManifestIconsCommandResponse> GetManifestIcons(GetManifestIconsCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetManifestIconsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetManifestIconsCommandResponse>

GetNavigationHistory(GetNavigationHistoryCommandSettings?, CancellationToken, int?, bool)

Returns navigation history for the current page.

public Task<GetNavigationHistoryCommandResponse> GetNavigationHistory(GetNavigationHistoryCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetNavigationHistoryCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetNavigationHistoryCommandResponse>

GetOriginTrials(GetOriginTrialsCommandSettings, CancellationToken, int?, bool)

Get Origin Trials on given frame.

public Task<GetOriginTrialsCommandResponse> GetOriginTrials(GetOriginTrialsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetOriginTrialsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetOriginTrialsCommandResponse>

GetPermissionsPolicyState(GetPermissionsPolicyStateCommandSettings, CancellationToken, int?, bool)

Get Permissions Policy state on given frame.

public Task<GetPermissionsPolicyStateCommandResponse> GetPermissionsPolicyState(GetPermissionsPolicyStateCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetPermissionsPolicyStateCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetPermissionsPolicyStateCommandResponse>

GetResourceContent(GetResourceContentCommandSettings, CancellationToken, int?, bool)

Returns content of the given resource.

public Task<GetResourceContentCommandResponse> GetResourceContent(GetResourceContentCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetResourceContentCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetResourceContentCommandResponse>

GetResourceTree(GetResourceTreeCommandSettings?, CancellationToken, int?, bool)

Returns present frame / resource tree structure.

public Task<GetResourceTreeCommandResponse> GetResourceTree(GetResourceTreeCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetResourceTreeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetResourceTreeCommandResponse>

HandleJavaScriptDialog(HandleJavaScriptDialogCommandSettings, CancellationToken, int?, bool)

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

public Task<HandleJavaScriptDialogCommandResponse?> HandleJavaScriptDialog(HandleJavaScriptDialogCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command HandleJavaScriptDialogCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<HandleJavaScriptDialogCommandResponse>

Navigate(NavigateCommandSettings, CancellationToken, int?, bool)

Navigates current page to the given URL.

public Task<NavigateCommandResponse> Navigate(NavigateCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command NavigateCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<NavigateCommandResponse>

NavigateToHistoryEntry(NavigateToHistoryEntryCommandSettings, CancellationToken, int?, bool)

Navigates current page to the given history entry.

public Task<NavigateToHistoryEntryCommandResponse?> NavigateToHistoryEntry(NavigateToHistoryEntryCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command NavigateToHistoryEntryCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<NavigateToHistoryEntryCommandResponse>

PrintToPDF(PrintToPDFCommandSettings, CancellationToken, int?, bool)

Print page as PDF.

public Task<PrintToPDFCommandResponse> PrintToPDF(PrintToPDFCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command PrintToPDFCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<PrintToPDFCommandResponse>

ProduceCompilationCache(ProduceCompilationCacheCommandSettings, CancellationToken, int?, bool)

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.

public Task<ProduceCompilationCacheCommandResponse?> ProduceCompilationCache(ProduceCompilationCacheCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ProduceCompilationCacheCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ProduceCompilationCacheCommandResponse>

Reload(ReloadCommandSettings, CancellationToken, int?, bool)

Reloads given page optionally ignoring the cache.

public Task<ReloadCommandResponse?> Reload(ReloadCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ReloadCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ReloadCommandResponse>

RemoveScriptToEvaluateOnLoad(RemoveScriptToEvaluateOnLoadCommandSettings, CancellationToken, int?, bool)

Deprecated, please use removeScriptToEvaluateOnNewDocument instead.

public Task<RemoveScriptToEvaluateOnLoadCommandResponse?> RemoveScriptToEvaluateOnLoad(RemoveScriptToEvaluateOnLoadCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveScriptToEvaluateOnLoadCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveScriptToEvaluateOnLoadCommandResponse>

RemoveScriptToEvaluateOnNewDocument(RemoveScriptToEvaluateOnNewDocumentCommandSettings, CancellationToken, int?, bool)

Removes given script from the list.

public Task<RemoveScriptToEvaluateOnNewDocumentCommandResponse?> RemoveScriptToEvaluateOnNewDocument(RemoveScriptToEvaluateOnNewDocumentCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveScriptToEvaluateOnNewDocumentCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveScriptToEvaluateOnNewDocumentCommandResponse>

ResetNavigationHistory(ResetNavigationHistoryCommandSettings?, CancellationToken, int?, bool)

Resets navigation history for the current page.

public Task<ResetNavigationHistoryCommandResponse?> ResetNavigationHistory(ResetNavigationHistoryCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ResetNavigationHistoryCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ResetNavigationHistoryCommandResponse>

ScreencastFrameAck(ScreencastFrameAckCommandSettings, CancellationToken, int?, bool)

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

public Task<ScreencastFrameAckCommandResponse?> ScreencastFrameAck(ScreencastFrameAckCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ScreencastFrameAckCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ScreencastFrameAckCommandResponse>

SearchInResource(SearchInResourceCommandSettings, CancellationToken, int?, bool)

Searches for given string in resource content.

public Task<SearchInResourceCommandResponse> SearchInResource(SearchInResourceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SearchInResourceCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SearchInResourceCommandResponse>

SetAdBlockingEnabled(SetAdBlockingEnabledCommandSettings, CancellationToken, int?, bool)

Enable Chrome's experimental ad filter on all sites.

public Task<SetAdBlockingEnabledCommandResponse?> SetAdBlockingEnabled(SetAdBlockingEnabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetAdBlockingEnabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetAdBlockingEnabledCommandResponse>

SetBypassCSP(SetBypassCSPCommandSettings, CancellationToken, int?, bool)

Enable page Content Security Policy by-passing.

public Task<SetBypassCSPCommandResponse?> SetBypassCSP(SetBypassCSPCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetBypassCSPCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetBypassCSPCommandResponse>

SetDeviceMetricsOverride(SetDeviceMetricsOverrideCommandSettings, CancellationToken, int?, bool)

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

public Task<SetDeviceMetricsOverrideCommandResponse?> SetDeviceMetricsOverride(SetDeviceMetricsOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDeviceMetricsOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDeviceMetricsOverrideCommandResponse>

SetDeviceOrientationOverride(SetDeviceOrientationOverrideCommandSettings, CancellationToken, int?, bool)

Overrides the Device Orientation.

public Task<SetDeviceOrientationOverrideCommandResponse?> SetDeviceOrientationOverride(SetDeviceOrientationOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDeviceOrientationOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDeviceOrientationOverrideCommandResponse>

SetDocumentContent(SetDocumentContentCommandSettings, CancellationToken, int?, bool)

Sets given markup as the document's HTML.

public Task<SetDocumentContentCommandResponse?> SetDocumentContent(SetDocumentContentCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDocumentContentCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDocumentContentCommandResponse>

SetDownloadBehavior(SetDownloadBehaviorCommandSettings, CancellationToken, int?, bool)

Set the behavior when downloading a file.

public Task<SetDownloadBehaviorCommandResponse?> SetDownloadBehavior(SetDownloadBehaviorCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDownloadBehaviorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDownloadBehaviorCommandResponse>

SetFontFamilies(SetFontFamiliesCommandSettings, CancellationToken, int?, bool)

Set generic font families.

public Task<SetFontFamiliesCommandResponse?> SetFontFamilies(SetFontFamiliesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetFontFamiliesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetFontFamiliesCommandResponse>

SetFontSizes(SetFontSizesCommandSettings, CancellationToken, int?, bool)

Set default font sizes.

public Task<SetFontSizesCommandResponse?> SetFontSizes(SetFontSizesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetFontSizesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetFontSizesCommandResponse>

SetGeolocationOverride(SetGeolocationOverrideCommandSettings, CancellationToken, int?, bool)

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

public Task<SetGeolocationOverrideCommandResponse?> SetGeolocationOverride(SetGeolocationOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetGeolocationOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetGeolocationOverrideCommandResponse>

SetInterceptFileChooserDialog(SetInterceptFileChooserDialogCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetInterceptFileChooserDialogCommandResponse?> SetInterceptFileChooserDialog(SetInterceptFileChooserDialogCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetInterceptFileChooserDialogCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetInterceptFileChooserDialogCommandResponse>

SetLifecycleEventsEnabled(SetLifecycleEventsEnabledCommandSettings, CancellationToken, int?, bool)

Controls whether page will emit lifecycle events.

public Task<SetLifecycleEventsEnabledCommandResponse?> SetLifecycleEventsEnabled(SetLifecycleEventsEnabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetLifecycleEventsEnabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetLifecycleEventsEnabledCommandResponse>

SetPrerenderingAllowed(SetPrerenderingAllowedCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetPrerenderingAllowedCommandResponse?> SetPrerenderingAllowed(SetPrerenderingAllowedCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPrerenderingAllowedCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPrerenderingAllowedCommandResponse>

SetRPHRegistrationMode(SetRPHRegistrationModeCommandSettings, CancellationToken, int?, bool)

public Task<SetRPHRegistrationModeCommandResponse?> SetRPHRegistrationMode(SetRPHRegistrationModeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetRPHRegistrationModeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetRPHRegistrationModeCommandResponse>

SetSPCTransactionMode(SetSPCTransactionModeCommandSettings, CancellationToken, int?, bool)

public Task<SetSPCTransactionModeCommandResponse?> SetSPCTransactionMode(SetSPCTransactionModeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSPCTransactionModeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSPCTransactionModeCommandResponse>

SetTouchEmulationEnabled(SetTouchEmulationEnabledCommandSettings, CancellationToken, int?, bool)

Toggles mouse event-based touch event emulation.

public Task<SetTouchEmulationEnabledCommandResponse?> SetTouchEmulationEnabled(SetTouchEmulationEnabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetTouchEmulationEnabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetTouchEmulationEnabledCommandResponse>

SetWebLifecycleState(SetWebLifecycleStateCommandSettings, CancellationToken, int?, bool)

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/

public Task<SetWebLifecycleStateCommandResponse?> SetWebLifecycleState(SetWebLifecycleStateCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetWebLifecycleStateCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetWebLifecycleStateCommandResponse>

StartScreencast(StartScreencastCommandSettings, CancellationToken, int?, bool)

Starts sending each frame using the screencastFrame event.

public Task<StartScreencastCommandResponse?> StartScreencast(StartScreencastCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StartScreencastCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StartScreencastCommandResponse>

StopLoading(StopLoadingCommandSettings?, CancellationToken, int?, bool)

Force the page stop all navigations and pending resource fetches.

public Task<StopLoadingCommandResponse?> StopLoading(StopLoadingCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StopLoadingCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StopLoadingCommandResponse>

StopScreencast(StopScreencastCommandSettings?, CancellationToken, int?, bool)

Stops sending each frame in the screencastFrame.

public Task<StopScreencastCommandResponse?> StopScreencast(StopScreencastCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StopScreencastCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StopScreencastCommandResponse>

WaitForDebugger(WaitForDebuggerCommandSettings?, CancellationToken, int?, bool)

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

public Task<WaitForDebuggerCommandResponse?> WaitForDebugger(WaitForDebuggerCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command WaitForDebuggerCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<WaitForDebuggerCommandResponse>

Events

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.

public event EventHandler<BackForwardCacheNotUsedEventArgs>? BackForwardCacheNotUsed

Event Type

EventHandler<BackForwardCacheNotUsedEventArgs>

CompilationCacheProduced

Issued for every compilation cache generated.

public event EventHandler<CompilationCacheProducedEventArgs>? CompilationCacheProduced

Event Type

EventHandler<CompilationCacheProducedEventArgs>

DocumentOpened

Fired when opening document to write to.

public event EventHandler<DocumentOpenedEventArgs>? DocumentOpened

Event Type

EventHandler<DocumentOpenedEventArgs>

DomContentEventFired

domContentEventFired

public event EventHandler<DomContentEventFiredEventArgs>? DomContentEventFired

Event Type

EventHandler<DomContentEventFiredEventArgs>

DownloadProgress

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

public event EventHandler<DownloadProgressEventArgs>? DownloadProgress

Event Type

EventHandler<DownloadProgressEventArgs>

DownloadWillBegin

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

public event EventHandler<DownloadWillBeginEventArgs>? DownloadWillBegin

Event Type

EventHandler<DownloadWillBeginEventArgs>

FileChooserOpened

Emitted only when page.interceptFileChooser is enabled.

public event EventHandler<FileChooserOpenedEventArgs>? FileChooserOpened

Event Type

EventHandler<FileChooserOpenedEventArgs>

FrameAttached

Fired when frame has been attached to its parent.

public event EventHandler<FrameAttachedEventArgs>? FrameAttached

Event Type

EventHandler<FrameAttachedEventArgs>

FrameClearedScheduledNavigation

Fired when frame no longer has a scheduled navigation.

public event EventHandler<FrameClearedScheduledNavigationEventArgs>? FrameClearedScheduledNavigation

Event Type

EventHandler<FrameClearedScheduledNavigationEventArgs>

FrameDetached

Fired when frame has been detached from its parent.

public event EventHandler<FrameDetachedEventArgs>? FrameDetached

Event Type

EventHandler<FrameDetachedEventArgs>

FrameNavigated

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

public event EventHandler<FrameNavigatedEventArgs>? FrameNavigated

Event Type

EventHandler<FrameNavigatedEventArgs>

FrameRequestedNavigation

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

public event EventHandler<FrameRequestedNavigationEventArgs>? FrameRequestedNavigation

Event Type

EventHandler<FrameRequestedNavigationEventArgs>

FrameResized

frameResized

public event EventHandler<FrameResizedEventArgs>? FrameResized

Event Type

EventHandler<FrameResizedEventArgs>

FrameScheduledNavigation

Fired when frame schedules a potential navigation.

public event EventHandler<FrameScheduledNavigationEventArgs>? FrameScheduledNavigation

Event Type

EventHandler<FrameScheduledNavigationEventArgs>

FrameStartedLoading

Fired when frame has started loading.

public event EventHandler<FrameStartedLoadingEventArgs>? FrameStartedLoading

Event Type

EventHandler<FrameStartedLoadingEventArgs>

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

public event EventHandler<FrameStartedNavigatingEventArgs>? FrameStartedNavigating

Event Type

EventHandler<FrameStartedNavigatingEventArgs>

FrameStoppedLoading

Fired when frame has stopped loading.

public event EventHandler<FrameStoppedLoadingEventArgs>? FrameStoppedLoading

Event Type

EventHandler<FrameStoppedLoadingEventArgs>

FrameSubtreeWillBeDetached

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

public event EventHandler<FrameSubtreeWillBeDetachedEventArgs>? FrameSubtreeWillBeDetached

Event Type

EventHandler<FrameSubtreeWillBeDetachedEventArgs>

InterstitialHidden

Fired when interstitial page was hidden

public event EventHandler<InterstitialHiddenEventArgs>? InterstitialHidden

Event Type

EventHandler<InterstitialHiddenEventArgs>

InterstitialShown

Fired when interstitial page was shown

public event EventHandler<InterstitialShownEventArgs>? InterstitialShown

Event Type

EventHandler<InterstitialShownEventArgs>

JavascriptDialogClosed

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

public event EventHandler<JavascriptDialogClosedEventArgs>? JavascriptDialogClosed

Event Type

EventHandler<JavascriptDialogClosedEventArgs>

JavascriptDialogOpening

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

public event EventHandler<JavascriptDialogOpeningEventArgs>? JavascriptDialogOpening

Event Type

EventHandler<JavascriptDialogOpeningEventArgs>

LifecycleEvent

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

public event EventHandler<LifecycleEventEventArgs>? LifecycleEvent

Event Type

EventHandler<LifecycleEventEventArgs>

LoadEventFired

loadEventFired

public event EventHandler<LoadEventFiredEventArgs>? LoadEventFired

Event Type

EventHandler<LoadEventFiredEventArgs>

NavigatedWithinDocument

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

public event EventHandler<NavigatedWithinDocumentEventArgs>? NavigatedWithinDocument

Event Type

EventHandler<NavigatedWithinDocumentEventArgs>

ScreencastFrame

Compressed image data requested by the startScreencast.

public event EventHandler<ScreencastFrameEventArgs>? ScreencastFrame

Event Type

EventHandler<ScreencastFrameEventArgs>

ScreencastVisibilityChanged

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

public event EventHandler<ScreencastVisibilityChangedEventArgs>? ScreencastVisibilityChanged

Event Type

EventHandler<ScreencastVisibilityChangedEventArgs>

WindowOpen

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

public event EventHandler<WindowOpenEventArgs>? WindowOpen

Event Type

EventHandler<WindowOpenEventArgs>