PageClient Class (original) (raw)

Name

Description

Public method

AddCompilationCacheAsync

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

Public method

AddScriptToEvaluateOnNewDocumentAsync

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

Public method

BringToFrontAsync

Brings page to front (activates tab).

Public method

CaptureScreenshotAsync

Capture page screenshot.

Public method

CaptureSnapshotAsync

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 method

ClearCompilationCacheAsync

Clears seeded compilation cache.

Public method

CloseAsync

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

Public method

CrashAsync

Crashes renderer on the IO thread, generates minidumps.

Public method

CreateIsolatedWorldAsync

Creates an isolated world for the given frame.

Public method

DisableAsync

Disables page domain notifications.

Public method

EnableAsync

Enables page domain notifications.

Protected method

EnumToString(ContentEncoding)

(Inherited from DevToolsDomainBase.)

Protected method

EnumToString(CSPViolationType)

(Inherited from DevToolsDomainBase.)

Protected method

EnumToString(DisabledImageType)

(Inherited from DevToolsDomainBase.)

Protected method

EnumToString(Enum)

(Inherited from DevToolsDomainBase.)

Protected method

EnumToString(PermissionType)

(Inherited from DevToolsDomainBase.)

Public method

Equals

Determines whether the specified object is equal to the current object.

(Inherited from Object.)

Protected method

Finalize

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

(Inherited from Object.)

Public method

GenerateTestReportAsync

Generates a report for testing.

Public method

GetAdScriptIdAsync

GetAdScriptId

Public method

GetAppIdAsync

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

Public method

GetAppManifestAsync

GetAppManifest

Public method

GetFrameTreeAsync

Returns present frame tree structure.

Public method

GetHashCode

Serves as the default hash function.

(Inherited from Object.)

Public method

GetInstallabilityErrorsAsync

GetInstallabilityErrors

Public method

GetLayoutMetricsAsync

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

Public method

GetNavigationHistoryAsync

Returns navigation history for the current page.

Public method

GetOriginTrialsAsync

Get Origin Trials on given frame.

Public method

GetPermissionsPolicyStateAsync

Get Permissions Policy state on given frame.

Public method

GetResourceContentAsync

Returns content of the given resource.

Public method

GetResourceTreeAsync

Returns present frame / resource tree structure.

Public method

GetType

Gets the Type of the current instance.

(Inherited from Object.)

Public method

HandleJavaScriptDialogAsync

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

Protected method

MemberwiseClone

Creates a shallow copy of the current Object.

(Inherited from Object.)

Public method

NavigateAsync

Navigates current page to the given URL.

Public method

NavigateToHistoryEntryAsync

Navigates current page to the given history entry.

Public method

PrintToPDFAsync

Print page as PDF.

Public method

ProduceCompilationCacheAsync

Requests backend to produce compilation cache for the specified scripts. `scripts` are appeneded to the list of scripts for which the cache would be produced. The list may be reset during page navigation. When script with a matching URL is encountered, the cache is optionally produced upon backend discretion, based on internal heuristics. See also: `Page.compilationCacheProduced`.

Public method

ReloadAsync

Reloads given page optionally ignoring the cache.

Public method

RemoveScriptToEvaluateOnNewDocumentAsync

Removes given script from the list.

Public method

ResetNavigationHistoryAsync

Resets navigation history for the current page.

Public method

ScreencastFrameAckAsync

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

Public method

SearchInResourceAsync

Searches for given string in resource content.

Public method

SetAdBlockingEnabledAsync

Enable Chrome's experimental ad filter on all sites.

Public method

SetBypassCSPAsync

Enable page Content Security Policy by-passing.

Public method

SetDocumentContentAsync

Sets given markup as the document's HTML.

Public method

SetFontFamiliesAsync

Set generic font families.

Public method

SetFontSizesAsync

Set default font sizes.

Public method

SetInterceptFileChooserDialogAsync

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 method

SetLifecycleEventsEnabledAsync

Controls whether page will emit lifecycle events.

Public method

SetPrerenderingAllowedAsync

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 method

SetRPHRegistrationModeAsync

Extensions for Custom Handlers API: https://html.spec.whatwg.org/multipage/system-state.html#rph-automation

Public method

SetSPCTransactionModeAsync

Sets the Secure Payment Confirmation transaction mode. https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode

Public method

SetWebLifecycleStateAsync

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 method

StartScreencastAsync

Starts sending each frame using the `screencastFrame` event.

Public method

StopLoadingAsync

Force the page stop all navigations and pending resource fetches.

Public method

StopScreencastAsync

Stops sending each frame in the `screencastFrame`.

Protected method

ToBase64String

(Inherited from DevToolsDomainBase.)

Public method

ToString

Returns a string that represents the current object.

(Inherited from Object.)

Public method

WaitForDebuggerAsync

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