Page

class Page(cdp: CDP) : Domain

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

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class AddCompilationCacheParameter(val url: String, val data: String)
Link copied to clipboard
@Serializable
data class AddScriptToEvaluateOnLoadParameter(val scriptSource: String)
Link copied to clipboard
@Serializable
data class AddScriptToEvaluateOnLoadReturn(val identifier: String)
@Serializable
data class AddScriptToEvaluateOnNewDocumentParameter(val source: String, val worldName: String? = null, val includeCommandLineAPI: Boolean? = null, val runImmediately: Boolean? = null)
Link copied to clipboard
@Serializable
data class AddScriptToEvaluateOnNewDocumentReturn(val identifier: String)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class AdFrameStatus(val adFrameType: Page.AdFrameType, val explanations: List<Page.AdFrameExplanation>? = null)

Indicates whether a frame has been identified as an ad and why.

Link copied to clipboard
@Serializable
enum AdFrameType : Enum<Page.AdFrameType>

Indicates whether a frame has been identified as an ad.

Link copied to clipboard
@Serializable
data class AdScriptAncestry(val ancestryChain: List<Page.AdScriptId>, val rootScriptFilterlistRule: String? = null)

Encapsulates the script ancestry and the root script filterlist rule that caused the frame to be labelled as an ad. Only created when ancestryChain is not empty.

Link copied to clipboard
@Serializable
data class AdScriptId(val scriptId: String, val debuggerId: String)

Identifies the script which caused a script or frame to be labelled as an ad.

Link copied to clipboard
@Serializable
data class AppManifestError(val message: String, val critical: Int, val line: Int, val column: Int)

Error while paring app manifest.

Link copied to clipboard
@Serializable
data class AppManifestParsedProperties(val scope: String)

Parsed app manifest properties.

Link copied to clipboard
@Serializable
data class BackForwardCacheBlockingDetails(val url: String? = null, val function: String? = null, val lineNumber: Int, val columnNumber: Int)
Link copied to clipboard

List of not restored reasons for back-forward cache.

Link copied to clipboard

Types of not restored reasons for back-forward cache.

Link copied to clipboard
@Serializable
data class BackForwardCacheNotUsedParameter(val loaderId: String, val frameId: String, val notRestoredExplanations: List<Page.BackForwardCacheNotRestoredExplanation>, val notRestoredExplanationsTree: Page.BackForwardCacheNotRestoredExplanationTree? = null)

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.

Link copied to clipboard
@Serializable
data class CaptureScreenshotParameter(val format: String? = null, val quality: Int? = null, val clip: Page.Viewport? = null, val fromSurface: Boolean? = null, val captureBeyondViewport: Boolean? = null, val optimizeForSpeed: Boolean? = null)
Link copied to clipboard
@Serializable
data class CaptureScreenshotReturn(val data: String)
Link copied to clipboard
@Serializable
data class CaptureSnapshotParameter(val format: String? = null)
Link copied to clipboard
@Serializable
data class CaptureSnapshotReturn(val data: String)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class CompilationCacheParams(val url: String, val eager: Boolean? = null)

Per-script compilation cache parameters for Page.produceCompilationCache

Link copied to clipboard
@Serializable
data class CompilationCacheProducedParameter(val url: String, val data: String)

Issued for every compilation cache generated. Is only available if Page.setGenerateCompilationCache is enabled.

Link copied to clipboard
@Serializable
data class CreateIsolatedWorldParameter(val frameId: String, val worldName: String? = null, val grantUniveralAccess: Boolean? = null)
Link copied to clipboard
@Serializable
data class CreateIsolatedWorldReturn(val executionContextId: Int)
Link copied to clipboard

Indicates whether the frame is cross-origin isolated and why it is the case.

Link copied to clipboard
@Serializable
data class DeleteCookieParameter(val cookieName: String, val url: String)
Link copied to clipboard
@Serializable
enum DialogType : Enum<Page.DialogType>

Javascript dialog type.

Link copied to clipboard
@Serializable
data class DocumentOpenedParameter(val frame: Page.Frame)

Fired when opening document to write to.

Link copied to clipboard
@Serializable
data class DomContentEventFiredParameter(val timestamp: Double)
Link copied to clipboard
@Serializable
data class DownloadProgressParameter(val guid: String, val totalBytes: Double, val receivedBytes: Double, val state: String)

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

