cdp_driver/methods/page.rs
1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! Actions and events related to the inspected page belong to the page
5//! domain.
6//!
7//! Method names for the `Page` domain, for use with
8//! [`CdpClient::call`](crate::CdpClient::call).
9
10/// Deprecated, please use addScriptToEvaluateOnNewDocument instead.
11///
12/// Deprecated in the protocol.
13/// Experimental: may change without notice.
14///
15/// Parameters:
16/// - `scriptSource`: string
17///
18/// Returns: `identifier`
19pub const ADD_SCRIPT_TO_EVALUATE_ON_LOAD: &str = "Page.addScriptToEvaluateOnLoad";
20
21/// Evaluates given script in every frame upon creation (before loading
22/// frame's scripts).
23///
24/// Parameters:
25/// - `source`: string
26/// - `worldName`: string (optional)
27/// - `includeCommandLineAPI`: boolean (optional)
28/// - `runImmediately`: boolean (optional)
29///
30/// Returns: `identifier`
31pub const ADD_SCRIPT_TO_EVALUATE_ON_NEW_DOCUMENT: &str = "Page.addScriptToEvaluateOnNewDocument";
32
33/// Brings page to front (activates tab).
34pub const BRING_TO_FRONT: &str = "Page.bringToFront";
35
36/// Capture page screenshot.
37///
38/// Parameters:
39/// - `format`: string (optional)
40/// - `quality`: integer (optional)
41/// - `clip`: Viewport (optional)
42/// - `fromSurface`: boolean (optional)
43/// - `captureBeyondViewport`: boolean (optional)
44/// - `optimizeForSpeed`: boolean (optional)
45///
46/// Returns: `data`
47pub const CAPTURE_SCREENSHOT: &str = "Page.captureScreenshot";
48
49/// Returns a snapshot of the page as a string. For MHTML format, the
50/// serialization includes iframes, shadow DOM, external resources, and
51/// element-inline styles.
52///
53/// Experimental: may change without notice.
54///
55/// Parameters:
56/// - `format`: string (optional)
57///
58/// Returns: `data`
59pub const CAPTURE_SNAPSHOT: &str = "Page.captureSnapshot";
60
61/// Clears the overridden device metrics.
62///
63/// Deprecated in the protocol.
64/// Experimental: may change without notice.
65pub const CLEAR_DEVICE_METRICS_OVERRIDE: &str = "Page.clearDeviceMetricsOverride";
66
67/// Clears the overridden Device Orientation.
68///
69/// Deprecated in the protocol.
70/// Experimental: may change without notice.
71pub const CLEAR_DEVICE_ORIENTATION_OVERRIDE: &str = "Page.clearDeviceOrientationOverride";
72
73/// Clears the overridden Geolocation Position and Error.
74///
75/// Deprecated in the protocol.
76pub const CLEAR_GEOLOCATION_OVERRIDE: &str = "Page.clearGeolocationOverride";
77
78/// Creates an isolated world for the given frame.
79///
80/// Parameters:
81/// - `frameId`: FrameId
82/// - `worldName`: string (optional)
83/// - `grantUniveralAccess`: boolean (optional)
84/// - `contentSecurityPolicy`: string (optional)
85///
86/// Returns: `executionContextId`
87pub const CREATE_ISOLATED_WORLD: &str = "Page.createIsolatedWorld";
88
89/// Deletes browser cookie with given name, domain and path.
90///
91/// Deprecated in the protocol.
92/// Experimental: may change without notice.
93///
94/// Parameters:
95/// - `cookieName`: string
96/// - `url`: string
97pub const DELETE_COOKIE: &str = "Page.deleteCookie";
98
99/// Disables page domain notifications.
100pub const DISABLE: &str = "Page.disable";
101
102/// Enables page domain notifications.
103///
104/// Parameters:
105/// - `enableFileChooserOpenedEvent`: boolean (optional)
106pub const ENABLE: &str = "Page.enable";
107
108/// Gets the processed manifest for this current document. This API always
109/// waits for the manifest to be loaded. If manifestId is provided, and it
110/// does not match the manifest of the current document, this API errors out.
111/// If there is not a loaded page, this API errors out immediately.
112///
113/// Parameters:
114/// - `manifestId`: string (optional)
115///
116/// Returns: `url`, `errors`, `data`, `parsed`, `manifest`
117pub const GET_APP_MANIFEST: &str = "Page.getAppManifest";
118
119/// `Page.getInstallabilityErrors`
120///
121/// Experimental: may change without notice.
122///
123/// Returns: `installabilityErrors`
124pub const GET_INSTALLABILITY_ERRORS: &str = "Page.getInstallabilityErrors";
125
126/// Deprecated because it's not guaranteed that the returned icon is in fact
127/// the one used for PWA installation.
128///
129/// Deprecated in the protocol.
130/// Experimental: may change without notice.
131///
132/// Returns: `primaryIcon`
133pub const GET_MANIFEST_ICONS: &str = "Page.getManifestIcons";
134
135/// Returns the unique (PWA) app id, along with IWA bundle ID and parent app
136/// info. Only returns values if the feature flag 'WebAppEnableManifestId' is
137/// enabled
138///
139/// Experimental: may change without notice.
140///
141/// Returns: `appId`, `recommendedId`, `bundleId`, `parentAppName`
142pub const GET_APP_ID: &str = "Page.getAppId";
143
144/// Returns the list of installed child Sub-Apps for the inspected parent app.
145///
146/// Experimental: may change without notice.
147///
148/// Returns: `subApps`
149pub const GET_SUB_APPS: &str = "Page.getSubApps";
150
151/// Returns the list of sibling Sub-Apps sharing the same parent app if the
152/// inspected context is a Sub-App.
153///
154/// Experimental: may change without notice.
155///
156/// Returns: `subApps`
157pub const GET_SIBLING_SUB_APPS: &str = "Page.getSiblingSubApps";
158
159/// `Page.getAdScriptAncestry`
160///
161/// Experimental: may change without notice.
162///
163/// Parameters:
164/// - `frameId`: FrameId
165///
166/// Returns: `adScriptAncestry`
167pub const GET_AD_SCRIPT_ANCESTRY: &str = "Page.getAdScriptAncestry";
168
169/// Returns the words that the frame's document added to its spell check
170/// custom dictionary with `document.spellCheckCustomDictionary.addWords()`,
171/// sorted. Page script cannot read the dictionary back; this lets developers
172/// inspect it.
173///
174/// Experimental: may change without notice.
175///
176/// Parameters:
177/// - `frameId`: FrameId
178///
179/// Returns: `words`
180pub const GET_SPELL_CHECK_CUSTOM_DICTIONARY: &str = "Page.getSpellCheckCustomDictionary";
181
182/// Returns present frame tree structure.
183///
184/// Returns: `frameTree`
185pub const GET_FRAME_TREE: &str = "Page.getFrameTree";
186
187/// Returns metrics relating to the layouting of the page, such as viewport
188/// bounds/scale.
189///
190/// Returns: `layoutViewport`, `visualViewport`, `contentSize`, `cssLayoutViewport`, `cssVisualViewport`, `cssContentSize`
191pub const GET_LAYOUT_METRICS: &str = "Page.getLayoutMetrics";
192
193/// Returns navigation history for the current page.
194///
195/// Returns: `currentIndex`, `entries`
196pub const GET_NAVIGATION_HISTORY: &str = "Page.getNavigationHistory";
197
198/// Resets navigation history for the current page.
199pub const RESET_NAVIGATION_HISTORY: &str = "Page.resetNavigationHistory";
200
201/// Returns content of the given resource.
202///
203/// Experimental: may change without notice.
204///
205/// Parameters:
206/// - `frameId`: FrameId
207/// - `url`: string
208///
209/// Returns: `content`, `base64Encoded`
210pub const GET_RESOURCE_CONTENT: &str = "Page.getResourceContent";
211
212/// Returns present frame / resource tree structure.
213///
214/// Experimental: may change without notice.
215///
216/// Returns: `frameTree`
217pub const GET_RESOURCE_TREE: &str = "Page.getResourceTree";
218
219/// Accepts or dismisses a JavaScript initiated dialog (alert, confirm,
220/// prompt, or onbeforeunload).
221///
222/// Parameters:
223/// - `accept`: boolean
224/// - `promptText`: string (optional)
225pub const HANDLE_JAVA_SCRIPT_DIALOG: &str = "Page.handleJavaScriptDialog";
226
227/// Navigates current page to the given URL.
228///
229/// Parameters:
230/// - `url`: string
231/// - `referrer`: string (optional)
232/// - `transitionType`: TransitionType (optional)
233/// - `frameId`: FrameId (optional)
234/// - `referrerPolicy`: ReferrerPolicy (optional)
235///
236/// Returns: `frameId`, `loaderId`, `errorText`, `isDownload`
237pub const NAVIGATE: &str = "Page.navigate";
238
239/// Navigates current page to the given history entry.
240///
241/// Parameters:
242/// - `entryId`: integer
243pub const NAVIGATE_TO_HISTORY_ENTRY: &str = "Page.navigateToHistoryEntry";
244
245/// Print page as PDF.
246///
247/// Parameters:
248/// - `landscape`: boolean (optional)
249/// - `displayHeaderFooter`: boolean (optional)
250/// - `printBackground`: boolean (optional)
251/// - `scale`: number (optional)
252/// - `paperWidth`: number (optional)
253/// - `paperHeight`: number (optional)
254/// - `marginTop`: number (optional)
255/// - `marginBottom`: number (optional)
256/// - `marginLeft`: number (optional)
257/// - `marginRight`: number (optional)
258/// - `pageRanges`: string (optional)
259/// - `headerTemplate`: string (optional)
260/// - `footerTemplate`: string (optional)
261/// - `preferCSSPageSize`: boolean (optional)
262/// - `transferMode`: string (optional)
263/// - `generateTaggedPDF`: boolean (optional)
264/// - `generateDocumentOutline`: boolean (optional)
265///
266/// Returns: `data`, `stream`
267pub const PRINT_TO_PDF: &str = "Page.printToPDF";
268
269/// Reloads given page optionally ignoring the cache.
270///
271/// Parameters:
272/// - `ignoreCache`: boolean (optional)
273/// - `scriptToEvaluateOnLoad`: string (optional)
274/// - `loaderId`: Network.LoaderId (optional)
275pub const RELOAD: &str = "Page.reload";
276
277/// Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
278///
279/// Deprecated in the protocol.
280/// Experimental: may change without notice.
281///
282/// Parameters:
283/// - `identifier`: ScriptIdentifier
284pub const REMOVE_SCRIPT_TO_EVALUATE_ON_LOAD: &str = "Page.removeScriptToEvaluateOnLoad";
285
286/// Removes given script from the list.
287///
288/// Parameters:
289/// - `identifier`: ScriptIdentifier
290pub const REMOVE_SCRIPT_TO_EVALUATE_ON_NEW_DOCUMENT: &str =
291 "Page.removeScriptToEvaluateOnNewDocument";
292
293/// Acknowledges that a screencast frame has been received by the frontend.
294///
295/// Experimental: may change without notice.
296///
297/// Parameters:
298/// - `sessionId`: integer
299pub const SCREENCAST_FRAME_ACK: &str = "Page.screencastFrameAck";
300
301/// Searches for given string in resource content.
302///
303/// Experimental: may change without notice.
304///
305/// Parameters:
306/// - `frameId`: FrameId
307/// - `url`: string
308/// - `query`: string
309/// - `caseSensitive`: boolean (optional)
310/// - `isRegex`: boolean (optional)
311///
312/// Returns: `result`
313pub const SEARCH_IN_RESOURCE: &str = "Page.searchInResource";
314
315/// Enable Chrome's experimental ad filter on all sites.
316///
317/// Experimental: may change without notice.
318///
319/// Parameters:
320/// - `enabled`: boolean
321pub const SET_AD_BLOCKING_ENABLED: &str = "Page.setAdBlockingEnabled";
322
323/// Enable page Content Security Policy by-passing.
324///
325/// Parameters:
326/// - `enabled`: boolean
327pub const SET_BYPASS_CSP: &str = "Page.setBypassCSP";
328
329/// Get Permissions Policy state on given frame.
330///
331/// Experimental: may change without notice.
332///
333/// Parameters:
334/// - `frameId`: FrameId
335///
336/// Returns: `states`
337pub const GET_PERMISSIONS_POLICY_STATE: &str = "Page.getPermissionsPolicyState";
338
339/// Get Origin Trials on given frame.
340///
341/// Experimental: may change without notice.
342///
343/// Parameters:
344/// - `frameId`: FrameId
345///
346/// Returns: `originTrials`
347pub const GET_ORIGIN_TRIALS: &str = "Page.getOriginTrials";
348
349/// Overrides the values of device screen dimensions (window.screen.width,
350/// window.screen.height, window.innerWidth, window.innerHeight, and
351/// "device-width"/"device-height"-related CSS media query results).
352///
353/// Deprecated in the protocol.
354/// Experimental: may change without notice.
355///
356/// Parameters:
357/// - `width`: integer
358/// - `height`: integer
359/// - `deviceScaleFactor`: number
360/// - `mobile`: boolean
361/// - `scale`: number (optional)
362/// - `screenWidth`: integer (optional)
363/// - `screenHeight`: integer (optional)
364/// - `positionX`: integer (optional)
365/// - `positionY`: integer (optional)
366/// - `dontSetVisibleSize`: boolean (optional)
367/// - `screenOrientation`: Emulation.ScreenOrientation (optional)
368/// - `viewport`: Viewport (optional)
369pub const SET_DEVICE_METRICS_OVERRIDE: &str = "Page.setDeviceMetricsOverride";
370
371/// Overrides the Device Orientation.
372///
373/// Deprecated in the protocol.
374/// Experimental: may change without notice.
375///
376/// Parameters:
377/// - `alpha`: number
378/// - `beta`: number
379/// - `gamma`: number
380pub const SET_DEVICE_ORIENTATION_OVERRIDE: &str = "Page.setDeviceOrientationOverride";
381
382/// Set generic font families.
383///
384/// Experimental: may change without notice.
385///
386/// Parameters:
387/// - `fontFamilies`: FontFamilies
388/// - `forScripts`: array (optional)
389pub const SET_FONT_FAMILIES: &str = "Page.setFontFamilies";
390
391/// Set default font sizes.
392///
393/// Experimental: may change without notice.
394///
395/// Parameters:
396/// - `fontSizes`: FontSizes
397pub const SET_FONT_SIZES: &str = "Page.setFontSizes";
398
399/// Sets given markup as the document's HTML.
400///
401/// Parameters:
402/// - `frameId`: FrameId
403/// - `html`: string
404pub const SET_DOCUMENT_CONTENT: &str = "Page.setDocumentContent";
405
406/// Set the behavior when downloading a file.
407///
408/// Deprecated in the protocol.
409/// Experimental: may change without notice.
410///
411/// Parameters:
412/// - `behavior`: string
413/// - `downloadPath`: string (optional)
414pub const SET_DOWNLOAD_BEHAVIOR: &str = "Page.setDownloadBehavior";
415
416/// Overrides the Geolocation Position or Error. Omitting any of the
417/// parameters emulates position unavailable.
418///
419/// Deprecated in the protocol.
420///
421/// Parameters:
422/// - `latitude`: number (optional)
423/// - `longitude`: number (optional)
424/// - `accuracy`: number (optional)
425pub const SET_GEOLOCATION_OVERRIDE: &str = "Page.setGeolocationOverride";
426
427/// Controls whether page will emit lifecycle events.
428///
429/// Parameters:
430/// - `enabled`: boolean
431pub const SET_LIFECYCLE_EVENTS_ENABLED: &str = "Page.setLifecycleEventsEnabled";
432
433/// Toggles mouse event-based touch event emulation.
434///
435/// Deprecated in the protocol.
436/// Experimental: may change without notice.
437///
438/// Parameters:
439/// - `enabled`: boolean
440/// - `configuration`: string (optional)
441pub const SET_TOUCH_EMULATION_ENABLED: &str = "Page.setTouchEmulationEnabled";
442
443/// Starts sending each frame using the `screencastFrame` event.
444///
445/// Experimental: may change without notice.
446///
447/// Parameters:
448/// - `format`: string (optional)
449/// - `quality`: integer (optional)
450/// - `maxWidth`: integer (optional)
451/// - `maxHeight`: integer (optional)
452/// - `everyNthFrame`: integer (optional)
453/// - `maxFramesInFlight`: integer (optional)
454/// - `sendLastFrame`: boolean (optional)
455pub const START_SCREENCAST: &str = "Page.startScreencast";
456
457/// Starts screencast video recording.
458///
459/// Experimental: may change without notice.
460///
461/// Parameters:
462/// - `audio`: boolean (optional)
463/// - `maxWidth`: integer (optional)
464/// - `maxHeight`: integer (optional)
465/// - `frameRate`: integer (optional)
466/// - `captureArea`: string (optional)
467///
468/// Returns: `stream`
469pub const START_SCREEN_RECORDING: &str = "Page.startScreenRecording";
470
471/// Stops screencast video recording.
472///
473/// Experimental: may change without notice.
474///
475/// Returns: `stream`
476pub const STOP_SCREEN_RECORDING: &str = "Page.stopScreenRecording";
477
478/// Force the page stop all navigations and pending resource fetches.
479pub const STOP_LOADING: &str = "Page.stopLoading";
480
481/// Crashes renderer on the IO thread, generates minidumps.
482///
483/// Experimental: may change without notice.
484pub const CRASH: &str = "Page.crash";
485
486/// Tries to close page, running its beforeunload hooks, if any.
487pub const CLOSE: &str = "Page.close";
488
489/// Tries to update the web lifecycle state of the page. It will transition
490/// the page to the given state according to:
491/// <https://github.com/WICG/web-lifecycle/>
492///
493/// Experimental: may change without notice.
494///
495/// Parameters:
496/// - `state`: string
497pub const SET_WEB_LIFECYCLE_STATE: &str = "Page.setWebLifecycleState";
498
499/// Stops sending each frame in the `screencastFrame`.
500///
501/// Experimental: may change without notice.
502pub const STOP_SCREENCAST: &str = "Page.stopScreencast";
503
504/// Requests backend to produce compilation cache for the specified scripts.
505/// `scripts` are appended to the list of scripts for which the cache would be
506/// produced. The list may be reset during page navigation. When script with a
507/// matching URL is encountered, the cache is optionally produced upon backend
508/// discretion, based on internal heuristics. See also:
509/// `Page.compilationCacheProduced`.
510///
511/// Experimental: may change without notice.
512///
513/// Parameters:
514/// - `scripts`: array
515pub const PRODUCE_COMPILATION_CACHE: &str = "Page.produceCompilationCache";
516
517/// Seeds compilation cache for given url. Compilation cache does not survive
518/// cross-process navigation.
519///
520/// Experimental: may change without notice.
521///
522/// Parameters:
523/// - `url`: string
524/// - `data`: string
525pub const ADD_COMPILATION_CACHE: &str = "Page.addCompilationCache";
526
527/// Clears seeded compilation cache.
528///
529/// Experimental: may change without notice.
530pub const CLEAR_COMPILATION_CACHE: &str = "Page.clearCompilationCache";
531
532/// Sets the Secure Payment Confirmation transaction mode.
533/// <https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode>
534///
535/// Experimental: may change without notice.
536///
537/// Parameters:
538/// - `mode`: string
539pub const SET_SPC_TRANSACTION_MODE: &str = "Page.setSPCTransactionMode";
540
541/// Extensions for Custom Handlers API:
542/// <https://html.spec.whatwg.org/multipage/system-state.html#rph-automation>
543///
544/// Experimental: may change without notice.
545///
546/// Parameters:
547/// - `mode`: string
548pub const SET_RPH_REGISTRATION_MODE: &str = "Page.setRPHRegistrationMode";
549
550/// Generates a report for testing.
551///
552/// Experimental: may change without notice.
553///
554/// Parameters:
555/// - `message`: string
556/// - `group`: string (optional)
557pub const GENERATE_TEST_REPORT: &str = "Page.generateTestReport";
558
559/// Pauses page execution. Can be resumed using generic
560/// Runtime.runIfWaitingForDebugger.
561///
562/// Experimental: may change without notice.
563pub const WAIT_FOR_DEBUGGER: &str = "Page.waitForDebugger";
564
565/// Intercept file chooser requests and transfer control to protocol clients.
566/// When file chooser interception is enabled, native file chooser dialog is
567/// not shown. Instead, a protocol event `Page.fileChooserOpened` is emitted.
568///
569/// Parameters:
570/// - `enabled`: boolean
571/// - `cancel`: boolean (optional)
572pub const SET_INTERCEPT_FILE_CHOOSER_DIALOG: &str = "Page.setInterceptFileChooserDialog";
573
574/// Enable/disable prerendering manually. This command is a short-term
575/// solution for <https://crbug.com/1440085>. See
576/// <https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA>
577/// for more details. TODO(<https://crbug.com/1440085>): Remove this once
578/// Puppeteer supports tab targets.
579///
580/// Experimental: may change without notice.
581///
582/// Parameters:
583/// - `isAllowed`: boolean
584pub const SET_PRERENDERING_ALLOWED: &str = "Page.setPrerenderingAllowed";
585
586/// Get the annotated page content for the main frame. This is an experimental
587/// command that is subject to change.
588///
589/// Experimental: may change without notice.
590///
591/// Parameters:
592/// - `includeActionableInformation`: boolean (optional)
593///
594/// Returns: `content`
595pub const GET_ANNOTATED_PAGE_CONTENT: &str = "Page.getAnnotatedPageContent";
596
597/// Configures input visualization on the page.
598///
599/// Experimental: may change without notice.
600///
601/// Parameters:
602/// - `clicks`: boolean (optional)
603pub const SET_INPUT_VISUALIZATION: &str = "Page.setInputVisualization";