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