Link copied to clipboard
@Serializable
data class DownloadWillBeginParameter(val frameId: String, val guid: String, val url: String, val suggestedFilename: String)

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

Link copied to clipboard
@Serializable
data class EnableParameter(val enableFileChooserOpenedEvent: Boolean? = null)
Link copied to clipboard
@Serializable
data class FileChooserOpenedParameter(val frameId: String, val mode: String, val backendNodeId: Int? = null)

Emitted only when page.interceptFileChooser is enabled.

Link copied to clipboard
@Serializable
data class FileFilter(val name: String? = null, val accepts: List<String>? = null)
Link copied to clipboard
@Serializable
data class FileHandler(val action: String, val name: String, val icons: List<Page.ImageResource>? = null, val accepts: List<Page.FileFilter>? = null, val launchType: String)
Link copied to clipboard
@Serializable
data class FontFamilies(val standard: String? = null, val fixed: String? = null, val serif: String? = null, val sansSerif: String? = null, val cursive: String? = null, val fantasy: String? = null, val math: String? = null)

Generic font families collection.

Link copied to clipboard
@Serializable
data class FontSizes(val standard: Int? = null, val fixed: Int? = null)

Default font sizes.

Link copied to clipboard
@Serializable
data class Frame(val id: String, val parentId: String? = null, val loaderId: String, val name: String? = null, val url: String, val urlFragment: String? = null, val domainAndRegistry: String, val securityOrigin: String, val securityOriginDetails: Page.SecurityOriginDetails? = null, val mimeType: String, val unreachableUrl: String? = null, val adFrameStatus: Page.AdFrameStatus? = null, val secureContextType: Page.SecureContextType, val crossOriginIsolatedContextType: Page.CrossOriginIsolatedContextType, val gatedAPIFeatures: List<Page.GatedAPIFeatures>)

Information about the Frame on the page.

Link copied to clipboard
@Serializable
data class FrameAttachedParameter(val frameId: String, val parentFrameId: String, val stack: Runtime.StackTrace? = null)

Fired when frame has been attached to its parent.

Link copied to clipboard
@Serializable
data class FrameClearedScheduledNavigationParameter(val frameId: String)

Fired when frame no longer has a scheduled navigation.

Link copied to clipboard
@Serializable
data class FrameDetachedParameter(val frameId: String, val reason: String)

Fired when frame has been detached from its parent.

Link copied to clipboard
@Serializable
data class FrameNavigatedParameter(val frame: Page.Frame, val type: Page.NavigationType)

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

Link copied to clipboard
@Serializable
data class FrameRequestedNavigationParameter(val frameId: String, val reason: Page.ClientNavigationReason, val url: String, val disposition: Page.ClientNavigationDisposition)

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

Link copied to clipboard
@Serializable
data class FrameResource(val url: String, val type: Network.ResourceType, val mimeType: String, val lastModified: Double? = null, val contentSize: Double? = null, val failed: Boolean? = null, val canceled: Boolean? = null)

Information about the Resource on the page.

Link copied to clipboard
@Serializable
data class FrameResourceTree(val frame: Page.Frame, val childFrames: List<Page.FrameResourceTree>? = null, val resources: List<Page.FrameResource>)

Information about the Frame hierarchy along with their cached resources.

Link copied to clipboard
@Serializable
data class FrameScheduledNavigationParameter(val frameId: String, val delay: Double, val reason: Page.ClientNavigationReason, val url: String)

Fired when frame schedules a potential navigation.

Link copied to clipboard
@Serializable
data class FrameStartedLoadingParameter(val frameId: String)

Fired when frame has started loading.

Link copied to clipboard
@Serializable
data class FrameStartedNavigatingParameter(val frameId: String, val url: String, val loaderId: String, val navigationType: String)

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

Link copied to clipboard
@Serializable
data class FrameStoppedLoadingParameter(val frameId: String)

Fired when frame has stopped loading.

Link copied to clipboard
@Serializable
data class FrameSubtreeWillBeDetachedParameter(val frameId: String)

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

Link copied to clipboard
@Serializable
data class FrameTree(val frame: Page.Frame, val childFrames: List<Page.FrameTree>? = null)

Information about the Frame hierarchy.

