Skip to main content

cdp_driver/protocol/
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//! Types, command parameters and event payloads for the `Page`
8//! domain. The method-name constants for the same domain are in
9//! [`crate::methods`].
10
11use serde::{Deserialize, Serialize};
12
13/// Unique frame identifier.
14pub type FrameId = String;
15
16/// Indicates whether a frame has been identified as an ad.
17///
18/// Experimental: may change without notice.
19#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
20pub enum AdFrameType {
21    /// `none`
22    #[serde(rename = "none")]
23    None,
24    /// `child`
25    #[serde(rename = "child")]
26    Child,
27    /// `root`
28    #[serde(rename = "root")]
29    Root,
30    /// A value this vendored schema does not list. Chrome adds values ahead of
31    /// the published protocol, so an unrecognised one is kept as it arrived
32    /// rather than failing the payload it came in.
33    #[serde(untagged)]
34    Unrecognized(String),
35}
36
37/// Experimental: may change without notice.
38#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
39pub enum AdFrameExplanation {
40    /// `ParentIsAd`
41    ParentIsAd,
42    /// `CreatedByAdScript`
43    CreatedByAdScript,
44    /// `MatchedBlockingRule`
45    MatchedBlockingRule,
46    /// A value this vendored schema does not list. Chrome adds values ahead of
47    /// the published protocol, so an unrecognised one is kept as it arrived
48    /// rather than failing the payload it came in.
49    #[serde(untagged)]
50    Unrecognized(String),
51}
52
53/// Indicates whether a frame has been identified as an ad and why.
54///
55/// Experimental: may change without notice.
56#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
57pub struct AdFrameStatus {
58    #[serde(rename = "adFrameType")]
59    pub ad_frame_type: AdFrameType,
60    #[serde(default, skip_serializing_if = "Option::is_none")]
61    pub explanations: Option<Vec<AdFrameExplanation>>,
62}
63
64/// Indicates whether the frame is a secure context and why it is the case.
65///
66/// Experimental: may change without notice.
67#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
68pub enum SecureContextType {
69    /// `Secure`
70    Secure,
71    /// `SecureLocalhost`
72    SecureLocalhost,
73    /// `InsecureScheme`
74    InsecureScheme,
75    /// `InsecureAncestor`
76    InsecureAncestor,
77    /// A value this vendored schema does not list. Chrome adds values ahead of
78    /// the published protocol, so an unrecognised one is kept as it arrived
79    /// rather than failing the payload it came in.
80    #[serde(untagged)]
81    Unrecognized(String),
82}
83
84/// Indicates whether the frame is cross-origin isolated and why it is the
85/// case.
86///
87/// Experimental: may change without notice.
88#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
89pub enum CrossOriginIsolatedContextType {
90    /// `Isolated`
91    Isolated,
92    /// `NotIsolated`
93    NotIsolated,
94    /// `NotIsolatedFeatureDisabled`
95    NotIsolatedFeatureDisabled,
96    /// A value this vendored schema does not list. Chrome adds values ahead of
97    /// the published protocol, so an unrecognised one is kept as it arrived
98    /// rather than failing the payload it came in.
99    #[serde(untagged)]
100    Unrecognized(String),
101}
102
103/// Experimental: may change without notice.
104#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
105pub enum GatedApiFeatures {
106    /// `SharedArrayBuffers`
107    SharedArrayBuffers,
108    /// `SharedArrayBuffersTransferAllowed`
109    SharedArrayBuffersTransferAllowed,
110    /// `PerformanceMeasureMemory`
111    PerformanceMeasureMemory,
112    /// `PerformanceProfile`
113    PerformanceProfile,
114    /// A value this vendored schema does not list. Chrome adds values ahead of
115    /// the published protocol, so an unrecognised one is kept as it arrived
116    /// rather than failing the payload it came in.
117    #[serde(untagged)]
118    Unrecognized(String),
119}
120
121/// All Permissions Policy features. This enum should match the one defined in
122/// services/network/public/cpp/permissions_policy/permissions_policy_features.json5.
123/// LINT.IfChange(PermissionsPolicyFeature)
124///
125/// Experimental: may change without notice.
126#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
127pub enum PermissionsPolicyFeature {
128    /// `accelerometer`
129    #[serde(rename = "accelerometer")]
130    Accelerometer,
131    /// `all-screens-capture`
132    #[serde(rename = "all-screens-capture")]
133    AllScreensCapture,
134    /// `ambient-light-sensor`
135    #[serde(rename = "ambient-light-sensor")]
136    AmbientLightSensor,
137    /// `aria-notify`
138    #[serde(rename = "aria-notify")]
139    AriaNotify,
140    /// `autofill`
141    #[serde(rename = "autofill")]
142    Autofill,
143    /// `autoplay`
144    #[serde(rename = "autoplay")]
145    Autoplay,
146    /// `bluetooth`
147    #[serde(rename = "bluetooth")]
148    Bluetooth,
149    /// `camera`
150    #[serde(rename = "camera")]
151    Camera,
152    /// `captured-surface-control`
153    #[serde(rename = "captured-surface-control")]
154    CapturedSurfaceControl,
155    /// `ch-dpr`
156    #[serde(rename = "ch-dpr")]
157    ChDpr,
158    /// `ch-device-memory`
159    #[serde(rename = "ch-device-memory")]
160    ChDeviceMemory,
161    /// `ch-downlink`
162    #[serde(rename = "ch-downlink")]
163    ChDownlink,
164    /// `ch-ect`
165    #[serde(rename = "ch-ect")]
166    ChEct,
167    /// `ch-prefers-color-scheme`
168    #[serde(rename = "ch-prefers-color-scheme")]
169    ChPrefersColorScheme,
170    /// `ch-prefers-reduced-motion`
171    #[serde(rename = "ch-prefers-reduced-motion")]
172    ChPrefersReducedMotion,
173    /// `ch-prefers-reduced-transparency`
174    #[serde(rename = "ch-prefers-reduced-transparency")]
175    ChPrefersReducedTransparency,
176    /// `ch-rtt`
177    #[serde(rename = "ch-rtt")]
178    ChRtt,
179    /// `ch-save-data`
180    #[serde(rename = "ch-save-data")]
181    ChSaveData,
182    /// `ch-ua`
183    #[serde(rename = "ch-ua")]
184    ChUa,
185    /// `ch-ua-arch`
186    #[serde(rename = "ch-ua-arch")]
187    ChUaArch,
188    /// `ch-ua-bitness`
189    #[serde(rename = "ch-ua-bitness")]
190    ChUaBitness,
191    /// `ch-ua-high-entropy-values`
192    #[serde(rename = "ch-ua-high-entropy-values")]
193    ChUaHighEntropyValues,
194    /// `ch-ua-platform`
195    #[serde(rename = "ch-ua-platform")]
196    ChUaPlatform,
197    /// `ch-ua-model`
198    #[serde(rename = "ch-ua-model")]
199    ChUaModel,
200    /// `ch-ua-mobile`
201    #[serde(rename = "ch-ua-mobile")]
202    ChUaMobile,
203    /// `ch-ua-form-factors`
204    #[serde(rename = "ch-ua-form-factors")]
205    ChUaFormFactors,
206    /// `ch-ua-full-version`
207    #[serde(rename = "ch-ua-full-version")]
208    ChUaFullVersion,
209    /// `ch-ua-full-version-list`
210    #[serde(rename = "ch-ua-full-version-list")]
211    ChUaFullVersionList,
212    /// `ch-ua-platform-version`
213    #[serde(rename = "ch-ua-platform-version")]
214    ChUaPlatformVersion,
215    /// `ch-ua-wow64`
216    #[serde(rename = "ch-ua-wow64")]
217    ChUaWow64,
218    /// `ch-viewport-height`
219    #[serde(rename = "ch-viewport-height")]
220    ChViewportHeight,
221    /// `ch-viewport-width`
222    #[serde(rename = "ch-viewport-width")]
223    ChViewportWidth,
224    /// `ch-width`
225    #[serde(rename = "ch-width")]
226    ChWidth,
227    /// `clipboard-read`
228    #[serde(rename = "clipboard-read")]
229    ClipboardRead,
230    /// `clipboard-write`
231    #[serde(rename = "clipboard-write")]
232    ClipboardWrite,
233    /// `compute-pressure`
234    #[serde(rename = "compute-pressure")]
235    ComputePressure,
236    /// `controlled-frame`
237    #[serde(rename = "controlled-frame")]
238    ControlledFrame,
239    /// `cross-origin-isolated`
240    #[serde(rename = "cross-origin-isolated")]
241    CrossOriginIsolated,
242    /// `deferred-fetch`
243    #[serde(rename = "deferred-fetch")]
244    DeferredFetch,
245    /// `deferred-fetch-minimal`
246    #[serde(rename = "deferred-fetch-minimal")]
247    DeferredFetchMinimal,
248    /// `device-attributes`
249    #[serde(rename = "device-attributes")]
250    DeviceAttributes,
251    /// `digital-credentials-create`
252    #[serde(rename = "digital-credentials-create")]
253    DigitalCredentialsCreate,
254    /// `digital-credentials-get`
255    #[serde(rename = "digital-credentials-get")]
256    DigitalCredentialsGet,
257    /// `direct-sockets`
258    #[serde(rename = "direct-sockets")]
259    DirectSockets,
260    /// `direct-sockets-multicast`
261    #[serde(rename = "direct-sockets-multicast")]
262    DirectSocketsMulticast,
263    /// `display-capture`
264    #[serde(rename = "display-capture")]
265    DisplayCapture,
266    /// `document-domain`
267    #[serde(rename = "document-domain")]
268    DocumentDomain,
269    /// `encrypted-media`
270    #[serde(rename = "encrypted-media")]
271    EncryptedMedia,
272    /// `execution-while-out-of-viewport`
273    #[serde(rename = "execution-while-out-of-viewport")]
274    ExecutionWhileOutOfViewport,
275    /// `execution-while-not-rendered`
276    #[serde(rename = "execution-while-not-rendered")]
277    ExecutionWhileNotRendered,
278    /// `focus-without-user-activation`
279    #[serde(rename = "focus-without-user-activation")]
280    FocusWithoutUserActivation,
281    /// `fullscreen`
282    #[serde(rename = "fullscreen")]
283    Fullscreen,
284    /// `frobulate`
285    #[serde(rename = "frobulate")]
286    Frobulate,
287    /// `gamepad`
288    #[serde(rename = "gamepad")]
289    Gamepad,
290    /// `geolocation`
291    #[serde(rename = "geolocation")]
292    Geolocation,
293    /// `gyroscope`
294    #[serde(rename = "gyroscope")]
295    Gyroscope,
296    /// `haptics`
297    #[serde(rename = "haptics")]
298    Haptics,
299    /// `hid`
300    #[serde(rename = "hid")]
301    Hid,
302    /// `identity-credentials-get`
303    #[serde(rename = "identity-credentials-get")]
304    IdentityCredentialsGet,
305    /// `idle-detection`
306    #[serde(rename = "idle-detection")]
307    IdleDetection,
308    /// `keyboard-map`
309    #[serde(rename = "keyboard-map")]
310    KeyboardMap,
311    /// `language-detector`
312    #[serde(rename = "language-detector")]
313    LanguageDetector,
314    /// `language-model`
315    #[serde(rename = "language-model")]
316    LanguageModel,
317    /// `local-fonts`
318    #[serde(rename = "local-fonts")]
319    LocalFonts,
320    /// `local-network`
321    #[serde(rename = "local-network")]
322    LocalNetwork,
323    /// `local-network-access`
324    #[serde(rename = "local-network-access")]
325    LocalNetworkAccess,
326    /// `loopback-network`
327    #[serde(rename = "loopback-network")]
328    LoopbackNetwork,
329    /// `magnetometer`
330    #[serde(rename = "magnetometer")]
331    Magnetometer,
332    /// `manual-text`
333    #[serde(rename = "manual-text")]
334    ManualText,
335    /// `media-playback-while-not-visible`
336    #[serde(rename = "media-playback-while-not-visible")]
337    MediaPlaybackWhileNotVisible,
338    /// `microphone`
339    #[serde(rename = "microphone")]
340    Microphone,
341    /// `midi`
342    #[serde(rename = "midi")]
343    Midi,
344    /// `on-device-speech-recognition`
345    #[serde(rename = "on-device-speech-recognition")]
346    OnDeviceSpeechRecognition,
347    /// `otp-credentials`
348    #[serde(rename = "otp-credentials")]
349    OtpCredentials,
350    /// `payment`
351    #[serde(rename = "payment")]
352    Payment,
353    /// `picture-in-picture`
354    #[serde(rename = "picture-in-picture")]
355    PictureInPicture,
356    /// `private-state-token-issuance`
357    #[serde(rename = "private-state-token-issuance")]
358    PrivateStateTokenIssuance,
359    /// `private-state-token-redemption`
360    #[serde(rename = "private-state-token-redemption")]
361    PrivateStateTokenRedemption,
362    /// `publickey-credentials-create`
363    #[serde(rename = "publickey-credentials-create")]
364    PublickeyCredentialsCreate,
365    /// `publickey-credentials-get`
366    #[serde(rename = "publickey-credentials-get")]
367    PublickeyCredentialsGet,
368    /// `publickey-credentials-remote-client-data-json`
369    #[serde(rename = "publickey-credentials-remote-client-data-json")]
370    PublickeyCredentialsRemoteClientDataJson,
371    /// `rewriter`
372    #[serde(rename = "rewriter")]
373    Rewriter,
374    /// `screen-wake-lock`
375    #[serde(rename = "screen-wake-lock")]
376    ScreenWakeLock,
377    /// `semantic-embedder`
378    #[serde(rename = "semantic-embedder")]
379    SemanticEmbedder,
380    /// `serial`
381    #[serde(rename = "serial")]
382    Serial,
383    /// `smart-card`
384    #[serde(rename = "smart-card")]
385    SmartCard,
386    /// `speaker-selection`
387    #[serde(rename = "speaker-selection")]
388    SpeakerSelection,
389    /// `storage-access`
390    #[serde(rename = "storage-access")]
391    StorageAccess,
392    /// `sub-apps`
393    #[serde(rename = "sub-apps")]
394    SubApps,
395    /// `summarizer`
396    #[serde(rename = "summarizer")]
397    Summarizer,
398    /// `sync-xhr`
399    #[serde(rename = "sync-xhr")]
400    SyncXhr,
401    /// `tools`
402    #[serde(rename = "tools")]
403    Tools,
404    /// `translator`
405    #[serde(rename = "translator")]
406    Translator,
407    /// `unbounded-element`
408    #[serde(rename = "unbounded-element")]
409    UnboundedElement,
410    /// `unload`
411    #[serde(rename = "unload")]
412    Unload,
413    /// `usb`
414    #[serde(rename = "usb")]
415    Usb,
416    /// `usb-unrestricted`
417    #[serde(rename = "usb-unrestricted")]
418    UsbUnrestricted,
419    /// `vertical-scroll`
420    #[serde(rename = "vertical-scroll")]
421    VerticalScroll,
422    /// `web-app-installation`
423    #[serde(rename = "web-app-installation")]
424    WebAppInstallation,
425    /// `webnn`
426    #[serde(rename = "webnn")]
427    Webnn,
428    /// `web-printing`
429    #[serde(rename = "web-printing")]
430    WebPrinting,
431    /// `web-share`
432    #[serde(rename = "web-share")]
433    WebShare,
434    /// `window-management`
435    #[serde(rename = "window-management")]
436    WindowManagement,
437    /// `writer`
438    #[serde(rename = "writer")]
439    Writer,
440    /// `xr-spatial-tracking`
441    #[serde(rename = "xr-spatial-tracking")]
442    XrSpatialTracking,
443    /// A value this vendored schema does not list. Chrome adds values ahead of
444    /// the published protocol, so an unrecognised one is kept as it arrived
445    /// rather than failing the payload it came in.
446    #[serde(untagged)]
447    Unrecognized(String),
448}
449
450/// Reason for a permissions policy feature to be disabled.
451///
452/// Experimental: may change without notice.
453#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
454pub enum PermissionsPolicyBlockReason {
455    /// `Header`
456    Header,
457    /// `IframeAttribute`
458    IframeAttribute,
459    /// `InFencedFrameTree`
460    InFencedFrameTree,
461    /// `InIsolatedApp`
462    InIsolatedApp,
463    /// A value this vendored schema does not list. Chrome adds values ahead of
464    /// the published protocol, so an unrecognised one is kept as it arrived
465    /// rather than failing the payload it came in.
466    #[serde(untagged)]
467    Unrecognized(String),
468}
469
470/// Experimental: may change without notice.
471#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
472pub struct PermissionsPolicyBlockLocator {
473    #[serde(rename = "frameId")]
474    pub frame_id: FrameId,
475    #[serde(rename = "blockReason")]
476    pub block_reason: PermissionsPolicyBlockReason,
477}
478
479/// Experimental: may change without notice.
480#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
481pub struct PermissionsPolicyFeatureState {
482    pub feature: PermissionsPolicyFeature,
483    pub allowed: bool,
484    #[serde(default, skip_serializing_if = "Option::is_none")]
485    pub locator: Option<PermissionsPolicyBlockLocator>,
486}
487
488/// Origin Trial(<https://www.chromium.org/blink/origin-trials>) support.
489/// Status for an Origin Trial token.
490///
491/// Experimental: may change without notice.
492#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
493pub enum OriginTrialTokenStatus {
494    /// `Success`
495    Success,
496    /// `NotSupported`
497    NotSupported,
498    /// `Insecure`
499    Insecure,
500    /// `Expired`
501    Expired,
502    /// `WrongOrigin`
503    WrongOrigin,
504    /// `InvalidSignature`
505    InvalidSignature,
506    /// `Malformed`
507    Malformed,
508    /// `WrongVersion`
509    WrongVersion,
510    /// `FeatureDisabled`
511    FeatureDisabled,
512    /// `TokenDisabled`
513    TokenDisabled,
514    /// `FeatureDisabledForUser`
515    FeatureDisabledForUser,
516    /// `UnknownTrial`
517    UnknownTrial,
518    /// A value this vendored schema does not list. Chrome adds values ahead of
519    /// the published protocol, so an unrecognised one is kept as it arrived
520    /// rather than failing the payload it came in.
521    #[serde(untagged)]
522    Unrecognized(String),
523}
524
525/// Status for an Origin Trial.
526///
527/// Experimental: may change without notice.
528#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
529pub enum OriginTrialStatus {
530    /// `Enabled`
531    Enabled,
532    /// `ValidTokenNotProvided`
533    ValidTokenNotProvided,
534    /// `OSNotSupported`
535    #[serde(rename = "OSNotSupported")]
536    OsNotSupported,
537    /// `TrialNotAllowed`
538    TrialNotAllowed,
539    /// A value this vendored schema does not list. Chrome adds values ahead of
540    /// the published protocol, so an unrecognised one is kept as it arrived
541    /// rather than failing the payload it came in.
542    #[serde(untagged)]
543    Unrecognized(String),
544}
545
546/// Experimental: may change without notice.
547#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
548pub enum OriginTrialUsageRestriction {
549    /// `None`
550    None,
551    /// `Subset`
552    Subset,
553    /// A value this vendored schema does not list. Chrome adds values ahead of
554    /// the published protocol, so an unrecognised one is kept as it arrived
555    /// rather than failing the payload it came in.
556    #[serde(untagged)]
557    Unrecognized(String),
558}
559
560/// Experimental: may change without notice.
561#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
562pub struct OriginTrialToken {
563    pub origin: String,
564    #[serde(rename = "matchSubDomains")]
565    pub match_sub_domains: bool,
566    #[serde(rename = "trialName")]
567    pub trial_name: String,
568    #[serde(rename = "expiryTime")]
569    pub expiry_time: crate::protocol::network::TimeSinceEpoch,
570    #[serde(rename = "isThirdParty")]
571    pub is_third_party: bool,
572    #[serde(rename = "usageRestriction")]
573    pub usage_restriction: OriginTrialUsageRestriction,
574}
575
576/// Experimental: may change without notice.
577#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
578pub struct OriginTrialTokenWithStatus {
579    #[serde(rename = "rawTokenText")]
580    pub raw_token_text: String,
581    /// `parsedToken` is present only when the token is extractable and parsable.
582    #[serde(
583        rename = "parsedToken",
584        default,
585        skip_serializing_if = "Option::is_none"
586    )]
587    pub parsed_token: Option<OriginTrialToken>,
588    pub status: OriginTrialTokenStatus,
589}
590
591/// Experimental: may change without notice.
592#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
593pub struct OriginTrial {
594    #[serde(rename = "trialName")]
595    pub trial_name: String,
596    pub status: OriginTrialStatus,
597    #[serde(rename = "tokensWithStatus")]
598    pub tokens_with_status: Vec<OriginTrialTokenWithStatus>,
599}
600
601/// Additional information about the frame document's security origin.
602///
603/// Experimental: may change without notice.
604#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
605pub struct SecurityOriginDetails {
606    /// Indicates whether the frame document's security origin is one of the local
607    /// hostnames (e.g. "localhost") or IP addresses (IPv4 127.0.0.0/8 or IPv6
608    /// ::1).
609    #[serde(rename = "isLocalhost")]
610    pub is_localhost: bool,
611}
612
613/// Information about the Frame on the page.
614#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
615pub struct Frame {
616    /// Frame unique identifier.
617    pub id: FrameId,
618    /// Parent frame identifier.
619    #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
620    pub parent_id: Option<FrameId>,
621    /// Identifier of the loader associated with this frame.
622    #[serde(rename = "loaderId")]
623    pub loader_id: crate::protocol::network::LoaderId,
624    /// Frame's name as specified in the tag.
625    #[serde(default, skip_serializing_if = "Option::is_none")]
626    pub name: Option<String>,
627    /// Frame document's URL without fragment.
628    pub url: String,
629    /// Frame document's URL fragment including the '#'.
630    ///
631    /// Experimental: may change without notice.
632    #[serde(
633        rename = "urlFragment",
634        default,
635        skip_serializing_if = "Option::is_none"
636    )]
637    pub url_fragment: Option<String>,
638    /// Frame document's registered domain, taking the public suffixes list into
639    /// account. Extracted from the Frame's url. Example URLs:
640    /// <http://www.google.com/file.html> -\> "google.com"
641    /// <http://a.b.co.uk/file.html> -\> "b.co.uk"
642    ///
643    /// Experimental: may change without notice.
644    #[serde(rename = "domainAndRegistry")]
645    pub domain_and_registry: String,
646    /// Frame document's security origin.
647    #[serde(rename = "securityOrigin")]
648    pub security_origin: String,
649    /// Additional details about the frame document's security origin.
650    ///
651    /// Experimental: may change without notice.
652    #[serde(
653        rename = "securityOriginDetails",
654        default,
655        skip_serializing_if = "Option::is_none"
656    )]
657    pub security_origin_details: Option<SecurityOriginDetails>,
658    /// Frame document's mimeType as determined by the browser.
659    #[serde(rename = "mimeType")]
660    pub mime_type: String,
661    /// If the frame failed to load, this contains the URL that could not be
662    /// loaded. Note that unlike url above, this URL may contain a fragment.
663    ///
664    /// Experimental: may change without notice.
665    #[serde(
666        rename = "unreachableUrl",
667        default,
668        skip_serializing_if = "Option::is_none"
669    )]
670    pub unreachable_url: Option<String>,
671    /// Indicates whether this frame was tagged as an ad and why.
672    ///
673    /// Experimental: may change without notice.
674    #[serde(
675        rename = "adFrameStatus",
676        default,
677        skip_serializing_if = "Option::is_none"
678    )]
679    pub ad_frame_status: Option<AdFrameStatus>,
680    /// Indicates whether the main document is a secure context and explains why
681    /// that is the case.
682    ///
683    /// Experimental: may change without notice.
684    #[serde(rename = "secureContextType")]
685    pub secure_context_type: SecureContextType,
686    /// Indicates whether this is a cross origin isolated context.
687    ///
688    /// Experimental: may change without notice.
689    #[serde(rename = "crossOriginIsolatedContextType")]
690    pub cross_origin_isolated_context_type: CrossOriginIsolatedContextType,
691    /// Indicated which gated APIs / features are available.
692    ///
693    /// Experimental: may change without notice.
694    #[serde(rename = "gatedAPIFeatures")]
695    pub gated_api_features: Vec<GatedApiFeatures>,
696}
697
698/// Information about the Resource on the page.
699///
700/// Experimental: may change without notice.
701#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
702pub struct FrameResource {
703    /// Resource URL.
704    pub url: String,
705    /// Type of this resource.
706    pub r#type: crate::protocol::network::ResourceType,
707    /// Resource mimeType as determined by the browser.
708    #[serde(rename = "mimeType")]
709    pub mime_type: String,
710    /// last-modified timestamp as reported by server.
711    #[serde(
712        rename = "lastModified",
713        default,
714        skip_serializing_if = "Option::is_none"
715    )]
716    pub last_modified: Option<crate::protocol::network::TimeSinceEpoch>,
717    /// Resource content size.
718    #[serde(
719        rename = "contentSize",
720        default,
721        skip_serializing_if = "Option::is_none"
722    )]
723    pub content_size: Option<f64>,
724    /// True if the resource failed to load.
725    #[serde(default, skip_serializing_if = "Option::is_none")]
726    pub failed: Option<bool>,
727    /// True if the resource was canceled during loading.
728    #[serde(default, skip_serializing_if = "Option::is_none")]
729    pub canceled: Option<bool>,
730}
731
732/// Information about the Frame hierarchy along with their cached resources.
733///
734/// Experimental: may change without notice.
735#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
736pub struct FrameResourceTree {
737    /// Frame information for this tree item.
738    pub frame: Frame,
739    /// Child frames.
740    #[serde(
741        rename = "childFrames",
742        default,
743        skip_serializing_if = "Option::is_none"
744    )]
745    pub child_frames: Option<Vec<FrameResourceTree>>,
746    /// Information about frame resources.
747    pub resources: Vec<FrameResource>,
748}
749
750/// Information about the Frame hierarchy.
751#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
752pub struct FrameTree {
753    /// Frame information for this tree item.
754    pub frame: Frame,
755    /// Child frames.
756    #[serde(
757        rename = "childFrames",
758        default,
759        skip_serializing_if = "Option::is_none"
760    )]
761    pub child_frames: Option<Vec<FrameTree>>,
762}
763
764/// Unique script identifier.
765pub type ScriptIdentifier = String;
766
767/// Transition type.
768#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
769pub enum TransitionType {
770    /// `link`
771    #[serde(rename = "link")]
772    Link,
773    /// `typed`
774    #[serde(rename = "typed")]
775    Typed,
776    /// `address_bar`
777    #[serde(rename = "address_bar")]
778    AddressBar,
779    /// `auto_bookmark`
780    #[serde(rename = "auto_bookmark")]
781    AutoBookmark,
782    /// `auto_subframe`
783    #[serde(rename = "auto_subframe")]
784    AutoSubframe,
785    /// `manual_subframe`
786    #[serde(rename = "manual_subframe")]
787    ManualSubframe,
788    /// `generated`
789    #[serde(rename = "generated")]
790    Generated,
791    /// `auto_toplevel`
792    #[serde(rename = "auto_toplevel")]
793    AutoToplevel,
794    /// `form_submit`
795    #[serde(rename = "form_submit")]
796    FormSubmit,
797    /// `reload`
798    #[serde(rename = "reload")]
799    Reload,
800    /// `keyword`
801    #[serde(rename = "keyword")]
802    Keyword,
803    /// `keyword_generated`
804    #[serde(rename = "keyword_generated")]
805    KeywordGenerated,
806    /// `other`
807    #[serde(rename = "other")]
808    Other,
809    /// A value this vendored schema does not list. Chrome adds values ahead of
810    /// the published protocol, so an unrecognised one is kept as it arrived
811    /// rather than failing the payload it came in.
812    #[serde(untagged)]
813    Unrecognized(String),
814}
815
816/// Navigation history entry.
817#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
818pub struct NavigationEntry {
819    /// Unique id of the navigation history entry.
820    pub id: i64,
821    /// URL of the navigation history entry.
822    pub url: String,
823    /// URL that the user typed in the url bar.
824    #[serde(rename = "userTypedURL")]
825    pub user_typed_url: String,
826    /// Title of the navigation history entry.
827    pub title: String,
828    /// Transition type.
829    #[serde(rename = "transitionType")]
830    pub transition_type: TransitionType,
831}
832
833/// Screencast frame metadata.
834///
835/// Experimental: may change without notice.
836#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
837pub struct ScreencastFrameMetadata {
838    /// Top offset in DIP.
839    #[serde(rename = "offsetTop")]
840    pub offset_top: f64,
841    /// Page scale factor.
842    #[serde(rename = "pageScaleFactor")]
843    pub page_scale_factor: f64,
844    /// Device screen width in DIP.
845    #[serde(rename = "deviceWidth")]
846    pub device_width: f64,
847    /// Device screen height in DIP.
848    #[serde(rename = "deviceHeight")]
849    pub device_height: f64,
850    /// Position of horizontal scroll in CSS pixels.
851    #[serde(rename = "scrollOffsetX")]
852    pub scroll_offset_x: f64,
853    /// Position of vertical scroll in CSS pixels.
854    #[serde(rename = "scrollOffsetY")]
855    pub scroll_offset_y: f64,
856    /// Frame swap timestamp.
857    #[serde(default, skip_serializing_if = "Option::is_none")]
858    pub timestamp: Option<crate::protocol::network::TimeSinceEpoch>,
859    /// Frame swap timestamp as monotonic time.
860    #[serde(
861        rename = "monotonicTimestamp",
862        default,
863        skip_serializing_if = "Option::is_none"
864    )]
865    pub monotonic_timestamp: Option<crate::protocol::network::MonotonicTime>,
866}
867
868/// Javascript dialog type.
869#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
870pub enum DialogType {
871    /// `alert`
872    #[serde(rename = "alert")]
873    Alert,
874    /// `confirm`
875    #[serde(rename = "confirm")]
876    Confirm,
877    /// `prompt`
878    #[serde(rename = "prompt")]
879    Prompt,
880    /// `beforeunload`
881    #[serde(rename = "beforeunload")]
882    Beforeunload,
883    /// A value this vendored schema does not list. Chrome adds values ahead of
884    /// the published protocol, so an unrecognised one is kept as it arrived
885    /// rather than failing the payload it came in.
886    #[serde(untagged)]
887    Unrecognized(String),
888}
889
890/// Error while paring app manifest.
891#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
892pub struct AppManifestError {
893    /// Error message.
894    pub message: String,
895    /// If critical, this is a non-recoverable parse error.
896    pub critical: i64,
897    /// Error line.
898    pub line: i64,
899    /// Error column.
900    pub column: i64,
901}
902
903/// Parsed app manifest properties.
904///
905/// Experimental: may change without notice.
906#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
907pub struct AppManifestParsedProperties {
908    /// Computed scope value
909    pub scope: String,
910}
911
912/// Layout viewport position and dimensions.
913#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
914pub struct LayoutViewport {
915    /// Horizontal offset relative to the document (CSS pixels).
916    #[serde(rename = "pageX")]
917    pub page_x: i64,
918    /// Vertical offset relative to the document (CSS pixels).
919    #[serde(rename = "pageY")]
920    pub page_y: i64,
921    /// Width (CSS pixels), excludes scrollbar if present.
922    #[serde(rename = "clientWidth")]
923    pub client_width: i64,
924    /// Height (CSS pixels), excludes scrollbar if present.
925    #[serde(rename = "clientHeight")]
926    pub client_height: i64,
927}
928
929/// Visual viewport position, dimensions, and scale.
930#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
931pub struct VisualViewport {
932    /// Horizontal offset relative to the layout viewport (CSS pixels).
933    #[serde(rename = "offsetX")]
934    pub offset_x: f64,
935    /// Vertical offset relative to the layout viewport (CSS pixels).
936    #[serde(rename = "offsetY")]
937    pub offset_y: f64,
938    /// Horizontal offset relative to the document (CSS pixels).
939    #[serde(rename = "pageX")]
940    pub page_x: f64,
941    /// Vertical offset relative to the document (CSS pixels).
942    #[serde(rename = "pageY")]
943    pub page_y: f64,
944    /// Width (CSS pixels), excludes scrollbar if present.
945    #[serde(rename = "clientWidth")]
946    pub client_width: f64,
947    /// Height (CSS pixels), excludes scrollbar if present.
948    #[serde(rename = "clientHeight")]
949    pub client_height: f64,
950    /// Scale relative to the ideal viewport (size at width=device-width).
951    pub scale: f64,
952    /// Page zoom factor (CSS to device independent pixels ratio).
953    #[serde(default, skip_serializing_if = "Option::is_none")]
954    pub zoom: Option<f64>,
955}
956
957/// Viewport for capturing screenshot.
958#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
959pub struct Viewport {
960    /// X offset in device independent pixels (dip).
961    pub x: f64,
962    /// Y offset in device independent pixels (dip).
963    pub y: f64,
964    /// Rectangle width in device independent pixels (dip).
965    pub width: f64,
966    /// Rectangle height in device independent pixels (dip).
967    pub height: f64,
968    /// Page scale factor.
969    pub scale: f64,
970}
971
972/// Generic font families collection.
973///
974/// Experimental: may change without notice.
975#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
976pub struct FontFamilies {
977    /// The standard font-family.
978    #[serde(default, skip_serializing_if = "Option::is_none")]
979    pub standard: Option<String>,
980    /// The fixed font-family.
981    #[serde(default, skip_serializing_if = "Option::is_none")]
982    pub fixed: Option<String>,
983    /// The serif font-family.
984    #[serde(default, skip_serializing_if = "Option::is_none")]
985    pub serif: Option<String>,
986    /// The sansSerif font-family.
987    #[serde(rename = "sansSerif", default, skip_serializing_if = "Option::is_none")]
988    pub sans_serif: Option<String>,
989    /// The cursive font-family.
990    #[serde(default, skip_serializing_if = "Option::is_none")]
991    pub cursive: Option<String>,
992    /// The fantasy font-family.
993    #[serde(default, skip_serializing_if = "Option::is_none")]
994    pub fantasy: Option<String>,
995    /// The math font-family.
996    #[serde(default, skip_serializing_if = "Option::is_none")]
997    pub math: Option<String>,
998}
999
1000/// Font families collection for a script.
1001///
1002/// Experimental: may change without notice.
1003#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1004pub struct ScriptFontFamilies {
1005    /// Name of the script which these font families are defined for.
1006    pub script: String,
1007    /// Generic font families collection for the script.
1008    #[serde(rename = "fontFamilies")]
1009    pub font_families: FontFamilies,
1010}
1011
1012/// Default font sizes.
1013///
1014/// Experimental: may change without notice.
1015#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1016pub struct FontSizes {
1017    /// Default standard font size.
1018    #[serde(default, skip_serializing_if = "Option::is_none")]
1019    pub standard: Option<i64>,
1020    /// Default fixed font size.
1021    #[serde(default, skip_serializing_if = "Option::is_none")]
1022    pub fixed: Option<i64>,
1023}
1024
1025/// Experimental: may change without notice.
1026#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1027pub enum ClientNavigationReason {
1028    /// `anchorClick`
1029    #[serde(rename = "anchorClick")]
1030    AnchorClick,
1031    /// `formSubmissionGet`
1032    #[serde(rename = "formSubmissionGet")]
1033    FormSubmissionGet,
1034    /// `formSubmissionPost`
1035    #[serde(rename = "formSubmissionPost")]
1036    FormSubmissionPost,
1037    /// `httpHeaderRefresh`
1038    #[serde(rename = "httpHeaderRefresh")]
1039    HttpHeaderRefresh,
1040    /// `initialFrameNavigation`
1041    #[serde(rename = "initialFrameNavigation")]
1042    InitialFrameNavigation,
1043    /// `metaTagRefresh`
1044    #[serde(rename = "metaTagRefresh")]
1045    MetaTagRefresh,
1046    /// `other`
1047    #[serde(rename = "other")]
1048    Other,
1049    /// `pageBlockInterstitial`
1050    #[serde(rename = "pageBlockInterstitial")]
1051    PageBlockInterstitial,
1052    /// `reload`
1053    #[serde(rename = "reload")]
1054    Reload,
1055    /// `scriptInitiated`
1056    #[serde(rename = "scriptInitiated")]
1057    ScriptInitiated,
1058    /// A value this vendored schema does not list. Chrome adds values ahead of
1059    /// the published protocol, so an unrecognised one is kept as it arrived
1060    /// rather than failing the payload it came in.
1061    #[serde(untagged)]
1062    Unrecognized(String),
1063}
1064
1065/// Experimental: may change without notice.
1066#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1067pub enum ClientNavigationDisposition {
1068    /// `currentTab`
1069    #[serde(rename = "currentTab")]
1070    CurrentTab,
1071    /// `newTab`
1072    #[serde(rename = "newTab")]
1073    NewTab,
1074    /// `newWindow`
1075    #[serde(rename = "newWindow")]
1076    NewWindow,
1077    /// `download`
1078    #[serde(rename = "download")]
1079    Download,
1080    /// A value this vendored schema does not list. Chrome adds values ahead of
1081    /// the published protocol, so an unrecognised one is kept as it arrived
1082    /// rather than failing the payload it came in.
1083    #[serde(untagged)]
1084    Unrecognized(String),
1085}
1086
1087/// Experimental: may change without notice.
1088#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1089pub struct InstallabilityErrorArgument {
1090    /// Argument name (e.g. name:'minimum-icon-size-in-pixels').
1091    pub name: String,
1092    /// Argument value (e.g. value:'64').
1093    pub value: String,
1094}
1095
1096/// The installability error
1097///
1098/// Experimental: may change without notice.
1099#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1100pub struct InstallabilityError {
1101    /// The error id (e.g. 'manifest-missing-suitable-icon').
1102    #[serde(rename = "errorId")]
1103    pub error_id: String,
1104    /// The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels',
1105    /// value:'64'}).
1106    #[serde(rename = "errorArguments")]
1107    pub error_arguments: Vec<InstallabilityErrorArgument>,
1108}
1109
1110/// The referring-policy used for the navigation.
1111///
1112/// Experimental: may change without notice.
1113#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1114pub enum ReferrerPolicy {
1115    /// `noReferrer`
1116    #[serde(rename = "noReferrer")]
1117    NoReferrer,
1118    /// `noReferrerWhenDowngrade`
1119    #[serde(rename = "noReferrerWhenDowngrade")]
1120    NoReferrerWhenDowngrade,
1121    /// `origin`
1122    #[serde(rename = "origin")]
1123    Origin,
1124    /// `originWhenCrossOrigin`
1125    #[serde(rename = "originWhenCrossOrigin")]
1126    OriginWhenCrossOrigin,
1127    /// `sameOrigin`
1128    #[serde(rename = "sameOrigin")]
1129    SameOrigin,
1130    /// `strictOrigin`
1131    #[serde(rename = "strictOrigin")]
1132    StrictOrigin,
1133    /// `strictOriginWhenCrossOrigin`
1134    #[serde(rename = "strictOriginWhenCrossOrigin")]
1135    StrictOriginWhenCrossOrigin,
1136    /// `unsafeUrl`
1137    #[serde(rename = "unsafeUrl")]
1138    UnsafeUrl,
1139    /// A value this vendored schema does not list. Chrome adds values ahead of
1140    /// the published protocol, so an unrecognised one is kept as it arrived
1141    /// rather than failing the payload it came in.
1142    #[serde(untagged)]
1143    Unrecognized(String),
1144}
1145
1146/// Per-script compilation cache parameters for `Page.produceCompilationCache`
1147///
1148/// Experimental: may change without notice.
1149#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1150pub struct CompilationCacheParams {
1151    /// The URL of the script to produce a compilation cache entry for.
1152    pub url: String,
1153    /// A hint to the backend whether eager compilation is recommended. (the
1154    /// actual compilation mode used is upon backend discretion).
1155    #[serde(default, skip_serializing_if = "Option::is_none")]
1156    pub eager: Option<bool>,
1157}
1158
1159/// Experimental: may change without notice.
1160#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1161pub struct FileFilter {
1162    #[serde(default, skip_serializing_if = "Option::is_none")]
1163    pub name: Option<String>,
1164    #[serde(default, skip_serializing_if = "Option::is_none")]
1165    pub accepts: Option<Vec<String>>,
1166}
1167
1168/// Experimental: may change without notice.
1169#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1170pub struct FileHandler {
1171    pub action: String,
1172    pub name: String,
1173    /// Mimic a map, name is the key, accepts is the value.
1174    #[serde(default, skip_serializing_if = "Option::is_none")]
1175    pub accepts: Option<Vec<FileFilter>>,
1176    /// Won't repeat the enums, using string for easy comparison. Same as the
1177    /// other enums below.
1178    #[serde(rename = "launchType")]
1179    pub launch_type: String,
1180}
1181
1182/// The image definition used in both icon and screenshot.
1183///
1184/// Experimental: may change without notice.
1185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1186pub struct ImageResource {
1187    /// The src field in the definition, but changing to url in favor of
1188    /// consistency.
1189    pub url: String,
1190    #[serde(default, skip_serializing_if = "Option::is_none")]
1191    pub sizes: Option<String>,
1192    #[serde(default, skip_serializing_if = "Option::is_none")]
1193    pub r#type: Option<String>,
1194}
1195
1196/// Experimental: may change without notice.
1197#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1198pub struct LaunchHandler {
1199    #[serde(rename = "clientMode")]
1200    pub client_mode: String,
1201}
1202
1203/// Experimental: may change without notice.
1204#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1205pub struct ProtocolHandler {
1206    pub protocol: String,
1207    pub url: String,
1208}
1209
1210/// Experimental: may change without notice.
1211#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1212pub struct RelatedApplication {
1213    #[serde(default, skip_serializing_if = "Option::is_none")]
1214    pub id: Option<String>,
1215    pub url: String,
1216}
1217
1218/// Experimental: may change without notice.
1219#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1220pub struct ScopeExtension {
1221    /// Instead of using tuple, this field always returns the serialized string
1222    /// for easy understanding and comparison.
1223    pub origin: String,
1224    #[serde(rename = "hasOriginWildcard")]
1225    pub has_origin_wildcard: bool,
1226}
1227
1228/// Experimental: may change without notice.
1229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1230pub struct Screenshot {
1231    pub image: ImageResource,
1232    #[serde(rename = "formFactor")]
1233    pub form_factor: String,
1234    #[serde(default, skip_serializing_if = "Option::is_none")]
1235    pub label: Option<String>,
1236}
1237
1238/// Experimental: may change without notice.
1239#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1240pub struct ShareTarget {
1241    pub action: String,
1242    pub method: String,
1243    pub enctype: String,
1244    /// Embed the ShareTargetParams
1245    #[serde(default, skip_serializing_if = "Option::is_none")]
1246    pub title: Option<String>,
1247    #[serde(default, skip_serializing_if = "Option::is_none")]
1248    pub text: Option<String>,
1249    #[serde(default, skip_serializing_if = "Option::is_none")]
1250    pub url: Option<String>,
1251    #[serde(default, skip_serializing_if = "Option::is_none")]
1252    pub files: Option<Vec<FileFilter>>,
1253}
1254
1255/// Experimental: may change without notice.
1256#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1257pub struct Shortcut {
1258    pub name: String,
1259    pub url: String,
1260}
1261
1262/// Experimental: may change without notice.
1263#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1264pub struct WebAppManifest {
1265    #[serde(
1266        rename = "backgroundColor",
1267        default,
1268        skip_serializing_if = "Option::is_none"
1269    )]
1270    pub background_color: Option<String>,
1271    /// The extra description provided by the manifest.
1272    #[serde(default, skip_serializing_if = "Option::is_none")]
1273    pub description: Option<String>,
1274    #[serde(default, skip_serializing_if = "Option::is_none")]
1275    pub dir: Option<String>,
1276    #[serde(default, skip_serializing_if = "Option::is_none")]
1277    pub display: Option<String>,
1278    /// The overrided display mode controlled by the user.
1279    #[serde(
1280        rename = "displayOverrides",
1281        default,
1282        skip_serializing_if = "Option::is_none"
1283    )]
1284    pub display_overrides: Option<Vec<String>>,
1285    /// The handlers to open files.
1286    #[serde(
1287        rename = "fileHandlers",
1288        default,
1289        skip_serializing_if = "Option::is_none"
1290    )]
1291    pub file_handlers: Option<Vec<FileHandler>>,
1292    #[serde(default, skip_serializing_if = "Option::is_none")]
1293    pub icons: Option<Vec<ImageResource>>,
1294    #[serde(default, skip_serializing_if = "Option::is_none")]
1295    pub id: Option<String>,
1296    #[serde(default, skip_serializing_if = "Option::is_none")]
1297    pub lang: Option<String>,
1298    /// TODO(crbug.com/1231886): This field is non-standard and part of a Chrome
1299    /// experiment. See:
1300    /// <https://github.com/WICG/web-app-launch/blob/main/launch_handler.md>
1301    #[serde(
1302        rename = "launchHandler",
1303        default,
1304        skip_serializing_if = "Option::is_none"
1305    )]
1306    pub launch_handler: Option<LaunchHandler>,
1307    #[serde(default, skip_serializing_if = "Option::is_none")]
1308    pub name: Option<String>,
1309    #[serde(default, skip_serializing_if = "Option::is_none")]
1310    pub orientation: Option<String>,
1311    #[serde(
1312        rename = "preferRelatedApplications",
1313        default,
1314        skip_serializing_if = "Option::is_none"
1315    )]
1316    pub prefer_related_applications: Option<bool>,
1317    /// The handlers to open protocols.
1318    #[serde(
1319        rename = "protocolHandlers",
1320        default,
1321        skip_serializing_if = "Option::is_none"
1322    )]
1323    pub protocol_handlers: Option<Vec<ProtocolHandler>>,
1324    #[serde(
1325        rename = "relatedApplications",
1326        default,
1327        skip_serializing_if = "Option::is_none"
1328    )]
1329    pub related_applications: Option<Vec<RelatedApplication>>,
1330    #[serde(default, skip_serializing_if = "Option::is_none")]
1331    pub scope: Option<String>,
1332    /// Non-standard, see
1333    /// <https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md>
1334    #[serde(
1335        rename = "scopeExtensions",
1336        default,
1337        skip_serializing_if = "Option::is_none"
1338    )]
1339    pub scope_extensions: Option<Vec<ScopeExtension>>,
1340    /// The screenshots used by chromium.
1341    #[serde(default, skip_serializing_if = "Option::is_none")]
1342    pub screenshots: Option<Vec<Screenshot>>,
1343    #[serde(
1344        rename = "shareTarget",
1345        default,
1346        skip_serializing_if = "Option::is_none"
1347    )]
1348    pub share_target: Option<ShareTarget>,
1349    #[serde(rename = "shortName", default, skip_serializing_if = "Option::is_none")]
1350    pub short_name: Option<String>,
1351    #[serde(default, skip_serializing_if = "Option::is_none")]
1352    pub shortcuts: Option<Vec<Shortcut>>,
1353    #[serde(rename = "startUrl", default, skip_serializing_if = "Option::is_none")]
1354    pub start_url: Option<String>,
1355    #[serde(
1356        rename = "themeColor",
1357        default,
1358        skip_serializing_if = "Option::is_none"
1359    )]
1360    pub theme_color: Option<String>,
1361}
1362
1363#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1364pub struct SubApp {
1365    /// Display name of the sub-app.
1366    pub name: String,
1367    /// Scope of the sub-app.
1368    pub scope: String,
1369    /// Manifest id of the sub-app.
1370    #[serde(rename = "manifestId")]
1371    pub manifest_id: String,
1372    /// Start URL of the sub-app.
1373    #[serde(rename = "startUrl")]
1374    pub start_url: String,
1375}
1376
1377/// The type of a frameNavigated event.
1378///
1379/// Experimental: may change without notice.
1380#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1381pub enum NavigationType {
1382    /// `Navigation`
1383    Navigation,
1384    /// `BackForwardCacheRestore`
1385    BackForwardCacheRestore,
1386    /// A value this vendored schema does not list. Chrome adds values ahead of
1387    /// the published protocol, so an unrecognised one is kept as it arrived
1388    /// rather than failing the payload it came in.
1389    #[serde(untagged)]
1390    Unrecognized(String),
1391}
1392
1393/// List of not restored reasons for back-forward cache.
1394///
1395/// Experimental: may change without notice.
1396#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1397pub enum BackForwardCacheNotRestoredReason {
1398    /// `NotPrimaryMainFrame`
1399    NotPrimaryMainFrame,
1400    /// `BackForwardCacheDisabled`
1401    BackForwardCacheDisabled,
1402    /// `RelatedActiveContentsExist`
1403    RelatedActiveContentsExist,
1404    /// `HTTPStatusNotOK`
1405    #[serde(rename = "HTTPStatusNotOK")]
1406    HttpStatusNotOk,
1407    /// `SchemeNotHTTPOrHTTPS`
1408    #[serde(rename = "SchemeNotHTTPOrHTTPS")]
1409    SchemeNotHttpOrHttps,
1410    /// `Loading`
1411    Loading,
1412    /// `WasGrantedMediaAccess`
1413    WasGrantedMediaAccess,
1414    /// `DisableForRenderFrameHostCalled`
1415    DisableForRenderFrameHostCalled,
1416    /// `DomainNotAllowed`
1417    DomainNotAllowed,
1418    /// `HTTPMethodNotGET`
1419    #[serde(rename = "HTTPMethodNotGET")]
1420    HttpMethodNotGet,
1421    /// `SubframeIsNavigating`
1422    SubframeIsNavigating,
1423    /// `Timeout`
1424    Timeout,
1425    /// `CacheLimit`
1426    CacheLimit,
1427    /// `JavaScriptExecution`
1428    JavaScriptExecution,
1429    /// `RendererProcessKilled`
1430    RendererProcessKilled,
1431    /// `RendererProcessCrashed`
1432    RendererProcessCrashed,
1433    /// `SchedulerTrackedFeatureUsed`
1434    SchedulerTrackedFeatureUsed,
1435    /// `ConflictingBrowsingInstance`
1436    ConflictingBrowsingInstance,
1437    /// `CacheFlushed`
1438    CacheFlushed,
1439    /// `ServiceWorkerVersionActivation`
1440    ServiceWorkerVersionActivation,
1441    /// `SessionRestored`
1442    SessionRestored,
1443    /// `ServiceWorkerPostMessage`
1444    ServiceWorkerPostMessage,
1445    /// `EnteredBackForwardCacheBeforeServiceWorkerHostAdded`
1446    EnteredBackForwardCacheBeforeServiceWorkerHostAdded,
1447    /// `RenderFrameHostReused_SameSite`
1448    #[serde(rename = "RenderFrameHostReused_SameSite")]
1449    RenderFrameHostReusedSameSite,
1450    /// `RenderFrameHostReused_CrossSite`
1451    #[serde(rename = "RenderFrameHostReused_CrossSite")]
1452    RenderFrameHostReusedCrossSite,
1453    /// `ServiceWorkerClaim`
1454    ServiceWorkerClaim,
1455    /// `IgnoreEventAndEvict`
1456    IgnoreEventAndEvict,
1457    /// `HaveInnerContents`
1458    HaveInnerContents,
1459    /// `TimeoutPuttingInCache`
1460    TimeoutPuttingInCache,
1461    /// `BackForwardCacheDisabledByLowMemory`
1462    BackForwardCacheDisabledByLowMemory,
1463    /// `BackForwardCacheDisabledByCommandLine`
1464    BackForwardCacheDisabledByCommandLine,
1465    /// `NetworkRequestDatapipeDrainedAsBytesConsumer`
1466    NetworkRequestDatapipeDrainedAsBytesConsumer,
1467    /// `NetworkRequestRedirected`
1468    NetworkRequestRedirected,
1469    /// `NetworkRequestTimeout`
1470    NetworkRequestTimeout,
1471    /// `NetworkExceedsBufferLimit`
1472    NetworkExceedsBufferLimit,
1473    /// `NavigationCancelledWhileRestoring`
1474    NavigationCancelledWhileRestoring,
1475    /// `NotMostRecentNavigationEntry`
1476    NotMostRecentNavigationEntry,
1477    /// `BackForwardCacheDisabledForPrerender`
1478    BackForwardCacheDisabledForPrerender,
1479    /// `UserAgentOverrideDiffers`
1480    UserAgentOverrideDiffers,
1481    /// `ForegroundCacheLimit`
1482    ForegroundCacheLimit,
1483    /// `ForwardCacheDisabled`
1484    ForwardCacheDisabled,
1485    /// `BrowsingInstanceNotSwapped`
1486    BrowsingInstanceNotSwapped,
1487    /// `BackForwardCacheDisabledForDelegate`
1488    BackForwardCacheDisabledForDelegate,
1489    /// `UnloadHandlerExistsInMainFrame`
1490    UnloadHandlerExistsInMainFrame,
1491    /// `UnloadHandlerExistsInSubFrame`
1492    UnloadHandlerExistsInSubFrame,
1493    /// `ServiceWorkerUnregistration`
1494    ServiceWorkerUnregistration,
1495    /// `CacheControlNoStore`
1496    CacheControlNoStore,
1497    /// `CacheControlNoStoreCookieModified`
1498    CacheControlNoStoreCookieModified,
1499    /// `CacheControlNoStoreHTTPOnlyCookieModified`
1500    #[serde(rename = "CacheControlNoStoreHTTPOnlyCookieModified")]
1501    CacheControlNoStoreHttpOnlyCookieModified,
1502    /// `NoResponseHead`
1503    NoResponseHead,
1504    /// `Unknown`
1505    Unknown,
1506    /// `ActivationNavigationsDisallowedForBug1234857`
1507    ActivationNavigationsDisallowedForBug1234857,
1508    /// `ErrorDocument`
1509    ErrorDocument,
1510    /// `FencedFramesEmbedder`
1511    FencedFramesEmbedder,
1512    /// `CookieDisabled`
1513    CookieDisabled,
1514    /// `HTTPAuthRequired`
1515    #[serde(rename = "HTTPAuthRequired")]
1516    HttpAuthRequired,
1517    /// `CookieFlushed`
1518    CookieFlushed,
1519    /// `BroadcastChannelOnMessage`
1520    BroadcastChannelOnMessage,
1521    /// `WebViewSettingsChanged`
1522    WebViewSettingsChanged,
1523    /// `WebViewJavaScriptObjectChanged`
1524    WebViewJavaScriptObjectChanged,
1525    /// `WebViewMessageListenerInjected`
1526    WebViewMessageListenerInjected,
1527    /// `WebViewSafeBrowsingAllowlistChanged`
1528    WebViewSafeBrowsingAllowlistChanged,
1529    /// `WebViewDocumentStartJavascriptChanged`
1530    WebViewDocumentStartJavascriptChanged,
1531    /// `WebSocket`
1532    WebSocket,
1533    /// `WebTransport`
1534    WebTransport,
1535    /// `WebRTC`
1536    #[serde(rename = "WebRTC")]
1537    WebRtc,
1538    /// `MainResourceHasCacheControlNoStore`
1539    MainResourceHasCacheControlNoStore,
1540    /// `MainResourceHasCacheControlNoCache`
1541    MainResourceHasCacheControlNoCache,
1542    /// `SubresourceHasCacheControlNoStore`
1543    SubresourceHasCacheControlNoStore,
1544    /// `SubresourceHasCacheControlNoCache`
1545    SubresourceHasCacheControlNoCache,
1546    /// `ContainsPlugins`
1547    ContainsPlugins,
1548    /// `DocumentLoaded`
1549    DocumentLoaded,
1550    /// `OutstandingNetworkRequestOthers`
1551    OutstandingNetworkRequestOthers,
1552    /// `RequestedMIDIPermission`
1553    #[serde(rename = "RequestedMIDIPermission")]
1554    RequestedMidiPermission,
1555    /// `RequestedAudioCapturePermission`
1556    RequestedAudioCapturePermission,
1557    /// `RequestedVideoCapturePermission`
1558    RequestedVideoCapturePermission,
1559    /// `RequestedBackForwardCacheBlockedSensors`
1560    RequestedBackForwardCacheBlockedSensors,
1561    /// `RequestedBackgroundWorkPermission`
1562    RequestedBackgroundWorkPermission,
1563    /// `BroadcastChannel`
1564    BroadcastChannel,
1565    /// `WebXR`
1566    #[serde(rename = "WebXR")]
1567    WebXr,
1568    /// `SharedWorker`
1569    SharedWorker,
1570    /// `SharedWorkerMessage`
1571    SharedWorkerMessage,
1572    /// `SharedWorkerWithNoActiveClient`
1573    SharedWorkerWithNoActiveClient,
1574    /// `WebLocks`
1575    WebLocks,
1576    /// `WebLocksContention`
1577    WebLocksContention,
1578    /// `WebHID`
1579    #[serde(rename = "WebHID")]
1580    WebHid,
1581    /// `WebBluetooth`
1582    WebBluetooth,
1583    /// `WebShare`
1584    WebShare,
1585    /// `RequestedStorageAccessGrant`
1586    RequestedStorageAccessGrant,
1587    /// `WebNfc`
1588    WebNfc,
1589    /// `OutstandingNetworkRequestFetch`
1590    OutstandingNetworkRequestFetch,
1591    /// `OutstandingNetworkRequestXHR`
1592    #[serde(rename = "OutstandingNetworkRequestXHR")]
1593    OutstandingNetworkRequestXhr,
1594    /// `AppBanner`
1595    AppBanner,
1596    /// `Printing`
1597    Printing,
1598    /// `WebDatabase`
1599    WebDatabase,
1600    /// `PictureInPicture`
1601    PictureInPicture,
1602    /// `SpeechRecognizer`
1603    SpeechRecognizer,
1604    /// `IdleManager`
1605    IdleManager,
1606    /// `PaymentManager`
1607    PaymentManager,
1608    /// `SpeechSynthesis`
1609    SpeechSynthesis,
1610    /// `KeyboardLock`
1611    KeyboardLock,
1612    /// `WebOTPService`
1613    #[serde(rename = "WebOTPService")]
1614    WebOtpService,
1615    /// `OutstandingNetworkRequestDirectSocket`
1616    OutstandingNetworkRequestDirectSocket,
1617    /// `InjectedJavascript`
1618    InjectedJavascript,
1619    /// `InjectedStyleSheet`
1620    InjectedStyleSheet,
1621    /// `KeepaliveRequest`
1622    KeepaliveRequest,
1623    /// `IndexedDBEvent`
1624    #[serde(rename = "IndexedDBEvent")]
1625    IndexedDbEvent,
1626    /// `Dummy`
1627    Dummy,
1628    /// `JsNetworkRequestReceivedCacheControlNoStoreResource`
1629    JsNetworkRequestReceivedCacheControlNoStoreResource,
1630    /// `WebRTCUsedWithCCNS`
1631    #[serde(rename = "WebRTCUsedWithCCNS")]
1632    WebRtcUsedWithCcns,
1633    /// `WebTransportUsedWithCCNS`
1634    #[serde(rename = "WebTransportUsedWithCCNS")]
1635    WebTransportUsedWithCcns,
1636    /// `WebSocketUsedWithCCNS`
1637    #[serde(rename = "WebSocketUsedWithCCNS")]
1638    WebSocketUsedWithCcns,
1639    /// `SmartCard`
1640    SmartCard,
1641    /// `LiveMediaStreamTrack`
1642    LiveMediaStreamTrack,
1643    /// `UnloadHandler`
1644    UnloadHandler,
1645    /// `ParserAborted`
1646    ParserAborted,
1647    /// `ContentSecurityHandler`
1648    ContentSecurityHandler,
1649    /// `ContentWebAuthenticationAPI`
1650    #[serde(rename = "ContentWebAuthenticationAPI")]
1651    ContentWebAuthenticationApi,
1652    /// `ContentFileChooser`
1653    ContentFileChooser,
1654    /// `ContentSerial`
1655    ContentSerial,
1656    /// `ContentFileSystemAccess`
1657    ContentFileSystemAccess,
1658    /// `ContentMediaDevicesDispatcherHost`
1659    ContentMediaDevicesDispatcherHost,
1660    /// `ContentWebBluetooth`
1661    ContentWebBluetooth,
1662    /// `ContentWebUSB`
1663    #[serde(rename = "ContentWebUSB")]
1664    ContentWebUsb,
1665    /// `ContentMediaSessionService`
1666    ContentMediaSessionService,
1667    /// `ContentScreenReader`
1668    ContentScreenReader,
1669    /// `ContentDiscarded`
1670    ContentDiscarded,
1671    /// `EmbedderPopupBlockerTabHelper`
1672    EmbedderPopupBlockerTabHelper,
1673    /// `EmbedderSafeBrowsingTriggeredPopupBlocker`
1674    EmbedderSafeBrowsingTriggeredPopupBlocker,
1675    /// `EmbedderSafeBrowsingThreatDetails`
1676    EmbedderSafeBrowsingThreatDetails,
1677    /// `EmbedderAppBannerManager`
1678    EmbedderAppBannerManager,
1679    /// `EmbedderDomDistillerViewerSource`
1680    EmbedderDomDistillerViewerSource,
1681    /// `EmbedderDomDistillerSelfDeletingRequestDelegate`
1682    EmbedderDomDistillerSelfDeletingRequestDelegate,
1683    /// `EmbedderOomInterventionTabHelper`
1684    EmbedderOomInterventionTabHelper,
1685    /// `EmbedderOfflinePage`
1686    EmbedderOfflinePage,
1687    /// `EmbedderChromePasswordManagerClientBindCredentialManager`
1688    EmbedderChromePasswordManagerClientBindCredentialManager,
1689    /// `EmbedderPermissionRequestManager`
1690    EmbedderPermissionRequestManager,
1691    /// `EmbedderModalDialog`
1692    EmbedderModalDialog,
1693    /// `EmbedderExtensions`
1694    EmbedderExtensions,
1695    /// `EmbedderExtensionMessaging`
1696    EmbedderExtensionMessaging,
1697    /// `EmbedderExtensionMessagingForOpenPort`
1698    EmbedderExtensionMessagingForOpenPort,
1699    /// `EmbedderExtensionSentMessageToCachedFrame`
1700    EmbedderExtensionSentMessageToCachedFrame,
1701    /// `EmbedderExtensionFrame`
1702    EmbedderExtensionFrame,
1703    /// `EmbedderPrivilegedWebContents`
1704    EmbedderPrivilegedWebContents,
1705    /// `RequestedByWebViewClient`
1706    RequestedByWebViewClient,
1707    /// `PostMessageByWebViewClient`
1708    PostMessageByWebViewClient,
1709    /// `CacheControlNoStoreDeviceBoundSessionTerminated`
1710    CacheControlNoStoreDeviceBoundSessionTerminated,
1711    /// `CacheLimitPrunedOnModerateMemoryPressure`
1712    CacheLimitPrunedOnModerateMemoryPressure,
1713    /// `CacheLimitPrunedOnCriticalMemoryPressure`
1714    CacheLimitPrunedOnCriticalMemoryPressure,
1715    /// A value this vendored schema does not list. Chrome adds values ahead of
1716    /// the published protocol, so an unrecognised one is kept as it arrived
1717    /// rather than failing the payload it came in.
1718    #[serde(untagged)]
1719    Unrecognized(String),
1720}
1721
1722/// Types of not restored reasons for back-forward cache.
1723///
1724/// Experimental: may change without notice.
1725#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1726pub enum BackForwardCacheNotRestoredReasonType {
1727    /// `SupportPending`
1728    SupportPending,
1729    /// `PageSupportNeeded`
1730    PageSupportNeeded,
1731    /// `Circumstantial`
1732    Circumstantial,
1733    /// A value this vendored schema does not list. Chrome adds values ahead of
1734    /// the published protocol, so an unrecognised one is kept as it arrived
1735    /// rather than failing the payload it came in.
1736    #[serde(untagged)]
1737    Unrecognized(String),
1738}
1739
1740/// Experimental: may change without notice.
1741#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1742pub struct BackForwardCacheBlockingDetails {
1743    /// Url of the file where blockage happened. Optional because of tests.
1744    #[serde(default, skip_serializing_if = "Option::is_none")]
1745    pub url: Option<String>,
1746    /// Function name where blockage happened. Optional because of anonymous
1747    /// functions and tests.
1748    #[serde(default, skip_serializing_if = "Option::is_none")]
1749    pub function: Option<String>,
1750    /// Line number in the script (0-based).
1751    #[serde(rename = "lineNumber")]
1752    pub line_number: i64,
1753    /// Column number in the script (0-based).
1754    #[serde(rename = "columnNumber")]
1755    pub column_number: i64,
1756}
1757
1758/// Experimental: may change without notice.
1759#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1760pub struct BackForwardCacheNotRestoredExplanation {
1761    /// Type of the reason
1762    pub r#type: BackForwardCacheNotRestoredReasonType,
1763    /// Not restored reason
1764    pub reason: BackForwardCacheNotRestoredReason,
1765    /// Context associated with the reason. The meaning of this context is
1766    /// dependent on the reason: - EmbedderExtensionSentMessageToCachedFrame: the
1767    /// extension ID.
1768    #[serde(default, skip_serializing_if = "Option::is_none")]
1769    pub context: Option<String>,
1770    #[serde(default, skip_serializing_if = "Option::is_none")]
1771    pub details: Option<Vec<BackForwardCacheBlockingDetails>>,
1772}
1773
1774/// Experimental: may change without notice.
1775#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1776pub struct BackForwardCacheNotRestoredExplanationTree {
1777    /// URL of each frame
1778    pub url: String,
1779    /// Not restored reasons of each frame
1780    pub explanations: Vec<BackForwardCacheNotRestoredExplanation>,
1781    /// Array of children frame
1782    pub children: Vec<BackForwardCacheNotRestoredExplanationTree>,
1783}
1784
1785/// Deprecated, please use addScriptToEvaluateOnNewDocument instead.
1786///
1787/// Deprecated in the protocol.
1788///
1789/// Experimental: may change without notice.
1790///
1791/// Parameters of `Page.addScriptToEvaluateOnLoad`.
1792#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1793pub struct AddScriptToEvaluateOnLoadParams {
1794    #[serde(rename = "scriptSource")]
1795    pub script_source: String,
1796}
1797
1798/// What `Page.addScriptToEvaluateOnLoad` answers with.
1799#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1800pub struct AddScriptToEvaluateOnLoadReturns {
1801    /// Identifier of the added script.
1802    pub identifier: ScriptIdentifier,
1803}
1804
1805impl crate::typed::Command for AddScriptToEvaluateOnLoadParams {
1806    const METHOD: &'static str = "Page.addScriptToEvaluateOnLoad";
1807    type Returns = AddScriptToEvaluateOnLoadReturns;
1808}
1809
1810/// Evaluates given script in every frame upon creation (before loading
1811/// frame's scripts).
1812///
1813/// Parameters of `Page.addScriptToEvaluateOnNewDocument`.
1814#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1815pub struct AddScriptToEvaluateOnNewDocumentParams {
1816    pub source: String,
1817    /// If specified, creates an isolated world with the given name and evaluates
1818    /// given script in it. This world name will be used as the
1819    /// ExecutionContextDescription::name when the corresponding event is emitted.
1820    ///
1821    /// Experimental: may change without notice.
1822    #[serde(rename = "worldName", default, skip_serializing_if = "Option::is_none")]
1823    pub world_name: Option<String>,
1824    /// Specifies whether command line API should be available to the script,
1825    /// defaults to false.
1826    ///
1827    /// Experimental: may change without notice.
1828    #[serde(
1829        rename = "includeCommandLineAPI",
1830        default,
1831        skip_serializing_if = "Option::is_none"
1832    )]
1833    pub include_command_line_api: Option<bool>,
1834    /// If true, runs the script immediately on existing execution contexts or
1835    /// worlds. Default: false.
1836    ///
1837    /// Experimental: may change without notice.
1838    #[serde(
1839        rename = "runImmediately",
1840        default,
1841        skip_serializing_if = "Option::is_none"
1842    )]
1843    pub run_immediately: Option<bool>,
1844}
1845
1846/// What `Page.addScriptToEvaluateOnNewDocument` answers with.
1847#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1848pub struct AddScriptToEvaluateOnNewDocumentReturns {
1849    /// Identifier of the added script.
1850    pub identifier: ScriptIdentifier,
1851}
1852
1853impl crate::typed::Command for AddScriptToEvaluateOnNewDocumentParams {
1854    const METHOD: &'static str = "Page.addScriptToEvaluateOnNewDocument";
1855    type Returns = AddScriptToEvaluateOnNewDocumentReturns;
1856}
1857
1858/// Brings page to front (activates tab).
1859///
1860/// Parameters of `Page.bringToFront`.
1861#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1862pub struct BringToFrontParams {}
1863
1864impl crate::typed::Command for BringToFrontParams {
1865    const METHOD: &'static str = "Page.bringToFront";
1866    type Returns = crate::typed::NoReturns;
1867}
1868
1869/// Capture page screenshot.
1870///
1871/// Parameters of `Page.captureScreenshot`.
1872#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1873pub struct CaptureScreenshotParams {
1874    /// Image compression format (defaults to png).
1875    #[serde(default, skip_serializing_if = "Option::is_none")]
1876    pub format: Option<CaptureScreenshotFormat>,
1877    /// Compression quality from range \[0..100\] (jpeg only).
1878    #[serde(default, skip_serializing_if = "Option::is_none")]
1879    pub quality: Option<i64>,
1880    /// Capture the screenshot of a given region only.
1881    #[serde(default, skip_serializing_if = "Option::is_none")]
1882    pub clip: Option<Viewport>,
1883    /// Capture the screenshot from the surface, rather than the view. Defaults to
1884    /// true.
1885    ///
1886    /// Experimental: may change without notice.
1887    #[serde(
1888        rename = "fromSurface",
1889        default,
1890        skip_serializing_if = "Option::is_none"
1891    )]
1892    pub from_surface: Option<bool>,
1893    /// Capture the screenshot beyond the viewport. Defaults to false.
1894    ///
1895    /// Experimental: may change without notice.
1896    #[serde(
1897        rename = "captureBeyondViewport",
1898        default,
1899        skip_serializing_if = "Option::is_none"
1900    )]
1901    pub capture_beyond_viewport: Option<bool>,
1902    /// Optimize image encoding for speed, not for resulting size (defaults to
1903    /// false)
1904    ///
1905    /// Experimental: may change without notice.
1906    #[serde(
1907        rename = "optimizeForSpeed",
1908        default,
1909        skip_serializing_if = "Option::is_none"
1910    )]
1911    pub optimize_for_speed: Option<bool>,
1912}
1913
1914/// The values `format` accepts on `captureScreenshot`.
1915#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1916pub enum CaptureScreenshotFormat {
1917    /// `jpeg`
1918    #[serde(rename = "jpeg")]
1919    Jpeg,
1920    /// `png`
1921    #[serde(rename = "png")]
1922    Png,
1923    /// `webp`
1924    #[serde(rename = "webp")]
1925    Webp,
1926    /// A value this vendored schema does not list. Chrome adds values ahead of
1927    /// the published protocol, so an unrecognised one is kept as it arrived
1928    /// rather than failing the payload it came in.
1929    #[serde(untagged)]
1930    Unrecognized(String),
1931}
1932
1933/// What `Page.captureScreenshot` answers with.
1934#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1935pub struct CaptureScreenshotReturns {
1936    /// Base64-encoded image data. (Encoded as a base64 string when passed over
1937    /// JSON)
1938    pub data: String,
1939}
1940
1941impl crate::typed::Command for CaptureScreenshotParams {
1942    const METHOD: &'static str = "Page.captureScreenshot";
1943    type Returns = CaptureScreenshotReturns;
1944}
1945
1946/// Returns a snapshot of the page as a string. For MHTML format, the
1947/// serialization includes iframes, shadow DOM, external resources, and
1948/// element-inline styles.
1949///
1950/// Experimental: may change without notice.
1951///
1952/// Parameters of `Page.captureSnapshot`.
1953#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1954pub struct CaptureSnapshotParams {
1955    /// Format (defaults to mhtml).
1956    #[serde(default, skip_serializing_if = "Option::is_none")]
1957    pub format: Option<CaptureSnapshotFormat>,
1958}
1959
1960/// The values `format` accepts on `captureSnapshot`.
1961#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1962pub enum CaptureSnapshotFormat {
1963    /// `mhtml`
1964    #[serde(rename = "mhtml")]
1965    Mhtml,
1966    /// A value this vendored schema does not list. Chrome adds values ahead of
1967    /// the published protocol, so an unrecognised one is kept as it arrived
1968    /// rather than failing the payload it came in.
1969    #[serde(untagged)]
1970    Unrecognized(String),
1971}
1972
1973/// What `Page.captureSnapshot` answers with.
1974#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1975pub struct CaptureSnapshotReturns {
1976    /// Serialized page data.
1977    pub data: String,
1978}
1979
1980impl crate::typed::Command for CaptureSnapshotParams {
1981    const METHOD: &'static str = "Page.captureSnapshot";
1982    type Returns = CaptureSnapshotReturns;
1983}
1984
1985/// Clears the overridden device metrics.
1986///
1987/// Deprecated in the protocol.
1988///
1989/// Experimental: may change without notice.
1990///
1991/// Parameters of `Page.clearDeviceMetricsOverride`.
1992#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1993pub struct ClearDeviceMetricsOverrideParams {}
1994
1995impl crate::typed::Command for ClearDeviceMetricsOverrideParams {
1996    const METHOD: &'static str = "Page.clearDeviceMetricsOverride";
1997    type Returns = crate::typed::NoReturns;
1998}
1999
2000/// Clears the overridden Device Orientation.
2001///
2002/// Deprecated in the protocol.
2003///
2004/// Experimental: may change without notice.
2005///
2006/// Parameters of `Page.clearDeviceOrientationOverride`.
2007#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2008pub struct ClearDeviceOrientationOverrideParams {}
2009
2010impl crate::typed::Command for ClearDeviceOrientationOverrideParams {
2011    const METHOD: &'static str = "Page.clearDeviceOrientationOverride";
2012    type Returns = crate::typed::NoReturns;
2013}
2014
2015/// Clears the overridden Geolocation Position and Error.
2016///
2017/// Deprecated in the protocol.
2018///
2019/// Parameters of `Page.clearGeolocationOverride`.
2020#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2021pub struct ClearGeolocationOverrideParams {}
2022
2023impl crate::typed::Command for ClearGeolocationOverrideParams {
2024    const METHOD: &'static str = "Page.clearGeolocationOverride";
2025    type Returns = crate::typed::NoReturns;
2026}
2027
2028/// Creates an isolated world for the given frame.
2029///
2030/// Parameters of `Page.createIsolatedWorld`.
2031#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2032pub struct CreateIsolatedWorldParams {
2033    /// Id of the frame in which the isolated world should be created.
2034    #[serde(rename = "frameId")]
2035    pub frame_id: FrameId,
2036    /// An optional name which is reported in the Execution Context.
2037    #[serde(rename = "worldName", default, skip_serializing_if = "Option::is_none")]
2038    pub world_name: Option<String>,
2039    /// Whether or not universal access should be granted to the isolated world.
2040    /// This is a powerful option, use with caution.
2041    #[serde(
2042        rename = "grantUniveralAccess",
2043        default,
2044        skip_serializing_if = "Option::is_none"
2045    )]
2046    pub grant_univeral_access: Option<bool>,
2047    /// An optional content security policy to set for the isolated world. If
2048    /// omitted, any existing CSP for the world will be cleared. Note that
2049    /// clearing or updating the CSP does not immediately affect the active
2050    /// context in the same document because LocalDOMWindow caches the
2051    /// ContentSecurityPolicy object. The change takes effect on subsequent
2052    /// navigations when a new window context is created.
2053    #[serde(
2054        rename = "contentSecurityPolicy",
2055        default,
2056        skip_serializing_if = "Option::is_none"
2057    )]
2058    pub content_security_policy: Option<String>,
2059}
2060
2061/// What `Page.createIsolatedWorld` answers with.
2062#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2063pub struct CreateIsolatedWorldReturns {
2064    /// Execution context of the isolated world.
2065    #[serde(rename = "executionContextId")]
2066    pub execution_context_id: crate::protocol::runtime::ExecutionContextId,
2067}
2068
2069impl crate::typed::Command for CreateIsolatedWorldParams {
2070    const METHOD: &'static str = "Page.createIsolatedWorld";
2071    type Returns = CreateIsolatedWorldReturns;
2072}
2073
2074/// Deletes browser cookie with given name, domain and path.
2075///
2076/// Deprecated in the protocol.
2077///
2078/// Experimental: may change without notice.
2079///
2080/// Parameters of `Page.deleteCookie`.
2081#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2082pub struct DeleteCookieParams {
2083    /// Name of the cookie to remove.
2084    #[serde(rename = "cookieName")]
2085    pub cookie_name: String,
2086    /// URL to match cooke domain and path.
2087    pub url: String,
2088}
2089
2090impl crate::typed::Command for DeleteCookieParams {
2091    const METHOD: &'static str = "Page.deleteCookie";
2092    type Returns = crate::typed::NoReturns;
2093}
2094
2095/// Disables page domain notifications.
2096///
2097/// Parameters of `Page.disable`.
2098#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2099pub struct DisableParams {}
2100
2101impl crate::typed::Command for DisableParams {
2102    const METHOD: &'static str = "Page.disable";
2103    type Returns = crate::typed::NoReturns;
2104}
2105
2106/// Enables page domain notifications.
2107///
2108/// Parameters of `Page.enable`.
2109#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2110pub struct EnableParams {
2111    /// If true, the `Page.fileChooserOpened` event will be emitted regardless of
2112    /// the state set by `Page.setInterceptFileChooserDialog` command (default:
2113    /// false).
2114    ///
2115    /// Experimental: may change without notice.
2116    #[serde(
2117        rename = "enableFileChooserOpenedEvent",
2118        default,
2119        skip_serializing_if = "Option::is_none"
2120    )]
2121    pub enable_file_chooser_opened_event: Option<bool>,
2122}
2123
2124impl crate::typed::Command for EnableParams {
2125    const METHOD: &'static str = "Page.enable";
2126    type Returns = crate::typed::NoReturns;
2127}
2128
2129/// Gets the processed manifest for this current document. This API always
2130/// waits for the manifest to be loaded. If manifestId is provided, and it
2131/// does not match the manifest of the current document, this API errors out.
2132/// If there is not a loaded page, this API errors out immediately.
2133///
2134/// Parameters of `Page.getAppManifest`.
2135#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2136pub struct GetAppManifestParams {
2137    #[serde(
2138        rename = "manifestId",
2139        default,
2140        skip_serializing_if = "Option::is_none"
2141    )]
2142    pub manifest_id: Option<String>,
2143}
2144
2145/// What `Page.getAppManifest` answers with.
2146#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2147pub struct GetAppManifestReturns {
2148    /// Manifest location.
2149    pub url: String,
2150    pub errors: Vec<AppManifestError>,
2151    /// Manifest content.
2152    #[serde(default, skip_serializing_if = "Option::is_none")]
2153    pub data: Option<String>,
2154    /// Parsed manifest properties. Deprecated, use manifest instead.
2155    ///
2156    /// Deprecated in the protocol.
2157    ///
2158    /// Experimental: may change without notice.
2159    #[serde(default, skip_serializing_if = "Option::is_none")]
2160    pub parsed: Option<AppManifestParsedProperties>,
2161    /// Experimental: may change without notice.
2162    pub manifest: WebAppManifest,
2163}
2164
2165impl crate::typed::Command for GetAppManifestParams {
2166    const METHOD: &'static str = "Page.getAppManifest";
2167    type Returns = GetAppManifestReturns;
2168}
2169
2170/// Experimental: may change without notice.
2171///
2172/// Parameters of `Page.getInstallabilityErrors`.
2173#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2174pub struct GetInstallabilityErrorsParams {}
2175
2176/// What `Page.getInstallabilityErrors` answers with.
2177#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2178pub struct GetInstallabilityErrorsReturns {
2179    #[serde(rename = "installabilityErrors")]
2180    pub installability_errors: Vec<InstallabilityError>,
2181}
2182
2183impl crate::typed::Command for GetInstallabilityErrorsParams {
2184    const METHOD: &'static str = "Page.getInstallabilityErrors";
2185    type Returns = GetInstallabilityErrorsReturns;
2186}
2187
2188/// Deprecated because it's not guaranteed that the returned icon is in fact
2189/// the one used for PWA installation.
2190///
2191/// Deprecated in the protocol.
2192///
2193/// Experimental: may change without notice.
2194///
2195/// Parameters of `Page.getManifestIcons`.
2196#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2197pub struct GetManifestIconsParams {}
2198
2199/// What `Page.getManifestIcons` answers with.
2200#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2201pub struct GetManifestIconsReturns {
2202    #[serde(
2203        rename = "primaryIcon",
2204        default,
2205        skip_serializing_if = "Option::is_none"
2206    )]
2207    pub primary_icon: Option<String>,
2208}
2209
2210impl crate::typed::Command for GetManifestIconsParams {
2211    const METHOD: &'static str = "Page.getManifestIcons";
2212    type Returns = GetManifestIconsReturns;
2213}
2214
2215/// Returns the unique (PWA) app id, along with IWA bundle ID and parent app
2216/// info. Only returns values if the feature flag 'WebAppEnableManifestId' is
2217/// enabled
2218///
2219/// Experimental: may change without notice.
2220///
2221/// Parameters of `Page.getAppId`.
2222#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2223pub struct GetAppIdParams {}
2224
2225/// What `Page.getAppId` answers with.
2226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2227pub struct GetAppIdReturns {
2228    /// App id, either from manifest's id attribute or computed from start_url
2229    #[serde(rename = "appId", default, skip_serializing_if = "Option::is_none")]
2230    pub app_id: Option<String>,
2231    /// Recommendation for manifest's id attribute to match current id computed
2232    /// from start_url
2233    #[serde(
2234        rename = "recommendedId",
2235        default,
2236        skip_serializing_if = "Option::is_none"
2237    )]
2238    pub recommended_id: Option<String>,
2239    /// The bundle ID for an Isolated Web App (IWA)
2240    #[serde(rename = "bundleId", default, skip_serializing_if = "Option::is_none")]
2241    pub bundle_id: Option<String>,
2242    /// The name of the parent app if this app is a Sub-App
2243    #[serde(
2244        rename = "parentAppName",
2245        default,
2246        skip_serializing_if = "Option::is_none"
2247    )]
2248    pub parent_app_name: Option<String>,
2249}
2250
2251impl crate::typed::Command for GetAppIdParams {
2252    const METHOD: &'static str = "Page.getAppId";
2253    type Returns = GetAppIdReturns;
2254}
2255
2256/// Returns the list of installed child Sub-Apps for the inspected parent app.
2257///
2258/// Experimental: may change without notice.
2259///
2260/// Parameters of `Page.getSubApps`.
2261#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2262pub struct GetSubAppsParams {}
2263
2264/// What `Page.getSubApps` answers with.
2265#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2266pub struct GetSubAppsReturns {
2267    #[serde(rename = "subApps")]
2268    pub sub_apps: Vec<SubApp>,
2269}
2270
2271impl crate::typed::Command for GetSubAppsParams {
2272    const METHOD: &'static str = "Page.getSubApps";
2273    type Returns = GetSubAppsReturns;
2274}
2275
2276/// Returns the list of sibling Sub-Apps sharing the same parent app if the
2277/// inspected context is a Sub-App.
2278///
2279/// Experimental: may change without notice.
2280///
2281/// Parameters of `Page.getSiblingSubApps`.
2282#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2283pub struct GetSiblingSubAppsParams {}
2284
2285/// What `Page.getSiblingSubApps` answers with.
2286#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2287pub struct GetSiblingSubAppsReturns {
2288    #[serde(rename = "subApps")]
2289    pub sub_apps: Vec<SubApp>,
2290}
2291
2292impl crate::typed::Command for GetSiblingSubAppsParams {
2293    const METHOD: &'static str = "Page.getSiblingSubApps";
2294    type Returns = GetSiblingSubAppsReturns;
2295}
2296
2297/// Experimental: may change without notice.
2298///
2299/// Parameters of `Page.getAdScriptAncestry`.
2300#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2301pub struct GetAdScriptAncestryParams {
2302    #[serde(rename = "frameId")]
2303    pub frame_id: FrameId,
2304}
2305
2306/// What `Page.getAdScriptAncestry` answers with.
2307#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2308pub struct GetAdScriptAncestryReturns {
2309    /// The ancestry chain of ad script identifiers leading to this frame's
2310    /// creation, along with the root script's filterlist rule. The ancestry chain
2311    /// is ordered from the most immediate script (in the frame creation stack) to
2312    /// more distant ancestors (that created the immediately preceding script).
2313    /// Only sent if frame is labelled as an ad and ids are available.
2314    #[serde(
2315        rename = "adScriptAncestry",
2316        default,
2317        skip_serializing_if = "Option::is_none"
2318    )]
2319    pub ad_script_ancestry: Option<crate::protocol::network::AdAncestry>,
2320}
2321
2322impl crate::typed::Command for GetAdScriptAncestryParams {
2323    const METHOD: &'static str = "Page.getAdScriptAncestry";
2324    type Returns = GetAdScriptAncestryReturns;
2325}
2326
2327/// Returns the words that the frame's document added to its spell check
2328/// custom dictionary with `document.spellCheckCustomDictionary.addWords()`,
2329/// sorted. Page script cannot read the dictionary back; this lets developers
2330/// inspect it.
2331///
2332/// Experimental: may change without notice.
2333///
2334/// Parameters of `Page.getSpellCheckCustomDictionary`.
2335#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2336pub struct GetSpellCheckCustomDictionaryParams {
2337    #[serde(rename = "frameId")]
2338    pub frame_id: FrameId,
2339}
2340
2341/// What `Page.getSpellCheckCustomDictionary` answers with.
2342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2343pub struct GetSpellCheckCustomDictionaryReturns {
2344    pub words: Vec<String>,
2345}
2346
2347impl crate::typed::Command for GetSpellCheckCustomDictionaryParams {
2348    const METHOD: &'static str = "Page.getSpellCheckCustomDictionary";
2349    type Returns = GetSpellCheckCustomDictionaryReturns;
2350}
2351
2352/// Returns present frame tree structure.
2353///
2354/// Parameters of `Page.getFrameTree`.
2355#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2356pub struct GetFrameTreeParams {}
2357
2358/// What `Page.getFrameTree` answers with.
2359#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2360pub struct GetFrameTreeReturns {
2361    /// Present frame tree structure.
2362    #[serde(rename = "frameTree")]
2363    pub frame_tree: FrameTree,
2364}
2365
2366impl crate::typed::Command for GetFrameTreeParams {
2367    const METHOD: &'static str = "Page.getFrameTree";
2368    type Returns = GetFrameTreeReturns;
2369}
2370
2371/// Returns metrics relating to the layouting of the page, such as viewport
2372/// bounds/scale.
2373///
2374/// Parameters of `Page.getLayoutMetrics`.
2375#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2376pub struct GetLayoutMetricsParams {}
2377
2378/// What `Page.getLayoutMetrics` answers with.
2379#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2380pub struct GetLayoutMetricsReturns {
2381    /// Deprecated metrics relating to the layout viewport. Is in device pixels.
2382    /// Use `cssLayoutViewport` instead.
2383    ///
2384    /// Deprecated in the protocol.
2385    #[serde(rename = "layoutViewport")]
2386    pub layout_viewport: LayoutViewport,
2387    /// Deprecated metrics relating to the visual viewport. Is in device pixels.
2388    /// Use `cssVisualViewport` instead.
2389    ///
2390    /// Deprecated in the protocol.
2391    #[serde(rename = "visualViewport")]
2392    pub visual_viewport: VisualViewport,
2393    /// Deprecated size of scrollable area. Is in DP. Use `cssContentSize`
2394    /// instead.
2395    ///
2396    /// Deprecated in the protocol.
2397    #[serde(rename = "contentSize")]
2398    pub content_size: crate::protocol::dom::Rect,
2399    /// Metrics relating to the layout viewport in CSS pixels.
2400    #[serde(rename = "cssLayoutViewport")]
2401    pub css_layout_viewport: LayoutViewport,
2402    /// Metrics relating to the visual viewport in CSS pixels.
2403    #[serde(rename = "cssVisualViewport")]
2404    pub css_visual_viewport: VisualViewport,
2405    /// Size of scrollable area in CSS pixels.
2406    #[serde(rename = "cssContentSize")]
2407    pub css_content_size: crate::protocol::dom::Rect,
2408}
2409
2410impl crate::typed::Command for GetLayoutMetricsParams {
2411    const METHOD: &'static str = "Page.getLayoutMetrics";
2412    type Returns = GetLayoutMetricsReturns;
2413}
2414
2415/// Returns navigation history for the current page.
2416///
2417/// Parameters of `Page.getNavigationHistory`.
2418#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2419pub struct GetNavigationHistoryParams {}
2420
2421/// What `Page.getNavigationHistory` answers with.
2422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2423pub struct GetNavigationHistoryReturns {
2424    /// Index of the current navigation history entry.
2425    #[serde(rename = "currentIndex")]
2426    pub current_index: i64,
2427    /// Array of navigation history entries.
2428    pub entries: Vec<NavigationEntry>,
2429}
2430
2431impl crate::typed::Command for GetNavigationHistoryParams {
2432    const METHOD: &'static str = "Page.getNavigationHistory";
2433    type Returns = GetNavigationHistoryReturns;
2434}
2435
2436/// Resets navigation history for the current page.
2437///
2438/// Parameters of `Page.resetNavigationHistory`.
2439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2440pub struct ResetNavigationHistoryParams {}
2441
2442impl crate::typed::Command for ResetNavigationHistoryParams {
2443    const METHOD: &'static str = "Page.resetNavigationHistory";
2444    type Returns = crate::typed::NoReturns;
2445}
2446
2447/// Returns content of the given resource.
2448///
2449/// Experimental: may change without notice.
2450///
2451/// Parameters of `Page.getResourceContent`.
2452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2453pub struct GetResourceContentParams {
2454    /// Frame id to get resource for.
2455    #[serde(rename = "frameId")]
2456    pub frame_id: FrameId,
2457    /// URL of the resource to get content for.
2458    pub url: String,
2459}
2460
2461/// What `Page.getResourceContent` answers with.
2462#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2463pub struct GetResourceContentReturns {
2464    /// Resource content.
2465    pub content: String,
2466    /// True, if content was served as base64.
2467    #[serde(rename = "base64Encoded")]
2468    pub base64_encoded: bool,
2469}
2470
2471impl crate::typed::Command for GetResourceContentParams {
2472    const METHOD: &'static str = "Page.getResourceContent";
2473    type Returns = GetResourceContentReturns;
2474}
2475
2476/// Returns present frame / resource tree structure.
2477///
2478/// Experimental: may change without notice.
2479///
2480/// Parameters of `Page.getResourceTree`.
2481#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2482pub struct GetResourceTreeParams {}
2483
2484/// What `Page.getResourceTree` answers with.
2485#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2486pub struct GetResourceTreeReturns {
2487    /// Present frame / resource tree structure.
2488    #[serde(rename = "frameTree")]
2489    pub frame_tree: FrameResourceTree,
2490}
2491
2492impl crate::typed::Command for GetResourceTreeParams {
2493    const METHOD: &'static str = "Page.getResourceTree";
2494    type Returns = GetResourceTreeReturns;
2495}
2496
2497/// Accepts or dismisses a JavaScript initiated dialog (alert, confirm,
2498/// prompt, or onbeforeunload).
2499///
2500/// Parameters of `Page.handleJavaScriptDialog`.
2501#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2502pub struct HandleJavaScriptDialogParams {
2503    /// Whether to accept or dismiss the dialog.
2504    pub accept: bool,
2505    /// The text to enter into the dialog prompt before accepting. Used only if
2506    /// this is a prompt dialog.
2507    #[serde(
2508        rename = "promptText",
2509        default,
2510        skip_serializing_if = "Option::is_none"
2511    )]
2512    pub prompt_text: Option<String>,
2513}
2514
2515impl crate::typed::Command for HandleJavaScriptDialogParams {
2516    const METHOD: &'static str = "Page.handleJavaScriptDialog";
2517    type Returns = crate::typed::NoReturns;
2518}
2519
2520/// Navigates current page to the given URL.
2521///
2522/// Parameters of `Page.navigate`.
2523#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2524pub struct NavigateParams {
2525    /// URL to navigate the page to.
2526    pub url: String,
2527    /// Referrer URL.
2528    #[serde(default, skip_serializing_if = "Option::is_none")]
2529    pub referrer: Option<String>,
2530    /// Intended transition type.
2531    #[serde(
2532        rename = "transitionType",
2533        default,
2534        skip_serializing_if = "Option::is_none"
2535    )]
2536    pub transition_type: Option<TransitionType>,
2537    /// Frame id to navigate, if not specified navigates the top frame.
2538    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
2539    pub frame_id: Option<FrameId>,
2540    /// Referrer-policy used for the navigation.
2541    ///
2542    /// Experimental: may change without notice.
2543    #[serde(
2544        rename = "referrerPolicy",
2545        default,
2546        skip_serializing_if = "Option::is_none"
2547    )]
2548    pub referrer_policy: Option<ReferrerPolicy>,
2549}
2550
2551/// What `Page.navigate` answers with.
2552#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2553pub struct NavigateReturns {
2554    /// Frame id that has navigated (or failed to navigate)
2555    #[serde(rename = "frameId")]
2556    pub frame_id: FrameId,
2557    /// Loader identifier. This is omitted in case of same-document navigation, as
2558    /// the previously committed loaderId would not change.
2559    #[serde(rename = "loaderId", default, skip_serializing_if = "Option::is_none")]
2560    pub loader_id: Option<crate::protocol::network::LoaderId>,
2561    /// User friendly error message, present if and only if navigation has failed.
2562    #[serde(rename = "errorText", default, skip_serializing_if = "Option::is_none")]
2563    pub error_text: Option<String>,
2564    /// Whether the navigation resulted in a download.
2565    ///
2566    /// Experimental: may change without notice.
2567    #[serde(
2568        rename = "isDownload",
2569        default,
2570        skip_serializing_if = "Option::is_none"
2571    )]
2572    pub is_download: Option<bool>,
2573}
2574
2575impl crate::typed::Command for NavigateParams {
2576    const METHOD: &'static str = "Page.navigate";
2577    type Returns = NavigateReturns;
2578}
2579
2580/// Navigates current page to the given history entry.
2581///
2582/// Parameters of `Page.navigateToHistoryEntry`.
2583#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2584pub struct NavigateToHistoryEntryParams {
2585    /// Unique id of the entry to navigate to.
2586    #[serde(rename = "entryId")]
2587    pub entry_id: i64,
2588}
2589
2590impl crate::typed::Command for NavigateToHistoryEntryParams {
2591    const METHOD: &'static str = "Page.navigateToHistoryEntry";
2592    type Returns = crate::typed::NoReturns;
2593}
2594
2595/// Print page as PDF.
2596///
2597/// Parameters of `Page.printToPDF`.
2598#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2599pub struct PrintToPdfParams {
2600    /// Paper orientation. Defaults to false.
2601    #[serde(default, skip_serializing_if = "Option::is_none")]
2602    pub landscape: Option<bool>,
2603    /// Display header and footer. Defaults to false.
2604    #[serde(
2605        rename = "displayHeaderFooter",
2606        default,
2607        skip_serializing_if = "Option::is_none"
2608    )]
2609    pub display_header_footer: Option<bool>,
2610    /// Print background graphics. Defaults to false.
2611    #[serde(
2612        rename = "printBackground",
2613        default,
2614        skip_serializing_if = "Option::is_none"
2615    )]
2616    pub print_background: Option<bool>,
2617    /// Scale of the webpage rendering. Defaults to 1.
2618    #[serde(default, skip_serializing_if = "Option::is_none")]
2619    pub scale: Option<f64>,
2620    /// Paper width in inches. Defaults to 8.5 inches.
2621    #[serde(
2622        rename = "paperWidth",
2623        default,
2624        skip_serializing_if = "Option::is_none"
2625    )]
2626    pub paper_width: Option<f64>,
2627    /// Paper height in inches. Defaults to 11 inches.
2628    #[serde(
2629        rename = "paperHeight",
2630        default,
2631        skip_serializing_if = "Option::is_none"
2632    )]
2633    pub paper_height: Option<f64>,
2634    /// Top margin in inches. Defaults to 1cm (~0.4 inches).
2635    #[serde(rename = "marginTop", default, skip_serializing_if = "Option::is_none")]
2636    pub margin_top: Option<f64>,
2637    /// Bottom margin in inches. Defaults to 1cm (~0.4 inches).
2638    #[serde(
2639        rename = "marginBottom",
2640        default,
2641        skip_serializing_if = "Option::is_none"
2642    )]
2643    pub margin_bottom: Option<f64>,
2644    /// Left margin in inches. Defaults to 1cm (~0.4 inches).
2645    #[serde(
2646        rename = "marginLeft",
2647        default,
2648        skip_serializing_if = "Option::is_none"
2649    )]
2650    pub margin_left: Option<f64>,
2651    /// Right margin in inches. Defaults to 1cm (~0.4 inches).
2652    #[serde(
2653        rename = "marginRight",
2654        default,
2655        skip_serializing_if = "Option::is_none"
2656    )]
2657    pub margin_right: Option<f64>,
2658    /// Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are printed
2659    /// in the document order, not in the order specified, and no more than once.
2660    /// Defaults to empty string, which implies the entire document is printed.
2661    /// The page numbers are quietly capped to actual page count of the document,
2662    /// and ranges beyond the end of the document are ignored. If this results in
2663    /// no pages to print, an error is reported. It is an error to specify a range
2664    /// with start greater than end.
2665    #[serde(
2666        rename = "pageRanges",
2667        default,
2668        skip_serializing_if = "Option::is_none"
2669    )]
2670    pub page_ranges: Option<String>,
2671    /// HTML template for the print header. Should be valid HTML markup with
2672    /// following classes used to inject printing values into them: - `date`:
2673    /// formatted print date - `title`: document title - `url`: document location
2674    /// - `pageNumber`: current page number - `totalPages`: total pages in the
2675    /// document For example, `\<span class=title\>\</span\>` would generate span
2676    /// containing the title.
2677    #[serde(
2678        rename = "headerTemplate",
2679        default,
2680        skip_serializing_if = "Option::is_none"
2681    )]
2682    pub header_template: Option<String>,
2683    /// HTML template for the print footer. Should use the same format as the
2684    /// `headerTemplate`.
2685    #[serde(
2686        rename = "footerTemplate",
2687        default,
2688        skip_serializing_if = "Option::is_none"
2689    )]
2690    pub footer_template: Option<String>,
2691    /// Whether or not to prefer page size as defined by css. Defaults to false,
2692    /// in which case the content will be scaled to fit the paper size.
2693    #[serde(
2694        rename = "preferCSSPageSize",
2695        default,
2696        skip_serializing_if = "Option::is_none"
2697    )]
2698    pub prefer_css_page_size: Option<bool>,
2699    /// return as stream
2700    ///
2701    /// Experimental: may change without notice.
2702    #[serde(
2703        rename = "transferMode",
2704        default,
2705        skip_serializing_if = "Option::is_none"
2706    )]
2707    pub transfer_mode: Option<PrintToPdfTransferMode>,
2708    /// Whether or not to generate tagged (accessible) PDF. Defaults to embedder
2709    /// choice.
2710    ///
2711    /// Experimental: may change without notice.
2712    #[serde(
2713        rename = "generateTaggedPDF",
2714        default,
2715        skip_serializing_if = "Option::is_none"
2716    )]
2717    pub generate_tagged_pdf: Option<bool>,
2718    /// Whether or not to embed the document outline into the PDF.
2719    ///
2720    /// Experimental: may change without notice.
2721    #[serde(
2722        rename = "generateDocumentOutline",
2723        default,
2724        skip_serializing_if = "Option::is_none"
2725    )]
2726    pub generate_document_outline: Option<bool>,
2727}
2728
2729/// The values `transferMode` accepts on `printToPDF`.
2730#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2731pub enum PrintToPdfTransferMode {
2732    /// `ReturnAsBase64`
2733    ReturnAsBase64,
2734    /// `ReturnAsStream`
2735    ReturnAsStream,
2736    /// A value this vendored schema does not list. Chrome adds values ahead of
2737    /// the published protocol, so an unrecognised one is kept as it arrived
2738    /// rather than failing the payload it came in.
2739    #[serde(untagged)]
2740    Unrecognized(String),
2741}
2742
2743/// What `Page.printToPDF` answers with.
2744#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2745pub struct PrintToPdfReturns {
2746    /// Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded
2747    /// as a base64 string when passed over JSON)
2748    pub data: String,
2749    /// A handle of the stream that holds resulting PDF data.
2750    ///
2751    /// Experimental: may change without notice.
2752    #[serde(default, skip_serializing_if = "Option::is_none")]
2753    pub stream: Option<crate::protocol::io::StreamHandle>,
2754}
2755
2756impl crate::typed::Command for PrintToPdfParams {
2757    const METHOD: &'static str = "Page.printToPDF";
2758    type Returns = PrintToPdfReturns;
2759}
2760
2761/// Reloads given page optionally ignoring the cache.
2762///
2763/// Parameters of `Page.reload`.
2764#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2765pub struct ReloadParams {
2766    /// If true, browser cache is ignored (as if the user pressed Shift+refresh).
2767    #[serde(
2768        rename = "ignoreCache",
2769        default,
2770        skip_serializing_if = "Option::is_none"
2771    )]
2772    pub ignore_cache: Option<bool>,
2773    /// If set, the script will be injected into all frames of the inspected page
2774    /// after reload. Argument will be ignored if reloading dataURL origin.
2775    #[serde(
2776        rename = "scriptToEvaluateOnLoad",
2777        default,
2778        skip_serializing_if = "Option::is_none"
2779    )]
2780    pub script_to_evaluate_on_load: Option<String>,
2781    /// If set, an error will be thrown if the target page's main frame's loader
2782    /// id does not match the provided id. This prevents accidentally reloading an
2783    /// unintended target in case there's a racing navigation.
2784    ///
2785    /// Experimental: may change without notice.
2786    #[serde(rename = "loaderId", default, skip_serializing_if = "Option::is_none")]
2787    pub loader_id: Option<crate::protocol::network::LoaderId>,
2788}
2789
2790impl crate::typed::Command for ReloadParams {
2791    const METHOD: &'static str = "Page.reload";
2792    type Returns = crate::typed::NoReturns;
2793}
2794
2795/// Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
2796///
2797/// Deprecated in the protocol.
2798///
2799/// Experimental: may change without notice.
2800///
2801/// Parameters of `Page.removeScriptToEvaluateOnLoad`.
2802#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2803pub struct RemoveScriptToEvaluateOnLoadParams {
2804    pub identifier: ScriptIdentifier,
2805}
2806
2807impl crate::typed::Command for RemoveScriptToEvaluateOnLoadParams {
2808    const METHOD: &'static str = "Page.removeScriptToEvaluateOnLoad";
2809    type Returns = crate::typed::NoReturns;
2810}
2811
2812/// Removes given script from the list.
2813///
2814/// Parameters of `Page.removeScriptToEvaluateOnNewDocument`.
2815#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2816pub struct RemoveScriptToEvaluateOnNewDocumentParams {
2817    pub identifier: ScriptIdentifier,
2818}
2819
2820impl crate::typed::Command for RemoveScriptToEvaluateOnNewDocumentParams {
2821    const METHOD: &'static str = "Page.removeScriptToEvaluateOnNewDocument";
2822    type Returns = crate::typed::NoReturns;
2823}
2824
2825/// Acknowledges that a screencast frame has been received by the frontend.
2826///
2827/// Experimental: may change without notice.
2828///
2829/// Parameters of `Page.screencastFrameAck`.
2830#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2831pub struct ScreencastFrameAckParams {
2832    /// Frame number.
2833    #[serde(rename = "sessionId")]
2834    pub session_id: i64,
2835}
2836
2837impl crate::typed::Command for ScreencastFrameAckParams {
2838    const METHOD: &'static str = "Page.screencastFrameAck";
2839    type Returns = crate::typed::NoReturns;
2840}
2841
2842/// Searches for given string in resource content.
2843///
2844/// Experimental: may change without notice.
2845///
2846/// Parameters of `Page.searchInResource`.
2847#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2848pub struct SearchInResourceParams {
2849    /// Frame id for resource to search in.
2850    #[serde(rename = "frameId")]
2851    pub frame_id: FrameId,
2852    /// URL of the resource to search in.
2853    pub url: String,
2854    /// String to search for.
2855    pub query: String,
2856    /// If true, search is case sensitive.
2857    #[serde(
2858        rename = "caseSensitive",
2859        default,
2860        skip_serializing_if = "Option::is_none"
2861    )]
2862    pub case_sensitive: Option<bool>,
2863    /// If true, treats string parameter as regex.
2864    #[serde(rename = "isRegex", default, skip_serializing_if = "Option::is_none")]
2865    pub is_regex: Option<bool>,
2866}
2867
2868/// What `Page.searchInResource` answers with.
2869#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2870pub struct SearchInResourceReturns {
2871    /// List of search matches.
2872    pub result: Vec<crate::protocol::debugger::SearchMatch>,
2873}
2874
2875impl crate::typed::Command for SearchInResourceParams {
2876    const METHOD: &'static str = "Page.searchInResource";
2877    type Returns = SearchInResourceReturns;
2878}
2879
2880/// Enable Chrome's experimental ad filter on all sites.
2881///
2882/// Experimental: may change without notice.
2883///
2884/// Parameters of `Page.setAdBlockingEnabled`.
2885#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2886pub struct SetAdBlockingEnabledParams {
2887    /// Whether to block ads.
2888    pub enabled: bool,
2889}
2890
2891impl crate::typed::Command for SetAdBlockingEnabledParams {
2892    const METHOD: &'static str = "Page.setAdBlockingEnabled";
2893    type Returns = crate::typed::NoReturns;
2894}
2895
2896/// Enable page Content Security Policy by-passing.
2897///
2898/// Parameters of `Page.setBypassCSP`.
2899#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2900pub struct SetBypassCspParams {
2901    /// Whether to bypass page CSP.
2902    pub enabled: bool,
2903}
2904
2905impl crate::typed::Command for SetBypassCspParams {
2906    const METHOD: &'static str = "Page.setBypassCSP";
2907    type Returns = crate::typed::NoReturns;
2908}
2909
2910/// Get Permissions Policy state on given frame.
2911///
2912/// Experimental: may change without notice.
2913///
2914/// Parameters of `Page.getPermissionsPolicyState`.
2915#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2916pub struct GetPermissionsPolicyStateParams {
2917    #[serde(rename = "frameId")]
2918    pub frame_id: FrameId,
2919}
2920
2921/// What `Page.getPermissionsPolicyState` answers with.
2922#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2923pub struct GetPermissionsPolicyStateReturns {
2924    pub states: Vec<PermissionsPolicyFeatureState>,
2925}
2926
2927impl crate::typed::Command for GetPermissionsPolicyStateParams {
2928    const METHOD: &'static str = "Page.getPermissionsPolicyState";
2929    type Returns = GetPermissionsPolicyStateReturns;
2930}
2931
2932/// Get Origin Trials on given frame.
2933///
2934/// Experimental: may change without notice.
2935///
2936/// Parameters of `Page.getOriginTrials`.
2937#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2938pub struct GetOriginTrialsParams {
2939    #[serde(rename = "frameId")]
2940    pub frame_id: FrameId,
2941}
2942
2943/// What `Page.getOriginTrials` answers with.
2944#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2945pub struct GetOriginTrialsReturns {
2946    #[serde(rename = "originTrials")]
2947    pub origin_trials: Vec<OriginTrial>,
2948}
2949
2950impl crate::typed::Command for GetOriginTrialsParams {
2951    const METHOD: &'static str = "Page.getOriginTrials";
2952    type Returns = GetOriginTrialsReturns;
2953}
2954
2955/// Overrides the values of device screen dimensions (window.screen.width,
2956/// window.screen.height, window.innerWidth, window.innerHeight, and
2957/// "device-width"/"device-height"-related CSS media query results).
2958///
2959/// Deprecated in the protocol.
2960///
2961/// Experimental: may change without notice.
2962///
2963/// Parameters of `Page.setDeviceMetricsOverride`.
2964#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2965pub struct SetDeviceMetricsOverrideParams {
2966    /// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables
2967    /// the override.
2968    pub width: i64,
2969    /// Overriding height value in pixels (minimum 0, maximum 10000000). 0
2970    /// disables the override.
2971    pub height: i64,
2972    /// Overriding device scale factor value. 0 disables the override.
2973    #[serde(rename = "deviceScaleFactor")]
2974    pub device_scale_factor: f64,
2975    /// Whether to emulate mobile device. This includes viewport meta tag, overlay
2976    /// scrollbars, text autosizing and more.
2977    pub mobile: bool,
2978    /// Scale to apply to resulting view image.
2979    #[serde(default, skip_serializing_if = "Option::is_none")]
2980    pub scale: Option<f64>,
2981    /// Overriding screen width value in pixels (minimum 0, maximum 10000000).
2982    #[serde(
2983        rename = "screenWidth",
2984        default,
2985        skip_serializing_if = "Option::is_none"
2986    )]
2987    pub screen_width: Option<i64>,
2988    /// Overriding screen height value in pixels (minimum 0, maximum 10000000).
2989    #[serde(
2990        rename = "screenHeight",
2991        default,
2992        skip_serializing_if = "Option::is_none"
2993    )]
2994    pub screen_height: Option<i64>,
2995    /// Overriding view X position on screen in pixels (minimum 0, maximum
2996    /// 10000000).
2997    #[serde(rename = "positionX", default, skip_serializing_if = "Option::is_none")]
2998    pub position_x: Option<i64>,
2999    /// Overriding view Y position on screen in pixels (minimum 0, maximum
3000    /// 10000000).
3001    #[serde(rename = "positionY", default, skip_serializing_if = "Option::is_none")]
3002    pub position_y: Option<i64>,
3003    /// Do not set visible view size, rely upon explicit setVisibleSize call.
3004    #[serde(
3005        rename = "dontSetVisibleSize",
3006        default,
3007        skip_serializing_if = "Option::is_none"
3008    )]
3009    pub dont_set_visible_size: Option<bool>,
3010    /// Screen orientation override.
3011    #[serde(
3012        rename = "screenOrientation",
3013        default,
3014        skip_serializing_if = "Option::is_none"
3015    )]
3016    pub screen_orientation: Option<crate::protocol::emulation::ScreenOrientation>,
3017    /// The viewport dimensions and scale. If not set, the override is cleared.
3018    #[serde(default, skip_serializing_if = "Option::is_none")]
3019    pub viewport: Option<Viewport>,
3020}
3021
3022impl crate::typed::Command for SetDeviceMetricsOverrideParams {
3023    const METHOD: &'static str = "Page.setDeviceMetricsOverride";
3024    type Returns = crate::typed::NoReturns;
3025}
3026
3027/// Overrides the Device Orientation.
3028///
3029/// Deprecated in the protocol.
3030///
3031/// Experimental: may change without notice.
3032///
3033/// Parameters of `Page.setDeviceOrientationOverride`.
3034#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3035pub struct SetDeviceOrientationOverrideParams {
3036    /// Mock alpha
3037    pub alpha: f64,
3038    /// Mock beta
3039    pub beta: f64,
3040    /// Mock gamma
3041    pub gamma: f64,
3042}
3043
3044impl crate::typed::Command for SetDeviceOrientationOverrideParams {
3045    const METHOD: &'static str = "Page.setDeviceOrientationOverride";
3046    type Returns = crate::typed::NoReturns;
3047}
3048
3049/// Set generic font families.
3050///
3051/// Experimental: may change without notice.
3052///
3053/// Parameters of `Page.setFontFamilies`.
3054#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3055pub struct SetFontFamiliesParams {
3056    /// Specifies font families to set. If a font family is not specified, it
3057    /// won't be changed.
3058    #[serde(rename = "fontFamilies")]
3059    pub font_families: FontFamilies,
3060    /// Specifies font families to set for individual scripts.
3061    #[serde(
3062        rename = "forScripts",
3063        default,
3064        skip_serializing_if = "Option::is_none"
3065    )]
3066    pub for_scripts: Option<Vec<ScriptFontFamilies>>,
3067}
3068
3069impl crate::typed::Command for SetFontFamiliesParams {
3070    const METHOD: &'static str = "Page.setFontFamilies";
3071    type Returns = crate::typed::NoReturns;
3072}
3073
3074/// Set default font sizes.
3075///
3076/// Experimental: may change without notice.
3077///
3078/// Parameters of `Page.setFontSizes`.
3079#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3080pub struct SetFontSizesParams {
3081    /// Specifies font sizes to set. If a font size is not specified, it won't be
3082    /// changed.
3083    #[serde(rename = "fontSizes")]
3084    pub font_sizes: FontSizes,
3085}
3086
3087impl crate::typed::Command for SetFontSizesParams {
3088    const METHOD: &'static str = "Page.setFontSizes";
3089    type Returns = crate::typed::NoReturns;
3090}
3091
3092/// Sets given markup as the document's HTML.
3093///
3094/// Parameters of `Page.setDocumentContent`.
3095#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3096pub struct SetDocumentContentParams {
3097    /// Frame id to set HTML for.
3098    #[serde(rename = "frameId")]
3099    pub frame_id: FrameId,
3100    /// HTML content to set.
3101    pub html: String,
3102}
3103
3104impl crate::typed::Command for SetDocumentContentParams {
3105    const METHOD: &'static str = "Page.setDocumentContent";
3106    type Returns = crate::typed::NoReturns;
3107}
3108
3109/// Set the behavior when downloading a file.
3110///
3111/// Deprecated in the protocol.
3112///
3113/// Experimental: may change without notice.
3114///
3115/// Parameters of `Page.setDownloadBehavior`.
3116#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3117pub struct SetDownloadBehaviorParams {
3118    /// Whether to allow all or deny all download requests, or use default Chrome
3119    /// behavior if available (otherwise deny).
3120    pub behavior: SetDownloadBehaviorBehavior,
3121    /// The default path to save downloaded files to. This is required if behavior
3122    /// is set to 'allow'
3123    #[serde(
3124        rename = "downloadPath",
3125        default,
3126        skip_serializing_if = "Option::is_none"
3127    )]
3128    pub download_path: Option<String>,
3129}
3130
3131/// The values `behavior` accepts on `setDownloadBehavior`.
3132#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3133pub enum SetDownloadBehaviorBehavior {
3134    /// `deny`
3135    #[serde(rename = "deny")]
3136    Deny,
3137    /// `allow`
3138    #[serde(rename = "allow")]
3139    Allow,
3140    /// `default`
3141    #[serde(rename = "default")]
3142    Default,
3143    /// A value this vendored schema does not list. Chrome adds values ahead of
3144    /// the published protocol, so an unrecognised one is kept as it arrived
3145    /// rather than failing the payload it came in.
3146    #[serde(untagged)]
3147    Unrecognized(String),
3148}
3149
3150impl crate::typed::Command for SetDownloadBehaviorParams {
3151    const METHOD: &'static str = "Page.setDownloadBehavior";
3152    type Returns = crate::typed::NoReturns;
3153}
3154
3155/// Overrides the Geolocation Position or Error. Omitting any of the
3156/// parameters emulates position unavailable.
3157///
3158/// Deprecated in the protocol.
3159///
3160/// Parameters of `Page.setGeolocationOverride`.
3161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3162pub struct SetGeolocationOverrideParams {
3163    /// Mock latitude
3164    #[serde(default, skip_serializing_if = "Option::is_none")]
3165    pub latitude: Option<f64>,
3166    /// Mock longitude
3167    #[serde(default, skip_serializing_if = "Option::is_none")]
3168    pub longitude: Option<f64>,
3169    /// Mock accuracy
3170    #[serde(default, skip_serializing_if = "Option::is_none")]
3171    pub accuracy: Option<f64>,
3172}
3173
3174impl crate::typed::Command for SetGeolocationOverrideParams {
3175    const METHOD: &'static str = "Page.setGeolocationOverride";
3176    type Returns = crate::typed::NoReturns;
3177}
3178
3179/// Controls whether page will emit lifecycle events.
3180///
3181/// Parameters of `Page.setLifecycleEventsEnabled`.
3182#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3183pub struct SetLifecycleEventsEnabledParams {
3184    /// If true, starts emitting lifecycle events.
3185    pub enabled: bool,
3186}
3187
3188impl crate::typed::Command for SetLifecycleEventsEnabledParams {
3189    const METHOD: &'static str = "Page.setLifecycleEventsEnabled";
3190    type Returns = crate::typed::NoReturns;
3191}
3192
3193/// Toggles mouse event-based touch event emulation.
3194///
3195/// Deprecated in the protocol.
3196///
3197/// Experimental: may change without notice.
3198///
3199/// Parameters of `Page.setTouchEmulationEnabled`.
3200#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3201pub struct SetTouchEmulationEnabledParams {
3202    /// Whether the touch event emulation should be enabled.
3203    pub enabled: bool,
3204    /// Touch/gesture events configuration. Default: current platform.
3205    #[serde(default, skip_serializing_if = "Option::is_none")]
3206    pub configuration: Option<SetTouchEmulationEnabledConfiguration>,
3207}
3208
3209/// The values `configuration` accepts on `setTouchEmulationEnabled`.
3210#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3211pub enum SetTouchEmulationEnabledConfiguration {
3212    /// `mobile`
3213    #[serde(rename = "mobile")]
3214    Mobile,
3215    /// `desktop`
3216    #[serde(rename = "desktop")]
3217    Desktop,
3218    /// A value this vendored schema does not list. Chrome adds values ahead of
3219    /// the published protocol, so an unrecognised one is kept as it arrived
3220    /// rather than failing the payload it came in.
3221    #[serde(untagged)]
3222    Unrecognized(String),
3223}
3224
3225impl crate::typed::Command for SetTouchEmulationEnabledParams {
3226    const METHOD: &'static str = "Page.setTouchEmulationEnabled";
3227    type Returns = crate::typed::NoReturns;
3228}
3229
3230/// Starts sending each frame using the `screencastFrame` event.
3231///
3232/// Experimental: may change without notice.
3233///
3234/// Parameters of `Page.startScreencast`.
3235#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3236pub struct StartScreencastParams {
3237    /// Image compression format.
3238    #[serde(default, skip_serializing_if = "Option::is_none")]
3239    pub format: Option<StartScreencastFormat>,
3240    /// Compression quality from range \[0..100\].
3241    #[serde(default, skip_serializing_if = "Option::is_none")]
3242    pub quality: Option<i64>,
3243    /// Maximum screenshot width.
3244    #[serde(rename = "maxWidth", default, skip_serializing_if = "Option::is_none")]
3245    pub max_width: Option<i64>,
3246    /// Maximum screenshot height.
3247    #[serde(rename = "maxHeight", default, skip_serializing_if = "Option::is_none")]
3248    pub max_height: Option<i64>,
3249    /// Send every n-th frame. Must be a positive integer.
3250    #[serde(
3251        rename = "everyNthFrame",
3252        default,
3253        skip_serializing_if = "Option::is_none"
3254    )]
3255    pub every_nth_frame: Option<i64>,
3256    /// Maximum number of frames sent until screencastFrameAck is required.
3257    /// Defaults to 3. Must be a positive integer.
3258    #[serde(
3259        rename = "maxFramesInFlight",
3260        default,
3261        skip_serializing_if = "Option::is_none"
3262    )]
3263    pub max_frames_in_flight: Option<i64>,
3264    /// By default, after screencastFrameAck arrives, the next produced frame is
3265    /// sent. Passing this flag enables storing the last produced frame in memory,
3266    /// which is immediately sent upon screencastFrameAck. This way, overall
3267    /// performance is traded for a better latency.
3268    #[serde(
3269        rename = "sendLastFrame",
3270        default,
3271        skip_serializing_if = "Option::is_none"
3272    )]
3273    pub send_last_frame: Option<bool>,
3274}
3275
3276/// The values `format` accepts on `startScreencast`.
3277#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3278pub enum StartScreencastFormat {
3279    /// `jpeg`
3280    #[serde(rename = "jpeg")]
3281    Jpeg,
3282    /// `png`
3283    #[serde(rename = "png")]
3284    Png,
3285    /// A value this vendored schema does not list. Chrome adds values ahead of
3286    /// the published protocol, so an unrecognised one is kept as it arrived
3287    /// rather than failing the payload it came in.
3288    #[serde(untagged)]
3289    Unrecognized(String),
3290}
3291
3292impl crate::typed::Command for StartScreencastParams {
3293    const METHOD: &'static str = "Page.startScreencast";
3294    type Returns = crate::typed::NoReturns;
3295}
3296
3297/// Starts screencast video recording.
3298///
3299/// Experimental: may change without notice.
3300///
3301/// Parameters of `Page.startScreenRecording`.
3302#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3303pub struct StartScreenRecordingParams {
3304    #[serde(default, skip_serializing_if = "Option::is_none")]
3305    pub audio: Option<bool>,
3306    /// Maximum frame width in pixels.
3307    #[serde(rename = "maxWidth", default, skip_serializing_if = "Option::is_none")]
3308    pub max_width: Option<i64>,
3309    /// Maximum frame height in pixels.
3310    #[serde(rename = "maxHeight", default, skip_serializing_if = "Option::is_none")]
3311    pub max_height: Option<i64>,
3312    /// Maximum frame rate in frames per second.
3313    #[serde(rename = "frameRate", default, skip_serializing_if = "Option::is_none")]
3314    pub frame_rate: Option<i64>,
3315    /// The area to record. Defaults to `target`.
3316    ///
3317    /// Experimental: may change without notice.
3318    #[serde(
3319        rename = "captureArea",
3320        default,
3321        skip_serializing_if = "Option::is_none"
3322    )]
3323    pub capture_area: Option<StartScreenRecordingCaptureArea>,
3324}
3325
3326/// The values `captureArea` accepts on `startScreenRecording`.
3327#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3328pub enum StartScreenRecordingCaptureArea {
3329    /// `target`
3330    #[serde(rename = "target")]
3331    Target,
3332    /// `browserWindow`
3333    #[serde(rename = "browserWindow")]
3334    BrowserWindow,
3335    /// A value this vendored schema does not list. Chrome adds values ahead of
3336    /// the published protocol, so an unrecognised one is kept as it arrived
3337    /// rather than failing the payload it came in.
3338    #[serde(untagged)]
3339    Unrecognized(String),
3340}
3341
3342/// What `Page.startScreenRecording` answers with.
3343#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3344pub struct StartScreenRecordingReturns {
3345    /// A handle of the stream that holds resulting screencast data.
3346    ///
3347    /// Experimental: may change without notice.
3348    pub stream: crate::protocol::io::StreamHandle,
3349}
3350
3351impl crate::typed::Command for StartScreenRecordingParams {
3352    const METHOD: &'static str = "Page.startScreenRecording";
3353    type Returns = StartScreenRecordingReturns;
3354}
3355
3356/// Stops screencast video recording.
3357///
3358/// Experimental: may change without notice.
3359///
3360/// Parameters of `Page.stopScreenRecording`.
3361#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3362pub struct StopScreenRecordingParams {}
3363
3364/// What `Page.stopScreenRecording` answers with.
3365#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3366pub struct StopScreenRecordingReturns {
3367    /// A handle of the stream that holds resulting screencast data.
3368    ///
3369    /// Experimental: may change without notice.
3370    pub stream: crate::protocol::io::StreamHandle,
3371}
3372
3373impl crate::typed::Command for StopScreenRecordingParams {
3374    const METHOD: &'static str = "Page.stopScreenRecording";
3375    type Returns = StopScreenRecordingReturns;
3376}
3377
3378/// Force the page stop all navigations and pending resource fetches.
3379///
3380/// Parameters of `Page.stopLoading`.
3381#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3382pub struct StopLoadingParams {}
3383
3384impl crate::typed::Command for StopLoadingParams {
3385    const METHOD: &'static str = "Page.stopLoading";
3386    type Returns = crate::typed::NoReturns;
3387}
3388
3389/// Crashes renderer on the IO thread, generates minidumps.
3390///
3391/// Experimental: may change without notice.
3392///
3393/// Parameters of `Page.crash`.
3394#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3395pub struct CrashParams {}
3396
3397impl crate::typed::Command for CrashParams {
3398    const METHOD: &'static str = "Page.crash";
3399    type Returns = crate::typed::NoReturns;
3400}
3401
3402/// Tries to close page, running its beforeunload hooks, if any.
3403///
3404/// Parameters of `Page.close`.
3405#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3406pub struct CloseParams {}
3407
3408impl crate::typed::Command for CloseParams {
3409    const METHOD: &'static str = "Page.close";
3410    type Returns = crate::typed::NoReturns;
3411}
3412
3413/// Tries to update the web lifecycle state of the page. It will transition
3414/// the page to the given state according to:
3415/// <https://github.com/WICG/web-lifecycle/>
3416///
3417/// Experimental: may change without notice.
3418///
3419/// Parameters of `Page.setWebLifecycleState`.
3420#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3421pub struct SetWebLifecycleStateParams {
3422    /// Target lifecycle state
3423    pub state: SetWebLifecycleStateState,
3424}
3425
3426/// The values `state` accepts on `setWebLifecycleState`.
3427#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3428pub enum SetWebLifecycleStateState {
3429    /// `frozen`
3430    #[serde(rename = "frozen")]
3431    Frozen,
3432    /// `active`
3433    #[serde(rename = "active")]
3434    Active,
3435    /// A value this vendored schema does not list. Chrome adds values ahead of
3436    /// the published protocol, so an unrecognised one is kept as it arrived
3437    /// rather than failing the payload it came in.
3438    #[serde(untagged)]
3439    Unrecognized(String),
3440}
3441
3442impl crate::typed::Command for SetWebLifecycleStateParams {
3443    const METHOD: &'static str = "Page.setWebLifecycleState";
3444    type Returns = crate::typed::NoReturns;
3445}
3446
3447/// Stops sending each frame in the `screencastFrame`.
3448///
3449/// Experimental: may change without notice.
3450///
3451/// Parameters of `Page.stopScreencast`.
3452#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3453pub struct StopScreencastParams {}
3454
3455impl crate::typed::Command for StopScreencastParams {
3456    const METHOD: &'static str = "Page.stopScreencast";
3457    type Returns = crate::typed::NoReturns;
3458}
3459
3460/// Requests backend to produce compilation cache for the specified scripts.
3461/// `scripts` are appended to the list of scripts for which the cache would be
3462/// produced. The list may be reset during page navigation. When script with a
3463/// matching URL is encountered, the cache is optionally produced upon backend
3464/// discretion, based on internal heuristics. See also:
3465/// `Page.compilationCacheProduced`.
3466///
3467/// Experimental: may change without notice.
3468///
3469/// Parameters of `Page.produceCompilationCache`.
3470#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3471pub struct ProduceCompilationCacheParams {
3472    pub scripts: Vec<CompilationCacheParams>,
3473}
3474
3475impl crate::typed::Command for ProduceCompilationCacheParams {
3476    const METHOD: &'static str = "Page.produceCompilationCache";
3477    type Returns = crate::typed::NoReturns;
3478}
3479
3480/// Seeds compilation cache for given url. Compilation cache does not survive
3481/// cross-process navigation.
3482///
3483/// Experimental: may change without notice.
3484///
3485/// Parameters of `Page.addCompilationCache`.
3486#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3487pub struct AddCompilationCacheParams {
3488    pub url: String,
3489    /// Base64-encoded data (Encoded as a base64 string when passed over JSON)
3490    pub data: String,
3491}
3492
3493impl crate::typed::Command for AddCompilationCacheParams {
3494    const METHOD: &'static str = "Page.addCompilationCache";
3495    type Returns = crate::typed::NoReturns;
3496}
3497
3498/// Clears seeded compilation cache.
3499///
3500/// Experimental: may change without notice.
3501///
3502/// Parameters of `Page.clearCompilationCache`.
3503#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3504pub struct ClearCompilationCacheParams {}
3505
3506impl crate::typed::Command for ClearCompilationCacheParams {
3507    const METHOD: &'static str = "Page.clearCompilationCache";
3508    type Returns = crate::typed::NoReturns;
3509}
3510
3511/// Sets the Secure Payment Confirmation transaction mode.
3512/// <https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode>
3513///
3514/// Experimental: may change without notice.
3515///
3516/// Parameters of `Page.setSPCTransactionMode`.
3517#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3518pub struct SetSpcTransactionModeParams {
3519    pub mode: SetSpcTransactionModeMode,
3520}
3521
3522/// The values `mode` accepts on `setSPCTransactionMode`.
3523#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3524pub enum SetSpcTransactionModeMode {
3525    /// `none`
3526    #[serde(rename = "none")]
3527    None,
3528    /// `autoAccept`
3529    #[serde(rename = "autoAccept")]
3530    AutoAccept,
3531    /// `autoChooseToAuthAnotherWay`
3532    #[serde(rename = "autoChooseToAuthAnotherWay")]
3533    AutoChooseToAuthAnotherWay,
3534    /// `autoReject`
3535    #[serde(rename = "autoReject")]
3536    AutoReject,
3537    /// `autoOptOut`
3538    #[serde(rename = "autoOptOut")]
3539    AutoOptOut,
3540    /// A value this vendored schema does not list. Chrome adds values ahead of
3541    /// the published protocol, so an unrecognised one is kept as it arrived
3542    /// rather than failing the payload it came in.
3543    #[serde(untagged)]
3544    Unrecognized(String),
3545}
3546
3547impl crate::typed::Command for SetSpcTransactionModeParams {
3548    const METHOD: &'static str = "Page.setSPCTransactionMode";
3549    type Returns = crate::typed::NoReturns;
3550}
3551
3552/// Extensions for Custom Handlers API:
3553/// <https://html.spec.whatwg.org/multipage/system-state.html#rph-automation>
3554///
3555/// Experimental: may change without notice.
3556///
3557/// Parameters of `Page.setRPHRegistrationMode`.
3558#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3559pub struct SetRphRegistrationModeParams {
3560    pub mode: SetRphRegistrationModeMode,
3561}
3562
3563/// The values `mode` accepts on `setRPHRegistrationMode`.
3564#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3565pub enum SetRphRegistrationModeMode {
3566    /// `none`
3567    #[serde(rename = "none")]
3568    None,
3569    /// `autoAccept`
3570    #[serde(rename = "autoAccept")]
3571    AutoAccept,
3572    /// `autoReject`
3573    #[serde(rename = "autoReject")]
3574    AutoReject,
3575    /// A value this vendored schema does not list. Chrome adds values ahead of
3576    /// the published protocol, so an unrecognised one is kept as it arrived
3577    /// rather than failing the payload it came in.
3578    #[serde(untagged)]
3579    Unrecognized(String),
3580}
3581
3582impl crate::typed::Command for SetRphRegistrationModeParams {
3583    const METHOD: &'static str = "Page.setRPHRegistrationMode";
3584    type Returns = crate::typed::NoReturns;
3585}
3586
3587/// Generates a report for testing.
3588///
3589/// Experimental: may change without notice.
3590///
3591/// Parameters of `Page.generateTestReport`.
3592#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3593pub struct GenerateTestReportParams {
3594    /// Message to be displayed in the report.
3595    pub message: String,
3596    /// Specifies the endpoint group to deliver the report to.
3597    #[serde(default, skip_serializing_if = "Option::is_none")]
3598    pub group: Option<String>,
3599}
3600
3601impl crate::typed::Command for GenerateTestReportParams {
3602    const METHOD: &'static str = "Page.generateTestReport";
3603    type Returns = crate::typed::NoReturns;
3604}
3605
3606/// Pauses page execution. Can be resumed using generic
3607/// Runtime.runIfWaitingForDebugger.
3608///
3609/// Experimental: may change without notice.
3610///
3611/// Parameters of `Page.waitForDebugger`.
3612#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3613pub struct WaitForDebuggerParams {}
3614
3615impl crate::typed::Command for WaitForDebuggerParams {
3616    const METHOD: &'static str = "Page.waitForDebugger";
3617    type Returns = crate::typed::NoReturns;
3618}
3619
3620/// Intercept file chooser requests and transfer control to protocol clients.
3621/// When file chooser interception is enabled, native file chooser dialog is
3622/// not shown. Instead, a protocol event `Page.fileChooserOpened` is emitted.
3623///
3624/// Parameters of `Page.setInterceptFileChooserDialog`.
3625#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3626pub struct SetInterceptFileChooserDialogParams {
3627    pub enabled: bool,
3628    /// If true, cancels the dialog by emitting relevant events (if any) in
3629    /// addition to not showing it if the interception is enabled (default:
3630    /// false).
3631    ///
3632    /// Experimental: may change without notice.
3633    #[serde(default, skip_serializing_if = "Option::is_none")]
3634    pub cancel: Option<bool>,
3635}
3636
3637impl crate::typed::Command for SetInterceptFileChooserDialogParams {
3638    const METHOD: &'static str = "Page.setInterceptFileChooserDialog";
3639    type Returns = crate::typed::NoReturns;
3640}
3641
3642/// Enable/disable prerendering manually. This command is a short-term
3643/// solution for <https://crbug.com/1440085>. See
3644/// <https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA>
3645/// for more details. TODO(<https://crbug.com/1440085>): Remove this once
3646/// Puppeteer supports tab targets.
3647///
3648/// Experimental: may change without notice.
3649///
3650/// Parameters of `Page.setPrerenderingAllowed`.
3651#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3652pub struct SetPrerenderingAllowedParams {
3653    #[serde(rename = "isAllowed")]
3654    pub is_allowed: bool,
3655}
3656
3657impl crate::typed::Command for SetPrerenderingAllowedParams {
3658    const METHOD: &'static str = "Page.setPrerenderingAllowed";
3659    type Returns = crate::typed::NoReturns;
3660}
3661
3662/// Get the annotated page content for the main frame. This is an experimental
3663/// command that is subject to change.
3664///
3665/// Experimental: may change without notice.
3666///
3667/// Parameters of `Page.getAnnotatedPageContent`.
3668#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3669pub struct GetAnnotatedPageContentParams {
3670    /// Whether to include actionable information. Defaults to true.
3671    #[serde(
3672        rename = "includeActionableInformation",
3673        default,
3674        skip_serializing_if = "Option::is_none"
3675    )]
3676    pub include_actionable_information: Option<bool>,
3677}
3678
3679/// What `Page.getAnnotatedPageContent` answers with.
3680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3681pub struct GetAnnotatedPageContentReturns {
3682    /// The annotated page content as a base64 encoded protobuf. The format is
3683    /// defined by the `AnnotatedPageContent` message in
3684    /// components/optimization_guide/proto/features/common_quality_data.proto
3685    /// (Encoded as a base64 string when passed over JSON)
3686    pub content: String,
3687}
3688
3689impl crate::typed::Command for GetAnnotatedPageContentParams {
3690    const METHOD: &'static str = "Page.getAnnotatedPageContent";
3691    type Returns = GetAnnotatedPageContentReturns;
3692}
3693
3694/// Configures input visualization on the page.
3695///
3696/// Experimental: may change without notice.
3697///
3698/// Parameters of `Page.setInputVisualization`.
3699#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3700pub struct SetInputVisualizationParams {
3701    /// Whether to enable click visualization.
3702    #[serde(default, skip_serializing_if = "Option::is_none")]
3703    pub clicks: Option<bool>,
3704}
3705
3706impl crate::typed::Command for SetInputVisualizationParams {
3707    const METHOD: &'static str = "Page.setInputVisualization";
3708    type Returns = crate::typed::NoReturns;
3709}
3710
3711/// Payload of the `Page.domContentEventFired` event.
3712#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3713pub struct DomContentEventFiredEvent {
3714    pub timestamp: crate::protocol::network::MonotonicTime,
3715}
3716
3717impl crate::typed::Event for DomContentEventFiredEvent {
3718    const METHOD: &'static str = "Page.domContentEventFired";
3719}
3720
3721/// Emitted only when `page.interceptFileChooser` is enabled.
3722///
3723/// Payload of the `Page.fileChooserOpened` event.
3724#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3725pub struct FileChooserOpenedEvent {
3726    /// Id of the frame containing input node.
3727    ///
3728    /// Experimental: may change without notice.
3729    #[serde(rename = "frameId")]
3730    pub frame_id: FrameId,
3731    /// Input mode.
3732    pub mode: FileChooserOpenedMode,
3733    /// Input node id. Only present for file choosers opened via an `\<input
3734    /// type="file"\>` element.
3735    ///
3736    /// Experimental: may change without notice.
3737    #[serde(
3738        rename = "backendNodeId",
3739        default,
3740        skip_serializing_if = "Option::is_none"
3741    )]
3742    pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
3743}
3744
3745/// The values `mode` accepts on `fileChooserOpened`.
3746#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3747pub enum FileChooserOpenedMode {
3748    /// `selectSingle`
3749    #[serde(rename = "selectSingle")]
3750    SelectSingle,
3751    /// `selectMultiple`
3752    #[serde(rename = "selectMultiple")]
3753    SelectMultiple,
3754    /// A value this vendored schema does not list. Chrome adds values ahead of
3755    /// the published protocol, so an unrecognised one is kept as it arrived
3756    /// rather than failing the payload it came in.
3757    #[serde(untagged)]
3758    Unrecognized(String),
3759}
3760
3761impl crate::typed::Event for FileChooserOpenedEvent {
3762    const METHOD: &'static str = "Page.fileChooserOpened";
3763}
3764
3765/// Fired when frame has been attached to its parent.
3766///
3767/// Payload of the `Page.frameAttached` event.
3768#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3769pub struct FrameAttachedEvent {
3770    /// Id of the frame that has been attached.
3771    #[serde(rename = "frameId")]
3772    pub frame_id: FrameId,
3773    /// Parent frame identifier.
3774    #[serde(rename = "parentFrameId")]
3775    pub parent_frame_id: FrameId,
3776    /// JavaScript stack trace of when frame was attached, only set if frame
3777    /// initiated from script.
3778    #[serde(default, skip_serializing_if = "Option::is_none")]
3779    pub stack: Option<crate::protocol::runtime::StackTrace>,
3780}
3781
3782impl crate::typed::Event for FrameAttachedEvent {
3783    const METHOD: &'static str = "Page.frameAttached";
3784}
3785
3786/// Fired when frame no longer has a scheduled navigation.
3787///
3788/// Deprecated in the protocol.
3789///
3790/// Payload of the `Page.frameClearedScheduledNavigation` event.
3791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3792pub struct FrameClearedScheduledNavigationEvent {
3793    /// Id of the frame that has cleared its scheduled navigation.
3794    #[serde(rename = "frameId")]
3795    pub frame_id: FrameId,
3796}
3797
3798impl crate::typed::Event for FrameClearedScheduledNavigationEvent {
3799    const METHOD: &'static str = "Page.frameClearedScheduledNavigation";
3800}
3801
3802/// Fired when frame has been detached from its parent.
3803///
3804/// Payload of the `Page.frameDetached` event.
3805#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3806pub struct FrameDetachedEvent {
3807    /// Id of the frame that has been detached.
3808    #[serde(rename = "frameId")]
3809    pub frame_id: FrameId,
3810    /// Experimental: may change without notice.
3811    pub reason: FrameDetachedReason,
3812}
3813
3814/// The values `reason` accepts on `frameDetached`.
3815#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3816pub enum FrameDetachedReason {
3817    /// `remove`
3818    #[serde(rename = "remove")]
3819    Remove,
3820    /// `swap`
3821    #[serde(rename = "swap")]
3822    Swap,
3823    /// A value this vendored schema does not list. Chrome adds values ahead of
3824    /// the published protocol, so an unrecognised one is kept as it arrived
3825    /// rather than failing the payload it came in.
3826    #[serde(untagged)]
3827    Unrecognized(String),
3828}
3829
3830impl crate::typed::Event for FrameDetachedEvent {
3831    const METHOD: &'static str = "Page.frameDetached";
3832}
3833
3834/// Fired before frame subtree is detached. Emitted before any frame of the
3835/// subtree is actually detached.
3836///
3837/// Experimental: may change without notice.
3838///
3839/// Payload of the `Page.frameSubtreeWillBeDetached` event.
3840#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3841pub struct FrameSubtreeWillBeDetachedEvent {
3842    /// Id of the frame that is the root of the subtree that will be detached.
3843    #[serde(rename = "frameId")]
3844    pub frame_id: FrameId,
3845}
3846
3847impl crate::typed::Event for FrameSubtreeWillBeDetachedEvent {
3848    const METHOD: &'static str = "Page.frameSubtreeWillBeDetached";
3849}
3850
3851/// Fired once navigation of the frame has completed. Frame is now associated
3852/// with the new loader.
3853///
3854/// Payload of the `Page.frameNavigated` event.
3855#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3856pub struct FrameNavigatedEvent {
3857    /// Frame object.
3858    pub frame: Frame,
3859    /// Experimental: may change without notice.
3860    pub r#type: NavigationType,
3861}
3862
3863impl crate::typed::Event for FrameNavigatedEvent {
3864    const METHOD: &'static str = "Page.frameNavigated";
3865}
3866
3867/// Fired when opening document to write to.
3868///
3869/// Experimental: may change without notice.
3870///
3871/// Payload of the `Page.documentOpened` event.
3872#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3873pub struct DocumentOpenedEvent {
3874    /// Frame object.
3875    pub frame: Frame,
3876}
3877
3878impl crate::typed::Event for DocumentOpenedEvent {
3879    const METHOD: &'static str = "Page.documentOpened";
3880}
3881
3882/// Experimental: may change without notice.
3883///
3884/// Payload of the `Page.frameResized` event.
3885#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3886pub struct FrameResizedEvent {}
3887
3888impl crate::typed::Event for FrameResizedEvent {
3889    const METHOD: &'static str = "Page.frameResized";
3890}
3891
3892/// Fired when a navigation starts. This event is fired for both
3893/// renderer-initiated and browser-initiated navigations. For
3894/// renderer-initiated navigations, the event is fired after
3895/// `frameRequestedNavigation`. Navigation may still be cancelled after the
3896/// event is issued. Multiple events can be fired for a single navigation, for
3897/// example, when a same-document navigation becomes a cross-document
3898/// navigation (such as in the case of a frameset).
3899///
3900/// Experimental: may change without notice.
3901///
3902/// Payload of the `Page.frameStartedNavigating` event.
3903#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3904pub struct FrameStartedNavigatingEvent {
3905    /// ID of the frame that is being navigated.
3906    #[serde(rename = "frameId")]
3907    pub frame_id: FrameId,
3908    /// The URL the navigation started with. The final URL can be different.
3909    pub url: String,
3910    /// Loader identifier. Even though it is present in case of same-document
3911    /// navigation, the previously committed loaderId would not change unless the
3912    /// navigation changes from a same-document to a cross-document navigation.
3913    #[serde(rename = "loaderId")]
3914    pub loader_id: crate::protocol::network::LoaderId,
3915    #[serde(rename = "navigationType")]
3916    pub navigation_type: FrameStartedNavigatingNavigationType,
3917}
3918
3919/// The values `navigationType` accepts on `frameStartedNavigating`.
3920#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
3921pub enum FrameStartedNavigatingNavigationType {
3922    /// `reload`
3923    #[serde(rename = "reload")]
3924    Reload,
3925    /// `reloadBypassingCache`
3926    #[serde(rename = "reloadBypassingCache")]
3927    ReloadBypassingCache,
3928    /// `restore`
3929    #[serde(rename = "restore")]
3930    Restore,
3931    /// `restoreWithPost`
3932    #[serde(rename = "restoreWithPost")]
3933    RestoreWithPost,
3934    /// `historySameDocument`
3935    #[serde(rename = "historySameDocument")]
3936    HistorySameDocument,
3937    /// `historyDifferentDocument`
3938    #[serde(rename = "historyDifferentDocument")]
3939    HistoryDifferentDocument,
3940    /// `sameDocument`
3941    #[serde(rename = "sameDocument")]
3942    SameDocument,
3943    /// `differentDocument`
3944    #[serde(rename = "differentDocument")]
3945    DifferentDocument,
3946    /// A value this vendored schema does not list. Chrome adds values ahead of
3947    /// the published protocol, so an unrecognised one is kept as it arrived
3948    /// rather than failing the payload it came in.
3949    #[serde(untagged)]
3950    Unrecognized(String),
3951}
3952
3953impl crate::typed::Event for FrameStartedNavigatingEvent {
3954    const METHOD: &'static str = "Page.frameStartedNavigating";
3955}
3956
3957/// Fired when a renderer-initiated navigation is requested. Navigation may
3958/// still be cancelled after the event is issued.
3959///
3960/// Experimental: may change without notice.
3961///
3962/// Payload of the `Page.frameRequestedNavigation` event.
3963#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3964pub struct FrameRequestedNavigationEvent {
3965    /// Id of the frame that is being navigated.
3966    #[serde(rename = "frameId")]
3967    pub frame_id: FrameId,
3968    /// The reason for the navigation.
3969    pub reason: ClientNavigationReason,
3970    /// The destination URL for the requested navigation.
3971    pub url: String,
3972    /// The disposition for the navigation.
3973    pub disposition: ClientNavigationDisposition,
3974}
3975
3976impl crate::typed::Event for FrameRequestedNavigationEvent {
3977    const METHOD: &'static str = "Page.frameRequestedNavigation";
3978}
3979
3980/// Fired when frame schedules a potential navigation.
3981///
3982/// Deprecated in the protocol.
3983///
3984/// Payload of the `Page.frameScheduledNavigation` event.
3985#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3986pub struct FrameScheduledNavigationEvent {
3987    /// Id of the frame that has scheduled a navigation.
3988    #[serde(rename = "frameId")]
3989    pub frame_id: FrameId,
3990    /// Delay (in seconds) until the navigation is scheduled to begin. The
3991    /// navigation is not guaranteed to start.
3992    pub delay: f64,
3993    /// The reason for the navigation.
3994    pub reason: ClientNavigationReason,
3995    /// The destination URL for the scheduled navigation.
3996    pub url: String,
3997}
3998
3999impl crate::typed::Event for FrameScheduledNavigationEvent {
4000    const METHOD: &'static str = "Page.frameScheduledNavigation";
4001}
4002
4003/// Fired when frame has started loading.
4004///
4005/// Experimental: may change without notice.
4006///
4007/// Payload of the `Page.frameStartedLoading` event.
4008#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4009pub struct FrameStartedLoadingEvent {
4010    /// Id of the frame that has started loading.
4011    #[serde(rename = "frameId")]
4012    pub frame_id: FrameId,
4013}
4014
4015impl crate::typed::Event for FrameStartedLoadingEvent {
4016    const METHOD: &'static str = "Page.frameStartedLoading";
4017}
4018
4019/// Fired when frame has stopped loading.
4020///
4021/// Experimental: may change without notice.
4022///
4023/// Payload of the `Page.frameStoppedLoading` event.
4024#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4025pub struct FrameStoppedLoadingEvent {
4026    /// Id of the frame that has stopped loading.
4027    #[serde(rename = "frameId")]
4028    pub frame_id: FrameId,
4029}
4030
4031impl crate::typed::Event for FrameStoppedLoadingEvent {
4032    const METHOD: &'static str = "Page.frameStoppedLoading";
4033}
4034
4035/// Fired when page is about to start a download. Deprecated. Use
4036/// Browser.downloadWillBegin instead.
4037///
4038/// Deprecated in the protocol.
4039///
4040/// Experimental: may change without notice.
4041///
4042/// Payload of the `Page.downloadWillBegin` event.
4043#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4044pub struct DownloadWillBeginEvent {
4045    /// Id of the frame that caused download to begin.
4046    #[serde(rename = "frameId")]
4047    pub frame_id: FrameId,
4048    /// Global unique identifier of the download.
4049    pub guid: String,
4050    /// URL of the resource being downloaded.
4051    pub url: String,
4052    /// Suggested file name of the resource (the actual name of the file saved on
4053    /// disk may differ).
4054    #[serde(rename = "suggestedFilename")]
4055    pub suggested_filename: String,
4056}
4057
4058impl crate::typed::Event for DownloadWillBeginEvent {
4059    const METHOD: &'static str = "Page.downloadWillBegin";
4060}
4061
4062/// Fired when download makes progress. Last call has |done| == true.
4063/// Deprecated. Use Browser.downloadProgress instead.
4064///
4065/// Deprecated in the protocol.
4066///
4067/// Experimental: may change without notice.
4068///
4069/// Payload of the `Page.downloadProgress` event.
4070#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4071pub struct DownloadProgressEvent {
4072    /// Global unique identifier of the download.
4073    pub guid: String,
4074    /// Total expected bytes to download.
4075    #[serde(rename = "totalBytes")]
4076    pub total_bytes: f64,
4077    /// Total bytes received.
4078    #[serde(rename = "receivedBytes")]
4079    pub received_bytes: f64,
4080    /// Download status.
4081    pub state: DownloadProgressState,
4082}
4083
4084/// The values `state` accepts on `downloadProgress`.
4085#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
4086pub enum DownloadProgressState {
4087    /// `inProgress`
4088    #[serde(rename = "inProgress")]
4089    InProgress,
4090    /// `completed`
4091    #[serde(rename = "completed")]
4092    Completed,
4093    /// `canceled`
4094    #[serde(rename = "canceled")]
4095    Canceled,
4096    /// A value this vendored schema does not list. Chrome adds values ahead of
4097    /// the published protocol, so an unrecognised one is kept as it arrived
4098    /// rather than failing the payload it came in.
4099    #[serde(untagged)]
4100    Unrecognized(String),
4101}
4102
4103impl crate::typed::Event for DownloadProgressEvent {
4104    const METHOD: &'static str = "Page.downloadProgress";
4105}
4106
4107/// Fired when interstitial page was hidden
4108///
4109/// Payload of the `Page.interstitialHidden` event.
4110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4111pub struct InterstitialHiddenEvent {}
4112
4113impl crate::typed::Event for InterstitialHiddenEvent {
4114    const METHOD: &'static str = "Page.interstitialHidden";
4115}
4116
4117/// Fired when interstitial page was shown
4118///
4119/// Payload of the `Page.interstitialShown` event.
4120#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4121pub struct InterstitialShownEvent {}
4122
4123impl crate::typed::Event for InterstitialShownEvent {
4124    const METHOD: &'static str = "Page.interstitialShown";
4125}
4126
4127/// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or
4128/// onbeforeunload) has been closed.
4129///
4130/// Payload of the `Page.javascriptDialogClosed` event.
4131#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4132pub struct JavascriptDialogClosedEvent {
4133    /// Frame id.
4134    ///
4135    /// Experimental: may change without notice.
4136    #[serde(rename = "frameId")]
4137    pub frame_id: FrameId,
4138    /// Whether dialog was confirmed.
4139    pub result: bool,
4140    /// User input in case of prompt.
4141    #[serde(rename = "userInput")]
4142    pub user_input: String,
4143}
4144
4145impl crate::typed::Event for JavascriptDialogClosedEvent {
4146    const METHOD: &'static str = "Page.javascriptDialogClosed";
4147}
4148
4149/// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or
4150/// onbeforeunload) is about to open.
4151///
4152/// Payload of the `Page.javascriptDialogOpening` event.
4153#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4154pub struct JavascriptDialogOpeningEvent {
4155    /// Frame url.
4156    pub url: String,
4157    /// Frame id.
4158    ///
4159    /// Experimental: may change without notice.
4160    #[serde(rename = "frameId")]
4161    pub frame_id: FrameId,
4162    /// Message that will be displayed by the dialog.
4163    pub message: String,
4164    /// Dialog type.
4165    pub r#type: DialogType,
4166    /// True iff browser is capable showing or acting on the given dialog. When
4167    /// browser has no dialog handler for given target, calling alert while Page
4168    /// domain is engaged will stall the page execution. Execution can be resumed
4169    /// via calling Page.handleJavaScriptDialog.
4170    #[serde(rename = "hasBrowserHandler")]
4171    pub has_browser_handler: bool,
4172    /// Default dialog prompt.
4173    #[serde(
4174        rename = "defaultPrompt",
4175        default,
4176        skip_serializing_if = "Option::is_none"
4177    )]
4178    pub default_prompt: Option<String>,
4179}
4180
4181impl crate::typed::Event for JavascriptDialogOpeningEvent {
4182    const METHOD: &'static str = "Page.javascriptDialogOpening";
4183}
4184
4185/// Fired for lifecycle events (navigation, load, paint, etc) in the current
4186/// target (including local frames).
4187///
4188/// Payload of the `Page.lifecycleEvent` event.
4189#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4190pub struct LifecycleEventEvent {
4191    /// Id of the frame.
4192    #[serde(rename = "frameId")]
4193    pub frame_id: FrameId,
4194    /// Loader identifier. Empty string if the request is fetched from worker.
4195    #[serde(rename = "loaderId")]
4196    pub loader_id: crate::protocol::network::LoaderId,
4197    pub name: String,
4198    pub timestamp: crate::protocol::network::MonotonicTime,
4199}
4200
4201impl crate::typed::Event for LifecycleEventEvent {
4202    const METHOD: &'static str = "Page.lifecycleEvent";
4203}
4204
4205/// Fired for failed bfcache history navigations if BackForwardCache feature
4206/// is enabled. Do not assume any ordering with the Page.frameNavigated event.
4207/// This event is fired only for main-frame history navigation where the
4208/// document changes (non-same-document navigations), when bfcache navigation
4209/// fails.
4210///
4211/// Experimental: may change without notice.
4212///
4213/// Payload of the `Page.backForwardCacheNotUsed` event.
4214#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4215pub struct BackForwardCacheNotUsedEvent {
4216    /// The loader id for the associated navigation.
4217    #[serde(rename = "loaderId")]
4218    pub loader_id: crate::protocol::network::LoaderId,
4219    /// The frame id of the associated frame.
4220    #[serde(rename = "frameId")]
4221    pub frame_id: FrameId,
4222    /// Array of reasons why the page could not be cached. This must not be empty.
4223    #[serde(rename = "notRestoredExplanations")]
4224    pub not_restored_explanations: Vec<BackForwardCacheNotRestoredExplanation>,
4225    /// Tree structure of reasons why the page could not be cached for each frame.
4226    #[serde(
4227        rename = "notRestoredExplanationsTree",
4228        default,
4229        skip_serializing_if = "Option::is_none"
4230    )]
4231    pub not_restored_explanations_tree: Option<BackForwardCacheNotRestoredExplanationTree>,
4232}
4233
4234impl crate::typed::Event for BackForwardCacheNotUsedEvent {
4235    const METHOD: &'static str = "Page.backForwardCacheNotUsed";
4236}
4237
4238/// Payload of the `Page.loadEventFired` event.
4239#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4240pub struct LoadEventFiredEvent {
4241    pub timestamp: crate::protocol::network::MonotonicTime,
4242}
4243
4244impl crate::typed::Event for LoadEventFiredEvent {
4245    const METHOD: &'static str = "Page.loadEventFired";
4246}
4247
4248/// Fired when same-document navigation happens, e.g. due to history API usage
4249/// or anchor navigation.
4250///
4251/// Experimental: may change without notice.
4252///
4253/// Payload of the `Page.navigatedWithinDocument` event.
4254#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4255pub struct NavigatedWithinDocumentEvent {
4256    /// Id of the frame.
4257    #[serde(rename = "frameId")]
4258    pub frame_id: FrameId,
4259    /// Frame's new url.
4260    pub url: String,
4261    /// Navigation type
4262    #[serde(rename = "navigationType")]
4263    pub navigation_type: NavigatedWithinDocumentNavigationType,
4264}
4265
4266/// The values `navigationType` accepts on `navigatedWithinDocument`.
4267#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
4268pub enum NavigatedWithinDocumentNavigationType {
4269    /// `fragment`
4270    #[serde(rename = "fragment")]
4271    Fragment,
4272    /// `historyApi`
4273    #[serde(rename = "historyApi")]
4274    HistoryApi,
4275    /// `other`
4276    #[serde(rename = "other")]
4277    Other,
4278    /// A value this vendored schema does not list. Chrome adds values ahead of
4279    /// the published protocol, so an unrecognised one is kept as it arrived
4280    /// rather than failing the payload it came in.
4281    #[serde(untagged)]
4282    Unrecognized(String),
4283}
4284
4285impl crate::typed::Event for NavigatedWithinDocumentEvent {
4286    const METHOD: &'static str = "Page.navigatedWithinDocument";
4287}
4288
4289/// Compressed image data requested by the `startScreencast`.
4290///
4291/// Experimental: may change without notice.
4292///
4293/// Payload of the `Page.screencastFrame` event.
4294#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4295pub struct ScreencastFrameEvent {
4296    /// Base64-encoded compressed image. (Encoded as a base64 string when passed
4297    /// over JSON)
4298    pub data: String,
4299    /// Screencast frame metadata.
4300    pub metadata: ScreencastFrameMetadata,
4301    /// Frame number.
4302    #[serde(rename = "sessionId")]
4303    pub session_id: i64,
4304}
4305
4306impl crate::typed::Event for ScreencastFrameEvent {
4307    const METHOD: &'static str = "Page.screencastFrame";
4308}
4309
4310/// Fired when the page with currently enabled screencast was shown or hidden
4311/// `.
4312///
4313/// Experimental: may change without notice.
4314///
4315/// Payload of the `Page.screencastVisibilityChanged` event.
4316#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4317pub struct ScreencastVisibilityChangedEvent {
4318    /// True if the page is visible.
4319    pub visible: bool,
4320}
4321
4322impl crate::typed::Event for ScreencastVisibilityChangedEvent {
4323    const METHOD: &'static str = "Page.screencastVisibilityChanged";
4324}
4325
4326/// Fired when a new window is going to be opened, via window.open(), link
4327/// click, form submission, etc.
4328///
4329/// Payload of the `Page.windowOpen` event.
4330#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4331pub struct WindowOpenEvent {
4332    /// The URL for the new window.
4333    pub url: String,
4334    /// Window name.
4335    #[serde(rename = "windowName")]
4336    pub window_name: String,
4337    /// An array of enabled window features.
4338    #[serde(rename = "windowFeatures")]
4339    pub window_features: Vec<String>,
4340    /// Whether or not it was triggered by user gesture.
4341    #[serde(rename = "userGesture")]
4342    pub user_gesture: bool,
4343}
4344
4345impl crate::typed::Event for WindowOpenEvent {
4346    const METHOD: &'static str = "Page.windowOpen";
4347}
4348
4349/// Issued for every compilation cache generated.
4350///
4351/// Experimental: may change without notice.
4352///
4353/// Payload of the `Page.compilationCacheProduced` event.
4354#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4355pub struct CompilationCacheProducedEvent {
4356    pub url: String,
4357    /// Base64-encoded data (Encoded as a base64 string when passed over JSON)
4358    pub data: String,
4359}
4360
4361impl crate::typed::Event for CompilationCacheProducedEvent {
4362    const METHOD: &'static str = "Page.compilationCacheProduced";
4363}