class PageOperations
(source)
Actions and events related to the inspected page belong to the page domain.
Link
Protocol Page domain documentation.
fun addCompilationCache(input: AddCompilationCacheRequest): Single<ResponseFrame>
Seeds compilation cache for given url. Compilation cache does not survive cross-process navigation. |
|
fun
Deprecated, please use addScriptToEvaluateOnNewDocument instead. |
|
fun addScriptToEvaluateOnNewDocument(input: AddScriptToEvaluateOnNewDocumentRequest): Single<AddScriptToEvaluateOnNewDocumentResponse>
Evaluates given script in every frame upon creation (before loading frame's scripts). |
|
fun bringToFront(): Single<ResponseFrame>
Brings page to front (activates tab). |
|
fun captureScreenshot(input: CaptureScreenshotRequest): Single<CaptureScreenshotResponse>
Capture page screenshot. |
|
fun captureSnapshot(input: CaptureSnapshotRequest): Single<CaptureSnapshotResponse>
Returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles. |
|
fun clearCompilationCache(): Single<ResponseFrame>
Clears seeded compilation cache. |
|
fun
Clears the overriden device metrics. |
|
fun
Clears the overridden Device Orientation. |
|
fun
Clears the overriden Geolocation Position and Error. |
|
fun close(): Single<ResponseFrame>
Tries to close page, running its beforeunload hooks, if any. |
|
fun compilationCacheProduced(): Flowable<CompilationCacheProducedEvent>
Issued for every compilation cache generated. Is only available if Page.setGenerateCompilationCache is enabled. |
|
fun crash(): Single<ResponseFrame>
Crashes renderer on the IO thread, generates minidumps. |
|
fun createIsolatedWorld(input: CreateIsolatedWorldRequest): Single<CreateIsolatedWorldResponse>
Creates an isolated world for the given frame. |
|
fun
Deletes browser cookie with given name, domain and path. |
|
fun disable(): Single<ResponseFrame>
Disables page domain notifications. |
|
fun domContentEventFired(): Flowable<DomContentEventFiredEvent>
Returns observable capturing all Page.domContentEventFired events. |
|
fun downloadWillBegin(): Flowable<DownloadWillBeginEvent>
Fired when page is about to start a download. |
|
fun enable(): Single<ResponseFrame>
Enables page domain notifications. |
|
fun events(): Flowable<Event>
Returns flowable capturing all Page domains events. |
|
fun fileChooserOpened(): Flowable<FileChooserOpenedEvent>
Emitted only when |
|
fun frameAttached(): Flowable<FrameAttachedEvent>
Fired when frame has been attached to its parent. |
|
fun frameClearedScheduledNavigation(): Flowable<FrameClearedScheduledNavigationEvent>
Fired when frame no longer has a scheduled navigation. |
|
fun frameDetached(): Flowable<FrameDetachedEvent>
Fired when frame has been detached from its parent. |
|
fun frameNavigated(): Flowable<FrameNavigatedEvent>
Fired once navigation of the frame has completed. Frame is now associated with the new loader. |
|
fun frameRequestedNavigation(): Flowable<FrameRequestedNavigationEvent>
Fired when a renderer-initiated navigation is requested. Navigation may still be cancelled after the event is issued. |
|
fun frameResized(): Flowable<Event>
Returns observable capturing all Page.frameResized events. |
|
fun frameScheduledNavigation(): Flowable<FrameScheduledNavigationEvent>
Fired when frame schedules a potential navigation. |
|
fun frameStartedLoading(): Flowable<FrameStartedLoadingEvent>
Fired when frame has started loading. |
|
fun frameStoppedLoading(): Flowable<FrameStoppedLoadingEvent>
Fired when frame has stopped loading. |
|
fun generateTestReport(input: GenerateTestReportRequest): Single<ResponseFrame>
Generates a report for testing. |
|
fun getAppManifest(): Single<GetAppManifestResponse> |
|
fun
Returns all browser cookies. Depending on the backend support, will return detailed cookie
information in the |
|
fun getFrameTree(): Single<GetFrameTreeResponse>
Returns present frame tree structure. |
|
fun getInstallabilityErrors(): Single<GetInstallabilityErrorsResponse> |
|
fun getLayoutMetrics(): Single<GetLayoutMetricsResponse>
Returns metrics relating to the layouting of the page, such as viewport bounds/scale. |
|
fun getManifestIcons(): Single<GetManifestIconsResponse> |
|
fun getNavigationHistory(): Single<GetNavigationHistoryResponse>
Returns navigation history for the current page. |
|
fun getResourceContent(input: GetResourceContentRequest): Single<GetResourceContentResponse>
Returns content of the given resource. |
|
fun getResourceTree(): Single<GetResourceTreeResponse>
Returns present frame / resource tree structure. |
|
fun handleJavaScriptDialog(input: HandleJavaScriptDialogRequest): Single<ResponseFrame>
Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). |
|
fun interstitialHidden(): Flowable<Event>
Fired when interstitial page was hidden |
|
fun interstitialShown(): Flowable<Event>
Fired when interstitial page was shown |
|
fun javascriptDialogClosed(): Flowable<JavascriptDialogClosedEvent>
Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed. |
|
fun javascriptDialogOpening(): Flowable<JavascriptDialogOpeningEvent>
Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open. |
|
fun lifecycleEvent(): Flowable<LifecycleEventEvent>
Fired for top level page lifecycle events such as navigation, load, paint, etc. |
|
fun loadEventFired(): Flowable<LoadEventFiredEvent>
Returns observable capturing all Page.loadEventFired events. |
|
fun navigate(: NavigateRequest): Single<NavigateResponse>
Navigates current page to the given URL. |
|
fun navigatedWithinDocument(): Flowable<NavigatedWithinDocumentEvent>
Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. |
|
fun navigateToHistoryEntry(: NavigateToHistoryEntryRequest): Single<ResponseFrame>
Navigates current page to the given history entry. |
|
fun printToPDF(input: PrintToPDFRequest): Single<PrintToPDFResponse>
Print page as PDF. |
|
fun reload(input: ReloadRequest): Single<ResponseFrame>
Reloads given page optionally ignoring the cache. |
|
fun
Deprecated, please use removeScriptToEvaluateOnNewDocument instead. |
|
fun removeScriptToEvaluateOnNewDocument(input: RemoveScriptToEvaluateOnNewDocumentRequest): Single<ResponseFrame>
Removes given script from the list. |
|
fun resetNavigationHistory(): Single<ResponseFrame>
Resets navigation history for the current page. |
|
fun screencastFrame(): Flowable<ScreencastFrameEvent>
Compressed image data requested by the |
|
fun screencastFrameAck(input: ScreencastFrameAckRequest): Single<ResponseFrame>
Acknowledges that a screencast frame has been received by the frontend. |
|
fun screencastVisibilityChanged(): Flowable<ScreencastVisibilityChangedEvent>
Fired when the page with currently enabled screencast was shown or hidden `. |
|
fun searchInResource(input: SearchInResourceRequest): Single<SearchInResourceResponse>
Searches for given string in resource content. |
|
fun setAdBlockingEnabled(input: SetAdBlockingEnabledRequest): Single<ResponseFrame>
Enable Chrome's experimental ad filter on all sites. |
|
fun setBypassCSP(input: SetBypassCSPRequest): Single<ResponseFrame>
Enable page Content Security Policy by-passing. |
|
fun
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). |
|
fun
Overrides the Device Orientation. |
|
fun setDocumentContent(input: SetDocumentContentRequest): Single<ResponseFrame>
Sets given markup as the document's HTML. |
|
fun setDownloadBehavior(input: SetDownloadBehaviorRequest): Single<ResponseFrame>
Set the behavior when downloading a file. |
|
fun setFontFamilies(input: SetFontFamiliesRequest): Single<ResponseFrame>
Set generic font families. |
|
fun setFontSizes(input: SetFontSizesRequest): Single<ResponseFrame>
Set default font sizes. |
|
fun
Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable. |
|
fun setInterceptFileChooserDialog(input: SetInterceptFileChooserDialogRequest): Single<ResponseFrame>
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 |
|
fun setLifecycleEventsEnabled(input: SetLifecycleEventsEnabledRequest): Single<ResponseFrame>
Controls whether page will emit lifecycle events. |
|
fun setProduceCompilationCache(input: SetProduceCompilationCacheRequest): Single<ResponseFrame>
Forces compilation cache to be generated for every subresource script. |
|
fun
Toggles mouse event-based touch event emulation. |
|
fun setWebLifecycleState(input: SetWebLifecycleStateRequest): Single<ResponseFrame>
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/ |
|
fun startScreencast(input: StartScreencastRequest): Single<ResponseFrame>
Starts sending each frame using the |
|
fun stopLoading(): Single<ResponseFrame>
Force the page stop all navigations and pending resource fetches. |
|
fun stopScreencast(): Single<ResponseFrame>
Stops sending each frame in the |
|
fun waitForDebugger(): Single<ResponseFrame>
Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger. |
|
fun windowOpen(): Flowable<WindowOpenEvent>
Fired when a new window is going to be opened, via window.open(), link click, form submission, etc. |