Link copied to clipboard
Link copied to clipboard
@Serializable
data class GenerateTestReportParameter(val message: String, val group: String? = null)
Link copied to clipboard
@Serializable
data class GetAdScriptAncestryParameter(val frameId: String)
Link copied to clipboard
@Serializable
data class GetAdScriptAncestryReturn(val adScriptAncestry: Page.AdScriptAncestry?)
Link copied to clipboard
@Serializable
data class GetAppIdReturn(val appId: String?, val recommendedId: String?)
Link copied to clipboard
@Serializable
data class GetAppManifestParameter(val manifestId: String? = null)
Link copied to clipboard
@Serializable
data class GetAppManifestReturn(val url: String, val errors: List<Page.AppManifestError>, val data: String?, val parsed: Page.AppManifestParsedProperties?, val manifest: Page.WebAppManifest)
Link copied to clipboard
@Serializable
data class GetFrameTreeReturn(val frameTree: Page.FrameTree)
Link copied to clipboard
@Serializable
data class GetInstallabilityErrorsReturn(val installabilityErrors: List<Page.InstallabilityError>)
Link copied to clipboard
@Serializable
data class GetLayoutMetricsReturn(val layoutViewport: Page.LayoutViewport, val visualViewport: Page.VisualViewport, val contentSize: DOM.Rect, val cssLayoutViewport: Page.LayoutViewport, val cssVisualViewport: Page.VisualViewport, val cssContentSize: DOM.Rect)
Link copied to clipboard
@Serializable
data class GetManifestIconsReturn(val primaryIcon: String?)
Link copied to clipboard
@Serializable
data class GetNavigationHistoryReturn(val currentIndex: Int, val entries: List<Page.NavigationEntry>)
Link copied to clipboard
@Serializable
data class GetOriginTrialsParameter(val frameId: String)
Link copied to clipboard
@Serializable
data class GetOriginTrialsReturn(val originTrials: List<Page.OriginTrial>)
Link copied to clipboard
@Serializable
data class GetPermissionsPolicyStateParameter(val frameId: String)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class GetResourceContentParameter(val frameId: String, val url: String)
Link copied to clipboard
@Serializable
data class GetResourceContentReturn(val content: String, val base64Encoded: Boolean)
Link copied to clipboard
@Serializable
data class GetResourceTreeReturn(val frameTree: Page.FrameResourceTree)
Link copied to clipboard
@Serializable
data class HandleJavaScriptDialogParameter(val accept: Boolean, val promptText: String? = null)
Link copied to clipboard
@Serializable
data class ImageResource(val url: String, val sizes: String? = null, val type: String? = null)

The image definition used in both icon and screenshot.

Link copied to clipboard
@Serializable
data class InstallabilityError(val errorId: String, val errorArguments: List<Page.InstallabilityErrorArgument>)

The installability error

Link copied to clipboard
@Serializable
data class InstallabilityErrorArgument(val name: String, val value: String)
Link copied to clipboard
@Serializable
data class JavascriptDialogClosedParameter(val frameId: String, val result: Boolean, val userInput: String)

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

Link copied to clipboard
@Serializable
data class JavascriptDialogOpeningParameter(val url: String, val frameId: String, val message: String, val type: Page.DialogType, val hasBrowserHandler: Boolean, val defaultPrompt: String? = null)

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

Link copied to clipboard
@Serializable
data class LaunchHandler(val clientMode: String)
Link copied to clipboard
@Serializable
data class LayoutViewport(val pageX: Int, val pageY: Int, val clientWidth: Int, val clientHeight: Int)

Layout viewport position and dimensions.

Link copied to clipboard
@Serializable
data class LifecycleEventParameter(val frameId: String, val loaderId: String, val name: String, val timestamp: Double)

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

Link copied to clipboard
@Serializable
data class LoadEventFiredParameter(val timestamp: Double)
Link copied to clipboard
@Serializable
data class NavigatedWithinDocumentParameter(val frameId: String, val url: String, val navigationType: String)

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

Link copied to clipboard
@Serializable
data class NavigateParameter(val url: String, val referrer: String? = null, val transitionType: Page.TransitionType? = null, val frameId: String? = null, val referrerPolicy: Page.ReferrerPolicy? = null)
Link copied to clipboard
@Serializable
data class NavigateReturn(val frameId: String, val loaderId: String?, val errorText: String?)
Link copied to clipboard
@Serializable
data class NavigateToHistoryEntryParameter(val entryId: Int)
Link copied to clipboard
@Serializable
data class NavigationEntry(val id: Int, val url: String, val userTypedURL: String, val title: String, val transitionType: Page.TransitionType)

Navigation history entry.

Link copied to clipboard

