Class PageAdapter
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
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
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
commandAddCompilationCacheCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandAddScriptToEvaluateOnLoadCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandAddScriptToEvaluateOnNewDocumentCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandBringToFrontCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
CaptureScreenshot(CaptureScreenshotCommandSettings, CancellationToken, int?, bool)
Capture page screenshot.
public Task<CaptureScreenshotCommandResponse> CaptureScreenshot(CaptureScreenshotCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandCaptureScreenshotCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandCaptureSnapshotCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandClearCompilationCacheCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandClearDeviceMetricsOverrideCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandClearDeviceOrientationOverrideCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandClearGeolocationOverrideCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandCloseCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandCrashCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandCreateIsolatedWorldCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandDeleteCookieCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandDisableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandEnableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGenerateTestReportCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
GetAdScriptAncestry(GetAdScriptAncestryCommandSettings, CancellationToken, int?, bool)
getAdScriptAncestry
public Task<GetAdScriptAncestryCommandResponse> GetAdScriptAncestry(GetAdScriptAncestryCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandGetAdScriptAncestryCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetAnnotatedPageContentCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetAppIdCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetAppManifestCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetFrameTreeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
GetInstallabilityErrors(GetInstallabilityErrorsCommandSettings?, CancellationToken, int?, bool)
getInstallabilityErrors
public Task<GetInstallabilityErrorsCommandResponse> GetInstallabilityErrors(GetInstallabilityErrorsCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandGetInstallabilityErrorsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetLayoutMetricsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetManifestIconsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetNavigationHistoryCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetOriginTrialsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetPermissionsPolicyStateCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetResourceContentCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetResourceTreeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandHandleJavaScriptDialogCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandNavigateCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandNavigateToHistoryEntryCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandPrintToPDFCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandProduceCompilationCacheCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandReloadCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandRemoveScriptToEvaluateOnLoadCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandRemoveScriptToEvaluateOnNewDocumentCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandResetNavigationHistoryCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandScreencastFrameAckCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSearchInResourceCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetAdBlockingEnabledCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetBypassCSPCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetDeviceMetricsOverrideCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetDeviceOrientationOverrideCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetDocumentContentCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetDownloadBehaviorCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetFontFamiliesCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetFontSizesCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetGeolocationOverrideCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetInterceptFileChooserDialogCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetLifecycleEventsEnabledCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetPrerenderingAllowedCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetRPHRegistrationMode(SetRPHRegistrationModeCommandSettings, CancellationToken, int?, bool)
Extensions for Custom Handlers API: https://html.spec.whatwg.org/multipage/system-state.html#rph-automation
public Task<SetRPHRegistrationModeCommandResponse?> SetRPHRegistrationMode(SetRPHRegistrationModeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetRPHRegistrationModeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetSPCTransactionMode(SetSPCTransactionModeCommandSettings, CancellationToken, int?, bool)
Sets the Secure Payment Confirmation transaction mode. https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode
public Task<SetSPCTransactionModeCommandResponse?> SetSPCTransactionMode(SetSPCTransactionModeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetSPCTransactionModeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetTouchEmulationEnabledCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetWebLifecycleStateCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandStartScreencastCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandStopLoadingCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandStopScreencastCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandWaitForDebuggerCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
CompilationCacheProduced
Issued for every compilation cache generated.
public event EventHandler<CompilationCacheProducedEventArgs>? CompilationCacheProduced
Event Type
DocumentOpened
Fired when opening document to write to.
public event EventHandler<DocumentOpenedEventArgs>? DocumentOpened
Event Type
DomContentEventFired
domContentEventFired
public event EventHandler<DomContentEventFiredEventArgs>? DomContentEventFired
Event Type
DownloadProgress
Fired when download makes progress. Last call has |done| == true. Deprecated. Use Browser.downloadProgress instead.
public event EventHandler<DownloadProgressEventArgs>? DownloadProgress
Event Type
DownloadWillBegin
Fired when page is about to start a download. Deprecated. Use Browser.downloadWillBegin instead.
public event EventHandler<DownloadWillBeginEventArgs>? DownloadWillBegin
Event Type
FileChooserOpened
Emitted only when page.interceptFileChooser is enabled.
public event EventHandler<FileChooserOpenedEventArgs>? FileChooserOpened
Event Type
FrameAttached
Fired when frame has been attached to its parent.
public event EventHandler<FrameAttachedEventArgs>? FrameAttached
Event Type
FrameClearedScheduledNavigation
Fired when frame no longer has a scheduled navigation.
public event EventHandler<FrameClearedScheduledNavigationEventArgs>? FrameClearedScheduledNavigation
Event Type
FrameDetached
Fired when frame has been detached from its parent.
public event EventHandler<FrameDetachedEventArgs>? FrameDetached
Event Type
FrameNavigated
Fired once navigation of the frame has completed. Frame is now associated with the new loader.
public event EventHandler<FrameNavigatedEventArgs>? FrameNavigated
Event Type
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
FrameResized
frameResized
public event EventHandler<FrameResizedEventArgs>? FrameResized
Event Type
FrameScheduledNavigation
Fired when frame schedules a potential navigation.
public event EventHandler<FrameScheduledNavigationEventArgs>? FrameScheduledNavigation
Event Type
FrameStartedLoading
Fired when frame has started loading.
public event EventHandler<FrameStartedLoadingEventArgs>? FrameStartedLoading
Event Type
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
FrameStoppedLoading
Fired when frame has stopped loading.
public event EventHandler<FrameStoppedLoadingEventArgs>? FrameStoppedLoading
Event Type
FrameSubtreeWillBeDetached
Fired before frame subtree is detached. Emitted before any frame of the subtree is actually detached.
public event EventHandler<FrameSubtreeWillBeDetachedEventArgs>? FrameSubtreeWillBeDetached
Event Type
InterstitialHidden
Fired when interstitial page was hidden
public event EventHandler<InterstitialHiddenEventArgs>? InterstitialHidden
Event Type
InterstitialShown
Fired when interstitial page was shown
public event EventHandler<InterstitialShownEventArgs>? InterstitialShown
Event Type
JavascriptDialogClosed
Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.
public event EventHandler<JavascriptDialogClosedEventArgs>? JavascriptDialogClosed
Event Type
JavascriptDialogOpening
Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.
public event EventHandler<JavascriptDialogOpeningEventArgs>? JavascriptDialogOpening
Event Type
LifecycleEvent
Fired for lifecycle events (navigation, load, paint, etc) in the current target (including local frames).
public event EventHandler<LifecycleEventEventArgs>? LifecycleEvent
Event Type
LoadEventFired
loadEventFired
public event EventHandler<LoadEventFiredEventArgs>? LoadEventFired
Event Type
NavigatedWithinDocument
Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation.
public event EventHandler<NavigatedWithinDocumentEventArgs>? NavigatedWithinDocument
Event Type
ScreencastFrame
Compressed image data requested by the startScreencast.
public event EventHandler<ScreencastFrameEventArgs>? ScreencastFrame
Event Type
ScreencastVisibilityChanged
Fired when the page with currently enabled screencast was shown or hidden `.
public event EventHandler<ScreencastVisibilityChangedEventArgs>? ScreencastVisibilityChanged
Event Type
WindowOpen
Fired when a new window is going to be opened, via window.open(), link click, form submission, etc.
public event EventHandler<WindowOpenEventArgs>? WindowOpen