The type of a frameNavigated event.

Link copied to clipboard
@Serializable
data class OriginTrial(val trialName: String, val status: Page.OriginTrialStatus, val tokensWithStatus: List<Page.OriginTrialTokenWithStatus>)
Link copied to clipboard

Status for an Origin Trial.

Link copied to clipboard
@Serializable
data class OriginTrialToken(val origin: String, val matchSubDomains: Boolean, val trialName: String, val expiryTime: Double, val isThirdParty: Boolean, val usageRestriction: Page.OriginTrialUsageRestriction)
Link copied to clipboard

Origin Trial(https://www.chromium.org/blink/origin-trials) support. Status for an Origin Trial token.

Link copied to clipboard
@Serializable
data class OriginTrialTokenWithStatus(val rawTokenText: String, val parsedToken: Page.OriginTrialToken? = null, val status: Page.OriginTrialTokenStatus)
Link copied to clipboard
@Serializable
data class PermissionsPolicyBlockLocator(val frameId: String, val blockReason: Page.PermissionsPolicyBlockReason)
Link copied to clipboard

Reason for a permissions policy feature to be disabled.

Link copied to clipboard

All Permissions Policy features. This enum should match the one defined in services/network/public/cpp/permissions_policy/permissions_policy_features.json5. LINT.IfChange(PermissionsPolicyFeature)

Link copied to clipboard
@Serializable
data class PermissionsPolicyFeatureState(val feature: Page.PermissionsPolicyFeature, val allowed: Boolean, val locator: Page.PermissionsPolicyBlockLocator? = null)
Link copied to clipboard
@Serializable
data class PrintToPDFParameter(val landscape: Boolean? = null, val displayHeaderFooter: Boolean? = null, val printBackground: Boolean? = null, val scale: Double? = null, val paperWidth: Double? = null, val paperHeight: Double? = null, val marginTop: Double? = null, val marginBottom: Double? = null, val marginLeft: Double? = null, val marginRight: Double? = null, val pageRanges: String? = null, val headerTemplate: String? = null, val footerTemplate: String? = null, val preferCSSPageSize: Boolean? = null, val transferMode: String? = null, val generateTaggedPDF: Boolean? = null, val generateDocumentOutline: Boolean? = null)
Link copied to clipboard
@Serializable
data class PrintToPDFReturn(val data: String, val stream: String?)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class ProtocolHandler(val protocol: String, val url: String)
Link copied to clipboard

The referring-policy used for the navigation.

Link copied to clipboard
@Serializable
data class RelatedApplication(val id: String? = null, val url: String)
Link copied to clipboard
@Serializable
data class ReloadParameter(val ignoreCache: Boolean? = null, val scriptToEvaluateOnLoad: String? = null, val loaderId: String? = null)
Link copied to clipboard
@Serializable
data class RemoveScriptToEvaluateOnLoadParameter(val identifier: String)
@Serializable
data class RemoveScriptToEvaluateOnNewDocumentParameter(val identifier: String)
Link copied to clipboard
@Serializable
data class ScopeExtension(val origin: String, val hasOriginWildcard: Boolean)
Link copied to clipboard
@Serializable
data class ScreencastFrameAckParameter(val sessionId: Int)
Link copied to clipboard
@Serializable
data class ScreencastFrameMetadata(val offsetTop: Double, val pageScaleFactor: Double, val deviceWidth: Double, val deviceHeight: Double, val scrollOffsetX: Double, val scrollOffsetY: Double, val timestamp: Double? = null)

Screencast frame metadata.

Link copied to clipboard
@Serializable
data class ScreencastFrameParameter(val data: String, val metadata: Page.ScreencastFrameMetadata, val sessionId: Int)

Compressed image data requested by the startScreencast.

Link copied to clipboard
@Serializable
data class ScreencastVisibilityChangedParameter(val visible: Boolean)

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

Link copied to clipboard
@Serializable
data class Screenshot(val image: Page.ImageResource, val formFactor: String, val label: String? = null)
Link copied to clipboard
@Serializable
data class ScriptFontFamilies(val script: String, val fontFamilies: Page.FontFamilies)

Font families collection for a script.

Link copied to clipboard
@Serializable
data class SearchInResourceParameter(val frameId: String, val url: String, val query: String, val caseSensitive: Boolean? = null, val isRegex: Boolean? = null)
Link copied to clipboard
@Serializable
data class SearchInResourceReturn(val result: List<Debugger.SearchMatch>)
Link copied to clipboard

Indicates whether the frame is a secure context and why it is the case.

Link copied to clipboard
@Serializable
data class SecurityOriginDetails(val isLocalhost: Boolean)

Additional information about the frame document's security origin.

Link copied to clipboard
@Serializable
data class SetAdBlockingEnabledParameter(val enabled: Boolean)
Link copied to clipboard
@Serializable
data class SetBypassCSPParameter(val enabled: Boolean)
Link copied to clipboard
@Serializable
data class SetDeviceMetricsOverrideParameter(val width: Int, val height: Int, val deviceScaleFactor: Double, val mobile: Boolean, val scale: Double? = null, val screenWidth: Int? = null, val screenHeight: Int? = null, val positionX: Int? = null, val positionY: Int? = null, val dontSetVisibleSize: Boolean? = null, val screenOrientation: Emulation.ScreenOrientation? = null, val viewport: Page.Viewport? = null)
Link copied to clipboard
@Serializable
data class SetDeviceOrientationOverrideParameter(val alpha: Double, val beta: Double, val gamma: Double)
Link copied to clipboard
@Serializable
data class SetDocumentContentParameter(val frameId: String, val html: String)
Link copied to clipboard
@Serializable
data class SetDownloadBehaviorParameter(val behavior: String, val downloadPath: String? = null)
Link copied to clipboard
@Serializable
data class SetFontFamiliesParameter(val fontFamilies: Page.FontFamilies, val forScripts: List<Page.ScriptFontFamilies>? = null)
Link copied to clipboard
@Serializable
data class SetFontSizesParameter(val fontSizes: Page.FontSizes)
Link copied to clipboard
@Serializable
data class SetGeolocationOverrideParameter(val latitude: Double? = null, val longitude: Double? = null, val accuracy: Double? = null)
Link copied to clipboard
@Serializable
data class SetInterceptFileChooserDialogParameter(val enabled: Boolean, val cancel: Boolean? = null)
Link copied to clipboard
@Serializable
data class SetLifecycleEventsEnabledParameter(val enabled: Boolean)
Link copied to clipboard
@Serializable
data class SetPrerenderingAllowedParameter(val isAllowed: Boolean)
Link copied to clipboard
@Serializable
data class SetRPHRegistrationModeParameter(val mode: String)
Link copied to clipboard
@Serializable
data class SetSPCTransactionModeParameter(val mode: String)
Link copied to clipboard
@Serializable
data class SetTouchEmulationEnabledParameter(val enabled: Boolean, val configuration: String? = null)
Link copied to clipboard
@Serializable
data class SetWebLifecycleStateParameter(val state: String)
Link copied to clipboard
@Serializable
data class ShareTarget(val action: String, val method: String, val enctype: String, val title: String? = null, val text: String? = null, val url: String? = null, val files: List<Page.FileFilter>? = null)
Link copied to clipboard
@Serializable
data class Shortcut(val name: String, val url: String)
Link copied to clipboard
@Serializable
data class StartScreencastParameter(val format: String? = null, val quality: Int? = null, val maxWidth: Int? = null, val maxHeight: Int? = null, val everyNthFrame: Int? = null)
Link copied to clipboard

Transition type.

Link copied to clipboard
@Serializable
data class Viewport(val x: Double, val y: Double, val width: Double, val height: Double, val scale: Double)

Viewport for capturing screenshot.

Link copied to clipboard
@Serializable
data class VisualViewport(val offsetX: Double, val offsetY: Double, val pageX: Double, val pageY: Double, val clientWidth: Double, val clientHeight: Double, val scale: Double, val zoom: Double? = null)

Visual viewport position, dimensions, and scale.

Link copied to clipboard
@Serializable
data class WebAppManifest(val backgroundColor: String? = null, val description: String? = null, val dir: String? = null, val display: String? = null, val displayOverrides: List<String>? = null, val fileHandlers: List<Page.FileHandler>? = null, val icons: List<Page.ImageResource>? = null, val id: String? = null, val lang: String? = null, val launchHandler: Page.LaunchHandler? = null, val name: String? = null, val orientation: String? = null, val preferRelatedApplications: Boolean? = null, val protocolHandlers: List<Page.ProtocolHandler>? = null, val relatedApplications: List<Page.RelatedApplication>? = null, val scope: String? = null, val scopeExtensions: List<Page.ScopeExtension>? = null, val screenshots: List<Page.Screenshot>? = null, val shareTarget: Page.ShareTarget? = null, val shortName: String? = null, val shortcuts: List<Page.Shortcut>? = null, val startUrl: String? = null, val themeColor: String? = null)
Link copied to clipboard
@Serializable
data class WindowOpenParameter(val url: String, val windowName: String, val windowFeatures: List<String>, val userGesture: Boolean)

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

Properties

Link copied to clipboard

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.

Link copied to clipboard

Issued for every compilation cache generated. Is only available if Page.setGenerateCompilationCache is enabled.

Link copied to clipboard

Fired when opening document to write to.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

Emitted only when page.interceptFileChooser is enabled.

Link copied to clipboard

Fired when frame has been attached to its parent.

Link copied to clipboard

Fired when frame no longer has a scheduled navigation.

Link copied to clipboard

Fired when frame has been detached from its parent.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
val frameResized: Flow<Unit>
Link copied to clipboard

Fired when frame schedules a potential navigation.

Link copied to clipboard

Fired when frame has started loading.

Link copied to clipboard

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

Link copied to clipboard

Fired when frame has stopped loading.

Link copied to clipboard

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

Link copied to clipboard

Fired when interstitial page was hidden

Link copied to clipboard

Fired when interstitial page was shown

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

Compressed image data requested by the startScreencast.

Link copied to clipboard

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

Link copied to clipboard

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

Functions

Link copied to clipboard
suspend fun addCompilationCache(args: Page.AddCompilationCacheParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun addCompilationCache(url: String, data: String)

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

Link copied to clipboard

Deprecated, please use addScriptToEvaluateOnNewDocument instead.

Link copied to clipboard
suspend fun addScriptToEvaluateOnNewDocument(source: String, worldName: String? = null, includeCommandLineAPI: Boolean? = null, runImmediately: Boolean? = null): Page.AddScriptToEvaluateOnNewDocumentReturn

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

Link copied to clipboard
suspend fun bringToFront(mode: CommandMode = CommandMode.DEFAULT)

Brings page to front (activates tab).

Link copied to clipboard
suspend fun captureScreenshot(format: String? = null, quality: Int? = null, clip: Page.Viewport? = null, fromSurface: Boolean? = null, captureBeyondViewport: Boolean? = null, optimizeForSpeed: Boolean? = null): Page.CaptureScreenshotReturn

Capture page screenshot.

Link copied to clipboard
suspend fun captureSnapshot(format: String? = null): Page.CaptureSnapshotReturn

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

Link copied to clipboard
suspend fun clearCompilationCache(mode: CommandMode = CommandMode.DEFAULT)

Clears seeded compilation cache.

Link copied to clipboard
suspend fun clearDeviceMetricsOverride(mode: CommandMode = CommandMode.DEFAULT)

Clears the overridden device metrics.

Link copied to clipboard
suspend fun clearDeviceOrientationOverride(mode: CommandMode = CommandMode.DEFAULT)

Clears the overridden Device Orientation.

Link copied to clipboard
suspend fun clearGeolocationOverride(mode: CommandMode = CommandMode.DEFAULT)

Clears the overridden Geolocation Position and Error.

Link copied to clipboard
suspend fun close(mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun crash(mode: CommandMode = CommandMode.DEFAULT)

Crashes renderer on the IO thread, generates minidumps.

Link copied to clipboard
suspend fun createIsolatedWorld(frameId: String, worldName: String? = null, grantUniveralAccess: Boolean? = null): Page.CreateIsolatedWorldReturn

Creates an isolated world for the given frame.

Link copied to clipboard
suspend fun deleteCookie(args: Page.DeleteCookieParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun deleteCookie(cookieName: String, url: String)

Deletes browser cookie with given name, domain and path.

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables page domain notifications.

Link copied to clipboard
suspend fun enable(enableFileChooserOpenedEvent: Boolean? = null)
suspend fun enable(args: Page.EnableParameter, mode: CommandMode = CommandMode.DEFAULT)

Enables page domain notifications.

Link copied to clipboard
suspend fun generateTestReport(args: Page.GenerateTestReportParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun generateTestReport(message: String, group: String? = null)

Generates a report for testing.

Link copied to clipboard
suspend fun getAppId(mode: CommandMode = CommandMode.DEFAULT): Page.GetAppIdReturn

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

Link copied to clipboard
suspend fun getAppManifest(manifestId: String? = null): Page.GetAppManifestReturn
suspend fun getAppManifest(args: Page.GetAppManifestParameter, mode: CommandMode = CommandMode.DEFAULT): Page.GetAppManifestReturn

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.

Link copied to clipboard
suspend fun getFrameTree(mode: CommandMode = CommandMode.DEFAULT): Page.GetFrameTreeReturn

Returns present frame tree structure.

Link copied to clipboard
Link copied to clipboard
suspend fun getLayoutMetrics(mode: CommandMode = CommandMode.DEFAULT): Page.GetLayoutMetricsReturn

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

Link copied to clipboard
suspend fun getManifestIcons(mode: CommandMode = CommandMode.DEFAULT): Page.GetManifestIconsReturn

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

Link copied to clipboard
suspend fun getNavigationHistory(mode: CommandMode = CommandMode.DEFAULT): Page.GetNavigationHistoryReturn

Returns navigation history for the current page.

Link copied to clipboard

Get Origin Trials on given frame.

Link copied to clipboard

Get Permissions Policy state on given frame.

Link copied to clipboard

Returns content of the given resource.

Link copied to clipboard
suspend fun getResourceTree(mode: CommandMode = CommandMode.DEFAULT): Page.GetResourceTreeReturn

Returns present frame / resource tree structure.

Link copied to clipboard
suspend fun handleJavaScriptDialog(args: Page.HandleJavaScriptDialogParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun handleJavaScriptDialog(accept: Boolean, promptText: String? = null)

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

Link copied to clipboard
suspend fun navigate(args: Page.NavigateParameter, mode: CommandMode = CommandMode.DEFAULT): Page.NavigateReturn
suspend fun navigate(url: String, referrer: String? = null, transitionType: Page.TransitionType? = null, frameId: String? = null, referrerPolicy: Page.ReferrerPolicy? = null): Page.NavigateReturn

Navigates current page to the given URL.

Link copied to clipboard
suspend fun navigateToHistoryEntry(entryId: Int)
suspend fun navigateToHistoryEntry(args: Page.NavigateToHistoryEntryParameter, mode: CommandMode = CommandMode.DEFAULT)

Navigates current page to the given history entry.

Link copied to clipboard
suspend fun printToPDF(args: Page.PrintToPDFParameter, mode: CommandMode = CommandMode.DEFAULT): Page.PrintToPDFReturn
suspend fun printToPDF(landscape: Boolean? = null, displayHeaderFooter: Boolean? = null, printBackground: Boolean? = null, scale: Double? = null, paperWidth: Double? = null, paperHeight: Double? = null, marginTop: Double? = null, marginBottom: Double? = null, marginLeft: Double? = null, marginRight: Double? = null, pageRanges: String? = null, headerTemplate: String? = null, footerTemplate: String? = null, preferCSSPageSize: Boolean? = null, transferMode: String? = null, generateTaggedPDF: Boolean? = null, generateDocumentOutline: Boolean? = null): Page.PrintToPDFReturn

Print page as PDF.

Link copied to clipboard
suspend fun produceCompilationCache(args: Page.ProduceCompilationCacheParameter, mode: CommandMode = CommandMode.DEFAULT)

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.

Link copied to clipboard
suspend fun reload(args: Page.ReloadParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun reload(ignoreCache: Boolean? = null, scriptToEvaluateOnLoad: String? = null, loaderId: String? = null)

Reloads given page optionally ignoring the cache.

Link copied to clipboard
suspend fun removeScriptToEvaluateOnLoad(identifier: String)

Deprecated, please use removeScriptToEvaluateOnNewDocument instead.

Link copied to clipboard

Removes given script from the list.

Link copied to clipboard
suspend fun resetNavigationHistory(mode: CommandMode = CommandMode.DEFAULT)

Resets navigation history for the current page.

Link copied to clipboard
suspend fun screencastFrameAck(sessionId: Int)
suspend fun screencastFrameAck(args: Page.ScreencastFrameAckParameter, mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun searchInResource(frameId: String, url: String, query: String, caseSensitive: Boolean? = null, isRegex: Boolean? = null): Page.SearchInResourceReturn

Searches for given string in resource content.

Link copied to clipboard
suspend fun setAdBlockingEnabled(enabled: Boolean)
suspend fun setAdBlockingEnabled(args: Page.SetAdBlockingEnabledParameter, mode: CommandMode = CommandMode.DEFAULT)

Enable Chrome's experimental ad filter on all sites.

Link copied to clipboard
suspend fun setBypassCSP(enabled: Boolean)
suspend fun setBypassCSP(args: Page.SetBypassCSPParameter, mode: CommandMode = CommandMode.DEFAULT)

Enable page Content Security Policy by-passing.

Link copied to clipboard
suspend fun setDeviceMetricsOverride(args: Page.SetDeviceMetricsOverrideParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setDeviceMetricsOverride(width: Int, height: Int, deviceScaleFactor: Double, mobile: Boolean, scale: Double? = null, screenWidth: Int? = null, screenHeight: Int? = null, positionX: Int? = null, positionY: Int? = null, dontSetVisibleSize: Boolean? = null, screenOrientation: Emulation.ScreenOrientation? = null, viewport: Page.Viewport? = null)

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

Link copied to clipboard
suspend fun setDeviceOrientationOverride(alpha: Double, beta: Double, gamma: Double)

Overrides the Device Orientation.

Link copied to clipboard
suspend fun setDocumentContent(args: Page.SetDocumentContentParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setDocumentContent(frameId: String, html: String)

Sets given markup as the document's HTML.

Link copied to clipboard
suspend fun setDownloadBehavior(args: Page.SetDownloadBehaviorParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setDownloadBehavior(behavior: String, downloadPath: String? = null)

Set the behavior when downloading a file.

Link copied to clipboard
suspend fun setFontFamilies(fontFamilies: Page.FontFamilies, forScripts: List<Page.ScriptFontFamilies>? = null)
suspend fun setFontFamilies(args: Page.SetFontFamiliesParameter, mode: CommandMode = CommandMode.DEFAULT)

Set generic font families.

Link copied to clipboard
suspend fun setFontSizes(fontSizes: Page.FontSizes)
suspend fun setFontSizes(args: Page.SetFontSizesParameter, mode: CommandMode = CommandMode.DEFAULT)

Set default font sizes.

Link copied to clipboard
suspend fun setGeolocationOverride(args: Page.SetGeolocationOverrideParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setGeolocationOverride(latitude: Double? = null, longitude: Double? = null, accuracy: Double? = null)

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

Link copied to clipboard
suspend fun setInterceptFileChooserDialog(enabled: Boolean, cancel: Boolean? = null)

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.

Link copied to clipboard
suspend fun setLifecycleEventsEnabled(enabled: Boolean)
suspend fun setLifecycleEventsEnabled(args: Page.SetLifecycleEventsEnabledParameter, mode: CommandMode = CommandMode.DEFAULT)

Controls whether page will emit lifecycle events.

Link copied to clipboard
suspend fun setPrerenderingAllowed(isAllowed: Boolean)
suspend fun setPrerenderingAllowed(args: Page.SetPrerenderingAllowedParameter, mode: CommandMode = CommandMode.DEFAULT)

Enable/disable prerendering manually.

Link copied to clipboard
suspend fun setRPHRegistrationMode(mode: String)
suspend fun setRPHRegistrationMode(args: Page.SetRPHRegistrationModeParameter, mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun setSPCTransactionMode(mode: String)
suspend fun setSPCTransactionMode(args: Page.SetSPCTransactionModeParameter, mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun setTouchEmulationEnabled(args: Page.SetTouchEmulationEnabledParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setTouchEmulationEnabled(enabled: Boolean, configuration: String? = null)

Toggles mouse event-based touch event emulation.

Link copied to clipboard
suspend fun setWebLifecycleState(state: String)
suspend fun setWebLifecycleState(args: Page.SetWebLifecycleStateParameter, mode: CommandMode = CommandMode.DEFAULT)

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/

Link copied to clipboard
suspend fun startScreencast(args: Page.StartScreencastParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun startScreencast(format: String? = null, quality: Int? = null, maxWidth: Int? = null, maxHeight: Int? = null, everyNthFrame: Int? = null)

Starts sending each frame using the screencastFrame event.

Link copied to clipboard
suspend fun stopLoading(mode: CommandMode = CommandMode.DEFAULT)

Force the page stop all navigations and pending resource fetches.

Link copied to clipboard
suspend fun stopScreencast(mode: CommandMode = CommandMode.DEFAULT)

Stops sending each frame in the screencastFrame.

Link copied to clipboard
suspend fun waitForDebugger(mode: CommandMode = CommandMode.DEFAULT)

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