Skip to main content

browser_protocol/page/
mod.rs

1//! Actions and events related to the inspected page belong to the page domain.
2
3use serde::{Serialize, Deserialize};
4
5/// Unique frame identifier.
6
7pub type FrameId = String;
8
9/// Indicates whether a frame has been identified as an ad.
10
11#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
12pub enum AdFrameType {
13    #[default]
14    None,
15    Child,
16    Root,
17}
18
19
20#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
21pub enum AdFrameExplanation {
22    #[default]
23    ParentIsAd,
24    CreatedByAdScript,
25    MatchedBlockingRule,
26}
27
28/// Indicates whether a frame has been identified as an ad and why.
29
30#[derive(Debug, Clone, Serialize, Deserialize, Default)]
31#[serde(rename_all = "camelCase")]
32pub struct AdFrameStatus {
33
34    pub adFrameType: AdFrameType,
35
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub explanations: Option<Vec<AdFrameExplanation>>,
38}
39
40/// Indicates whether the frame is a secure context and why it is the case.
41
42#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
43pub enum SecureContextType {
44    #[default]
45    Secure,
46    SecureLocalhost,
47    InsecureScheme,
48    InsecureAncestor,
49}
50
51/// Indicates whether the frame is cross-origin isolated and why it is the case.
52
53#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
54pub enum CrossOriginIsolatedContextType {
55    #[default]
56    Isolated,
57    NotIsolated,
58    NotIsolatedFeatureDisabled,
59}
60
61
62#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
63pub enum GatedAPIFeatures {
64    #[default]
65    SharedArrayBuffers,
66    SharedArrayBuffersTransferAllowed,
67    PerformanceMeasureMemory,
68    PerformanceProfile,
69}
70
71/// All Permissions Policy features. This enum should match the one defined
72/// in services/network/public/cpp/permissions_policy/permissions_policy_features.json5.
73/// LINT.IfChange(PermissionsPolicyFeature)
74
75#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
76pub enum PermissionsPolicyFeature {
77    #[default]
78    Accelerometer,
79    AllScreensCapture,
80    AmbientLightSensor,
81    AriaNotify,
82    AttributionReporting,
83    Autofill,
84    Autoplay,
85    Bluetooth,
86    BrowsingTopics,
87    Camera,
88    CapturedSurfaceControl,
89    ChDpr,
90    ChDeviceMemory,
91    ChDownlink,
92    ChEct,
93    ChPrefersColorScheme,
94    ChPrefersReducedMotion,
95    ChPrefersReducedTransparency,
96    ChRtt,
97    ChSaveData,
98    ChUa,
99    ChUaArch,
100    ChUaBitness,
101    ChUaHighEntropyValues,
102    ChUaPlatform,
103    ChUaModel,
104    ChUaMobile,
105    ChUaFormFactors,
106    ChUaFullVersion,
107    ChUaFullVersionList,
108    ChUaPlatformVersion,
109    ChUaWow64,
110    ChViewportHeight,
111    ChViewportWidth,
112    ChWidth,
113    ClipboardRead,
114    ClipboardWrite,
115    ComputePressure,
116    ControlledFrame,
117    CrossOriginIsolated,
118    DeferredFetch,
119    DeferredFetchMinimal,
120    DeviceAttributes,
121    DigitalCredentialsCreate,
122    DigitalCredentialsGet,
123    DirectSockets,
124    DirectSocketsMulticast,
125    DirectSocketsPrivate,
126    DisplayCapture,
127    DocumentDomain,
128    EncryptedMedia,
129    ExecutionWhileOutOfViewport,
130    ExecutionWhileNotRendered,
131    FocusWithoutUserActivation,
132    Fullscreen,
133    Frobulate,
134    Gamepad,
135    Geolocation,
136    Gyroscope,
137    Hid,
138    IdentityCredentialsGet,
139    IdleDetection,
140    InterestCohort,
141    JoinAdInterestGroup,
142    KeyboardMap,
143    LanguageDetector,
144    LanguageModel,
145    LocalFonts,
146    LocalNetwork,
147    LocalNetworkAccess,
148    LoopbackNetwork,
149    Magnetometer,
150    ManualText,
151    MediaPlaybackWhileNotVisible,
152    Microphone,
153    Midi,
154    OnDeviceSpeechRecognition,
155    OtpCredentials,
156    Payment,
157    PictureInPicture,
158    PrivateAggregation,
159    PrivateStateTokenIssuance,
160    PrivateStateTokenRedemption,
161    PublickeyCredentialsCreate,
162    PublickeyCredentialsGet,
163    RecordAdAuctionEvents,
164    Rewriter,
165    RunAdAuction,
166    ScreenWakeLock,
167    Serial,
168    SharedStorage,
169    SharedStorageSelectUrl,
170    SmartCard,
171    SpeakerSelection,
172    StorageAccess,
173    SubApps,
174    Summarizer,
175    SyncXhr,
176    Translator,
177    Unload,
178    Usb,
179    UsbUnrestricted,
180    VerticalScroll,
181    WebAppInstallation,
182    WebPrinting,
183    WebShare,
184    WindowManagement,
185    Writer,
186    XrSpatialTracking,
187}
188
189/// Reason for a permissions policy feature to be disabled.
190
191#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
192pub enum PermissionsPolicyBlockReason {
193    #[default]
194    Header,
195    IframeAttribute,
196    InFencedFrameTree,
197    InIsolatedApp,
198}
199
200
201#[derive(Debug, Clone, Serialize, Deserialize, Default)]
202#[serde(rename_all = "camelCase")]
203pub struct PermissionsPolicyBlockLocator {
204
205    pub frameId: FrameId,
206
207    pub blockReason: PermissionsPolicyBlockReason,
208}
209
210
211#[derive(Debug, Clone, Serialize, Deserialize, Default)]
212#[serde(rename_all = "camelCase")]
213pub struct PermissionsPolicyFeatureState {
214
215    pub feature: PermissionsPolicyFeature,
216
217    pub allowed: bool,
218
219    #[serde(skip_serializing_if = "Option::is_none")]
220    pub locator: Option<PermissionsPolicyBlockLocator>,
221}
222
223/// Origin Trial(<https://www.chromium.org/blink/origin-trials>) support.
224/// Status for an Origin Trial token.
225
226#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
227pub enum OriginTrialTokenStatus {
228    #[default]
229    Success,
230    NotSupported,
231    Insecure,
232    Expired,
233    WrongOrigin,
234    InvalidSignature,
235    Malformed,
236    WrongVersion,
237    FeatureDisabled,
238    TokenDisabled,
239    FeatureDisabledForUser,
240    UnknownTrial,
241}
242
243/// Status for an Origin Trial.
244
245#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
246pub enum OriginTrialStatus {
247    #[default]
248    Enabled,
249    ValidTokenNotProvided,
250    OSNotSupported,
251    TrialNotAllowed,
252}
253
254
255#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
256pub enum OriginTrialUsageRestriction {
257    #[default]
258    None,
259    Subset,
260}
261
262
263#[derive(Debug, Clone, Serialize, Deserialize, Default)]
264#[serde(rename_all = "camelCase")]
265pub struct OriginTrialToken {
266
267    pub origin: String,
268
269    pub matchSubDomains: bool,
270
271    pub trialName: String,
272
273    pub expiryTime: crate::network::TimeSinceEpoch,
274
275    pub isThirdParty: bool,
276
277    pub usageRestriction: OriginTrialUsageRestriction,
278}
279
280
281#[derive(Debug, Clone, Serialize, Deserialize, Default)]
282#[serde(rename_all = "camelCase")]
283pub struct OriginTrialTokenWithStatus {
284
285    pub rawTokenText: String,
286    /// 'parsedToken' is present only when the token is extractable and
287    /// parsable.
288
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub parsedToken: Option<OriginTrialToken>,
291
292    pub status: OriginTrialTokenStatus,
293}
294
295
296#[derive(Debug, Clone, Serialize, Deserialize, Default)]
297#[serde(rename_all = "camelCase")]
298pub struct OriginTrial {
299
300    pub trialName: String,
301
302    pub status: OriginTrialStatus,
303
304    pub tokensWithStatus: Vec<OriginTrialTokenWithStatus>,
305}
306
307/// Additional information about the frame document's security origin.
308
309#[derive(Debug, Clone, Serialize, Deserialize, Default)]
310#[serde(rename_all = "camelCase")]
311pub struct SecurityOriginDetails {
312    /// Indicates whether the frame document's security origin is one
313    /// of the local hostnames (e.g. "localhost") or IP addresses (IPv4
314    /// 127.0.0.0/8 or IPv6 ::1).
315
316    pub isLocalhost: bool,
317}
318
319/// Information about the Frame on the page.
320
321#[derive(Debug, Clone, Serialize, Deserialize, Default)]
322#[serde(rename_all = "camelCase")]
323pub struct Frame {
324    /// Frame unique identifier.
325
326    pub id: FrameId,
327    /// Parent frame identifier.
328
329    #[serde(skip_serializing_if = "Option::is_none")]
330    pub parentId: Option<FrameId>,
331    /// Identifier of the loader associated with this frame.
332
333    pub loaderId: crate::network::LoaderId,
334    /// Frame's name as specified in the tag.
335
336    #[serde(skip_serializing_if = "Option::is_none")]
337    pub name: Option<String>,
338    /// Frame document's URL without fragment.
339
340    pub url: String,
341    /// Frame document's URL fragment including the '#'.
342
343    #[serde(skip_serializing_if = "Option::is_none")]
344    pub urlFragment: Option<String>,
345    /// Frame document's registered domain, taking the public suffixes list into account.
346    /// Extracted from the Frame's url.
347    /// Example URLs: <http://www.google.com/file.html> -\> "google.com"
348    /// <http://a.b.co.uk/file.html>      -\> "b.co.uk"
349
350    pub domainAndRegistry: String,
351    /// Frame document's security origin.
352
353    pub securityOrigin: String,
354    /// Additional details about the frame document's security origin.
355
356    #[serde(skip_serializing_if = "Option::is_none")]
357    pub securityOriginDetails: Option<SecurityOriginDetails>,
358    /// Frame document's mimeType as determined by the browser.
359
360    pub mimeType: String,
361    /// If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment.
362
363    #[serde(skip_serializing_if = "Option::is_none")]
364    pub unreachableUrl: Option<String>,
365    /// Indicates whether this frame was tagged as an ad and why.
366
367    #[serde(skip_serializing_if = "Option::is_none")]
368    pub adFrameStatus: Option<AdFrameStatus>,
369    /// Indicates whether the main document is a secure context and explains why that is the case.
370
371    pub secureContextType: SecureContextType,
372    /// Indicates whether this is a cross origin isolated context.
373
374    pub crossOriginIsolatedContextType: CrossOriginIsolatedContextType,
375    /// Indicated which gated APIs / features are available.
376
377    pub gatedAPIFeatures: Vec<GatedAPIFeatures>,
378}
379
380/// Information about the Resource on the page.
381
382#[derive(Debug, Clone, Serialize, Deserialize, Default)]
383#[serde(rename_all = "camelCase")]
384pub struct FrameResource {
385    /// Resource URL.
386
387    pub url: String,
388    /// Type of this resource.
389
390    #[serde(rename = "type")]
391    pub type_: crate::network::ResourceType,
392    /// Resource mimeType as determined by the browser.
393
394    pub mimeType: String,
395    /// last-modified timestamp as reported by server.
396
397    #[serde(skip_serializing_if = "Option::is_none")]
398    pub lastModified: Option<crate::network::TimeSinceEpoch>,
399    /// Resource content size.
400
401    #[serde(skip_serializing_if = "Option::is_none")]
402    pub contentSize: Option<f64>,
403    /// True if the resource failed to load.
404
405    #[serde(skip_serializing_if = "Option::is_none")]
406    pub failed: Option<bool>,
407    /// True if the resource was canceled during loading.
408
409    #[serde(skip_serializing_if = "Option::is_none")]
410    pub canceled: Option<bool>,
411}
412
413/// Information about the Frame hierarchy along with their cached resources.
414
415#[derive(Debug, Clone, Serialize, Deserialize, Default)]
416#[serde(rename_all = "camelCase")]
417pub struct FrameResourceTree {
418    /// Frame information for this tree item.
419
420    pub frame: Frame,
421    /// Child frames.
422
423    #[serde(skip_serializing_if = "Option::is_none")]
424    pub childFrames: Option<Vec<FrameResourceTree>>,
425    /// Information about frame resources.
426
427    pub resources: Vec<FrameResource>,
428}
429
430/// Information about the Frame hierarchy.
431
432#[derive(Debug, Clone, Serialize, Deserialize, Default)]
433#[serde(rename_all = "camelCase")]
434pub struct FrameTree {
435    /// Frame information for this tree item.
436
437    pub frame: Frame,
438    /// Child frames.
439
440    #[serde(skip_serializing_if = "Option::is_none")]
441    pub childFrames: Option<Vec<FrameTree>>,
442}
443
444/// Unique script identifier.
445
446pub type ScriptIdentifier = String;
447
448/// Transition type.
449
450#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
451pub enum TransitionType {
452    #[default]
453    Link,
454    Typed,
455    AddressBar,
456    AutoBookmark,
457    AutoSubframe,
458    ManualSubframe,
459    Generated,
460    AutoToplevel,
461    FormSubmit,
462    Reload,
463    Keyword,
464    KeywordGenerated,
465    Other,
466}
467
468/// Navigation history entry.
469
470#[derive(Debug, Clone, Serialize, Deserialize, Default)]
471#[serde(rename_all = "camelCase")]
472pub struct NavigationEntry {
473    /// Unique id of the navigation history entry.
474
475    pub id: u64,
476    /// URL of the navigation history entry.
477
478    pub url: String,
479    /// URL that the user typed in the url bar.
480
481    pub userTypedURL: String,
482    /// Title of the navigation history entry.
483
484    pub title: String,
485    /// Transition type.
486
487    pub transitionType: TransitionType,
488}
489
490/// Screencast frame metadata.
491
492#[derive(Debug, Clone, Serialize, Deserialize, Default)]
493#[serde(rename_all = "camelCase")]
494pub struct ScreencastFrameMetadata {
495    /// Top offset in DIP.
496
497    pub offsetTop: f64,
498    /// Page scale factor.
499
500    pub pageScaleFactor: f64,
501    /// Device screen width in DIP.
502
503    pub deviceWidth: f64,
504    /// Device screen height in DIP.
505
506    pub deviceHeight: f64,
507    /// Position of horizontal scroll in CSS pixels.
508
509    pub scrollOffsetX: f64,
510    /// Position of vertical scroll in CSS pixels.
511
512    pub scrollOffsetY: f64,
513    /// Frame swap timestamp.
514
515    #[serde(skip_serializing_if = "Option::is_none")]
516    pub timestamp: Option<crate::network::TimeSinceEpoch>,
517}
518
519/// Javascript dialog type.
520
521#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
522pub enum DialogType {
523    #[default]
524    Alert,
525    Confirm,
526    Prompt,
527    Beforeunload,
528}
529
530/// Error while paring app manifest.
531
532#[derive(Debug, Clone, Serialize, Deserialize, Default)]
533#[serde(rename_all = "camelCase")]
534pub struct AppManifestError {
535    /// Error message.
536
537    pub message: String,
538    /// If critical, this is a non-recoverable parse error.
539
540    pub critical: i64,
541    /// Error line.
542
543    pub line: i64,
544    /// Error column.
545
546    pub column: i64,
547}
548
549/// Parsed app manifest properties.
550
551#[derive(Debug, Clone, Serialize, Deserialize, Default)]
552#[serde(rename_all = "camelCase")]
553pub struct AppManifestParsedProperties {
554    /// Computed scope value
555
556    pub scope: String,
557}
558
559/// Layout viewport position and dimensions.
560
561#[derive(Debug, Clone, Serialize, Deserialize, Default)]
562#[serde(rename_all = "camelCase")]
563pub struct LayoutViewport {
564    /// Horizontal offset relative to the document (CSS pixels).
565
566    pub pageX: i64,
567    /// Vertical offset relative to the document (CSS pixels).
568
569    pub pageY: i64,
570    /// Width (CSS pixels), excludes scrollbar if present.
571
572    pub clientWidth: u64,
573    /// Height (CSS pixels), excludes scrollbar if present.
574
575    pub clientHeight: i64,
576}
577
578/// Visual viewport position, dimensions, and scale.
579
580#[derive(Debug, Clone, Serialize, Deserialize, Default)]
581#[serde(rename_all = "camelCase")]
582pub struct VisualViewport {
583    /// Horizontal offset relative to the layout viewport (CSS pixels).
584
585    pub offsetX: f64,
586    /// Vertical offset relative to the layout viewport (CSS pixels).
587
588    pub offsetY: f64,
589    /// Horizontal offset relative to the document (CSS pixels).
590
591    pub pageX: f64,
592    /// Vertical offset relative to the document (CSS pixels).
593
594    pub pageY: f64,
595    /// Width (CSS pixels), excludes scrollbar if present.
596
597    pub clientWidth: f64,
598    /// Height (CSS pixels), excludes scrollbar if present.
599
600    pub clientHeight: f64,
601    /// Scale relative to the ideal viewport (size at width=device-width).
602
603    pub scale: f64,
604    /// Page zoom factor (CSS to device independent pixels ratio).
605
606    #[serde(skip_serializing_if = "Option::is_none")]
607    pub zoom: Option<f64>,
608}
609
610/// Viewport for capturing screenshot.
611
612#[derive(Debug, Clone, Serialize, Deserialize, Default)]
613#[serde(rename_all = "camelCase")]
614pub struct Viewport {
615    /// X offset in device independent pixels (dip).
616
617    pub x: f64,
618    /// Y offset in device independent pixels (dip).
619
620    pub y: f64,
621    /// Rectangle width in device independent pixels (dip).
622
623    pub width: f64,
624    /// Rectangle height in device independent pixels (dip).
625
626    pub height: f64,
627    /// Page scale factor.
628
629    pub scale: f64,
630}
631
632/// Generic font families collection.
633
634#[derive(Debug, Clone, Serialize, Deserialize, Default)]
635#[serde(rename_all = "camelCase")]
636pub struct FontFamilies {
637    /// The standard font-family.
638
639    #[serde(skip_serializing_if = "Option::is_none")]
640    pub standard: Option<String>,
641    /// The fixed font-family.
642
643    #[serde(skip_serializing_if = "Option::is_none")]
644    pub fixed: Option<String>,
645    /// The serif font-family.
646
647    #[serde(skip_serializing_if = "Option::is_none")]
648    pub serif: Option<String>,
649    /// The sansSerif font-family.
650
651    #[serde(skip_serializing_if = "Option::is_none")]
652    pub sansSerif: Option<String>,
653    /// The cursive font-family.
654
655    #[serde(skip_serializing_if = "Option::is_none")]
656    pub cursive: Option<String>,
657    /// The fantasy font-family.
658
659    #[serde(skip_serializing_if = "Option::is_none")]
660    pub fantasy: Option<String>,
661    /// The math font-family.
662
663    #[serde(skip_serializing_if = "Option::is_none")]
664    pub math: Option<String>,
665}
666
667/// Font families collection for a script.
668
669#[derive(Debug, Clone, Serialize, Deserialize, Default)]
670#[serde(rename_all = "camelCase")]
671pub struct ScriptFontFamilies {
672    /// Name of the script which these font families are defined for.
673
674    pub script: String,
675    /// Generic font families collection for the script.
676
677    pub fontFamilies: FontFamilies,
678}
679
680/// Default font sizes.
681
682#[derive(Debug, Clone, Serialize, Deserialize, Default)]
683#[serde(rename_all = "camelCase")]
684pub struct FontSizes {
685    /// Default standard font size.
686
687    #[serde(skip_serializing_if = "Option::is_none")]
688    pub standard: Option<i64>,
689    /// Default fixed font size.
690
691    #[serde(skip_serializing_if = "Option::is_none")]
692    pub fixed: Option<i64>,
693}
694
695
696#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
697pub enum ClientNavigationReason {
698    #[default]
699    AnchorClick,
700    FormSubmissionGet,
701    FormSubmissionPost,
702    HttpHeaderRefresh,
703    InitialFrameNavigation,
704    MetaTagRefresh,
705    Other,
706    PageBlockInterstitial,
707    Reload,
708    ScriptInitiated,
709}
710
711
712#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
713pub enum ClientNavigationDisposition {
714    #[default]
715    CurrentTab,
716    NewTab,
717    NewWindow,
718    Download,
719}
720
721
722#[derive(Debug, Clone, Serialize, Deserialize, Default)]
723#[serde(rename_all = "camelCase")]
724pub struct InstallabilityErrorArgument {
725    /// Argument name (e.g. name:'minimum-icon-size-in-pixels').
726
727    pub name: String,
728    /// Argument value (e.g. value:'64').
729
730    pub value: String,
731}
732
733/// The installability error
734
735#[derive(Debug, Clone, Serialize, Deserialize, Default)]
736#[serde(rename_all = "camelCase")]
737pub struct InstallabilityError {
738    /// The error id (e.g. 'manifest-missing-suitable-icon').
739
740    pub errorId: String,
741    /// The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels', value:'64'}).
742
743    pub errorArguments: Vec<InstallabilityErrorArgument>,
744}
745
746/// The referring-policy used for the navigation.
747
748#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
749pub enum ReferrerPolicy {
750    #[default]
751    NoReferrer,
752    NoReferrerWhenDowngrade,
753    Origin,
754    OriginWhenCrossOrigin,
755    SameOrigin,
756    StrictOrigin,
757    StrictOriginWhenCrossOrigin,
758    UnsafeUrl,
759}
760
761/// Per-script compilation cache parameters for 'Page.produceCompilationCache'
762
763#[derive(Debug, Clone, Serialize, Deserialize, Default)]
764#[serde(rename_all = "camelCase")]
765pub struct CompilationCacheParams {
766    /// The URL of the script to produce a compilation cache entry for.
767
768    pub url: String,
769    /// A hint to the backend whether eager compilation is recommended.
770    /// (the actual compilation mode used is upon backend discretion).
771
772    #[serde(skip_serializing_if = "Option::is_none")]
773    pub eager: Option<bool>,
774}
775
776
777#[derive(Debug, Clone, Serialize, Deserialize, Default)]
778#[serde(rename_all = "camelCase")]
779pub struct FileFilter {
780
781    #[serde(skip_serializing_if = "Option::is_none")]
782    pub name: Option<String>,
783
784    #[serde(skip_serializing_if = "Option::is_none")]
785    pub accepts: Option<Vec<String>>,
786}
787
788
789#[derive(Debug, Clone, Serialize, Deserialize, Default)]
790#[serde(rename_all = "camelCase")]
791pub struct FileHandler {
792
793    pub action: String,
794
795    pub name: String,
796
797    #[serde(skip_serializing_if = "Option::is_none")]
798    pub icons: Option<Vec<ImageResource>>,
799    /// Mimic a map, name is the key, accepts is the value.
800
801    #[serde(skip_serializing_if = "Option::is_none")]
802    pub accepts: Option<Vec<FileFilter>>,
803    /// Won't repeat the enums, using string for easy comparison. Same as the
804    /// other enums below.
805
806    pub launchType: String,
807}
808
809/// The image definition used in both icon and screenshot.
810
811#[derive(Debug, Clone, Serialize, Deserialize, Default)]
812#[serde(rename_all = "camelCase")]
813pub struct ImageResource {
814    /// The src field in the definition, but changing to url in favor of
815    /// consistency.
816
817    pub url: String,
818
819    #[serde(skip_serializing_if = "Option::is_none")]
820    pub sizes: Option<String>,
821
822    #[serde(skip_serializing_if = "Option::is_none")]
823    #[serde(rename = "type")]
824    pub type_: Option<String>,
825}
826
827
828#[derive(Debug, Clone, Serialize, Deserialize, Default)]
829#[serde(rename_all = "camelCase")]
830pub struct LaunchHandler {
831
832    pub clientMode: String,
833}
834
835
836#[derive(Debug, Clone, Serialize, Deserialize, Default)]
837#[serde(rename_all = "camelCase")]
838pub struct ProtocolHandler {
839
840    pub protocol: String,
841
842    pub url: String,
843}
844
845
846#[derive(Debug, Clone, Serialize, Deserialize, Default)]
847#[serde(rename_all = "camelCase")]
848pub struct RelatedApplication {
849
850    #[serde(skip_serializing_if = "Option::is_none")]
851    pub id: Option<String>,
852
853    pub url: String,
854}
855
856
857#[derive(Debug, Clone, Serialize, Deserialize, Default)]
858#[serde(rename_all = "camelCase")]
859pub struct ScopeExtension {
860    /// Instead of using tuple, this field always returns the serialized string
861    /// for easy understanding and comparison.
862
863    pub origin: String,
864
865    pub hasOriginWildcard: bool,
866}
867
868
869#[derive(Debug, Clone, Serialize, Deserialize, Default)]
870#[serde(rename_all = "camelCase")]
871pub struct Screenshot {
872
873    pub image: ImageResource,
874
875    pub formFactor: String,
876
877    #[serde(skip_serializing_if = "Option::is_none")]
878    pub label: Option<String>,
879}
880
881
882#[derive(Debug, Clone, Serialize, Deserialize, Default)]
883#[serde(rename_all = "camelCase")]
884pub struct ShareTarget {
885
886    pub action: String,
887
888    pub method: String,
889
890    pub enctype: String,
891    /// Embed the ShareTargetParams
892
893    #[serde(skip_serializing_if = "Option::is_none")]
894    pub title: Option<String>,
895
896    #[serde(skip_serializing_if = "Option::is_none")]
897    pub text: Option<String>,
898
899    #[serde(skip_serializing_if = "Option::is_none")]
900    pub url: Option<String>,
901
902    #[serde(skip_serializing_if = "Option::is_none")]
903    pub files: Option<Vec<FileFilter>>,
904}
905
906
907#[derive(Debug, Clone, Serialize, Deserialize, Default)]
908#[serde(rename_all = "camelCase")]
909pub struct Shortcut {
910
911    pub name: String,
912
913    pub url: String,
914}
915
916
917#[derive(Debug, Clone, Serialize, Deserialize, Default)]
918#[serde(rename_all = "camelCase")]
919pub struct WebAppManifest {
920
921    #[serde(skip_serializing_if = "Option::is_none")]
922    pub backgroundColor: Option<String>,
923    /// The extra description provided by the manifest.
924
925    #[serde(skip_serializing_if = "Option::is_none")]
926    pub description: Option<String>,
927
928    #[serde(skip_serializing_if = "Option::is_none")]
929    pub dir: Option<String>,
930
931    #[serde(skip_serializing_if = "Option::is_none")]
932    pub display: Option<String>,
933    /// The overrided display mode controlled by the user.
934
935    #[serde(skip_serializing_if = "Option::is_none")]
936    pub displayOverrides: Option<Vec<String>>,
937    /// The handlers to open files.
938
939    #[serde(skip_serializing_if = "Option::is_none")]
940    pub fileHandlers: Option<Vec<FileHandler>>,
941
942    #[serde(skip_serializing_if = "Option::is_none")]
943    pub icons: Option<Vec<ImageResource>>,
944
945    #[serde(skip_serializing_if = "Option::is_none")]
946    pub id: Option<String>,
947
948    #[serde(skip_serializing_if = "Option::is_none")]
949    pub lang: Option<String>,
950    /// TODO(crbug.com/1231886): This field is non-standard and part of a Chrome
951    /// experiment. See:
952    /// <https://github.com/WICG/web-app-launch/blob/main/launch_handler.md>
953
954    #[serde(skip_serializing_if = "Option::is_none")]
955    pub launchHandler: Option<LaunchHandler>,
956
957    #[serde(skip_serializing_if = "Option::is_none")]
958    pub name: Option<String>,
959
960    #[serde(skip_serializing_if = "Option::is_none")]
961    pub orientation: Option<String>,
962
963    #[serde(skip_serializing_if = "Option::is_none")]
964    pub preferRelatedApplications: Option<bool>,
965    /// The handlers to open protocols.
966
967    #[serde(skip_serializing_if = "Option::is_none")]
968    pub protocolHandlers: Option<Vec<ProtocolHandler>>,
969
970    #[serde(skip_serializing_if = "Option::is_none")]
971    pub relatedApplications: Option<Vec<RelatedApplication>>,
972
973    #[serde(skip_serializing_if = "Option::is_none")]
974    pub scope: Option<String>,
975    /// Non-standard, see
976    /// <https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md>
977
978    #[serde(skip_serializing_if = "Option::is_none")]
979    pub scopeExtensions: Option<Vec<ScopeExtension>>,
980    /// The screenshots used by chromium.
981
982    #[serde(skip_serializing_if = "Option::is_none")]
983    pub screenshots: Option<Vec<Screenshot>>,
984
985    #[serde(skip_serializing_if = "Option::is_none")]
986    pub shareTarget: Option<ShareTarget>,
987
988    #[serde(skip_serializing_if = "Option::is_none")]
989    pub shortName: Option<String>,
990
991    #[serde(skip_serializing_if = "Option::is_none")]
992    pub shortcuts: Option<Vec<Shortcut>>,
993
994    #[serde(skip_serializing_if = "Option::is_none")]
995    pub startUrl: Option<String>,
996
997    #[serde(skip_serializing_if = "Option::is_none")]
998    pub themeColor: Option<String>,
999}
1000
1001/// The type of a frameNavigated event.
1002
1003#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1004pub enum NavigationType {
1005    #[default]
1006    Navigation,
1007    BackForwardCacheRestore,
1008}
1009
1010/// List of not restored reasons for back-forward cache.
1011
1012#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1013pub enum BackForwardCacheNotRestoredReason {
1014    #[default]
1015    NotPrimaryMainFrame,
1016    BackForwardCacheDisabled,
1017    RelatedActiveContentsExist,
1018    HTTPStatusNotOK,
1019    SchemeNotHTTPOrHTTPS,
1020    Loading,
1021    WasGrantedMediaAccess,
1022    DisableForRenderFrameHostCalled,
1023    DomainNotAllowed,
1024    HTTPMethodNotGET,
1025    SubframeIsNavigating,
1026    Timeout,
1027    CacheLimit,
1028    JavaScriptExecution,
1029    RendererProcessKilled,
1030    RendererProcessCrashed,
1031    SchedulerTrackedFeatureUsed,
1032    ConflictingBrowsingInstance,
1033    CacheFlushed,
1034    ServiceWorkerVersionActivation,
1035    SessionRestored,
1036    ServiceWorkerPostMessage,
1037    EnteredBackForwardCacheBeforeServiceWorkerHostAdded,
1038    RenderFrameHostReusedSameSite,
1039    RenderFrameHostReusedCrossSite,
1040    ServiceWorkerClaim,
1041    IgnoreEventAndEvict,
1042    HaveInnerContents,
1043    TimeoutPuttingInCache,
1044    BackForwardCacheDisabledByLowMemory,
1045    BackForwardCacheDisabledByCommandLine,
1046    NetworkRequestDatapipeDrainedAsBytesConsumer,
1047    NetworkRequestRedirected,
1048    NetworkRequestTimeout,
1049    NetworkExceedsBufferLimit,
1050    NavigationCancelledWhileRestoring,
1051    NotMostRecentNavigationEntry,
1052    BackForwardCacheDisabledForPrerender,
1053    UserAgentOverrideDiffers,
1054    ForegroundCacheLimit,
1055    ForwardCacheDisabled,
1056    BrowsingInstanceNotSwapped,
1057    BackForwardCacheDisabledForDelegate,
1058    UnloadHandlerExistsInMainFrame,
1059    UnloadHandlerExistsInSubFrame,
1060    ServiceWorkerUnregistration,
1061    CacheControlNoStore,
1062    CacheControlNoStoreCookieModified,
1063    CacheControlNoStoreHTTPOnlyCookieModified,
1064    NoResponseHead,
1065    Unknown,
1066    ActivationNavigationsDisallowedForBug1234857,
1067    ErrorDocument,
1068    FencedFramesEmbedder,
1069    CookieDisabled,
1070    HTTPAuthRequired,
1071    CookieFlushed,
1072    BroadcastChannelOnMessage,
1073    WebViewSettingsChanged,
1074    WebViewJavaScriptObjectChanged,
1075    WebViewMessageListenerInjected,
1076    WebViewSafeBrowsingAllowlistChanged,
1077    WebViewDocumentStartJavascriptChanged,
1078    WebSocket,
1079    WebTransport,
1080    WebRTC,
1081    MainResourceHasCacheControlNoStore,
1082    MainResourceHasCacheControlNoCache,
1083    SubresourceHasCacheControlNoStore,
1084    SubresourceHasCacheControlNoCache,
1085    ContainsPlugins,
1086    DocumentLoaded,
1087    OutstandingNetworkRequestOthers,
1088    RequestedMIDIPermission,
1089    RequestedAudioCapturePermission,
1090    RequestedVideoCapturePermission,
1091    RequestedBackForwardCacheBlockedSensors,
1092    RequestedBackgroundWorkPermission,
1093    BroadcastChannel,
1094    WebXR,
1095    SharedWorker,
1096    SharedWorkerMessage,
1097    SharedWorkerWithNoActiveClient,
1098    WebLocks,
1099    WebLocksContention,
1100    WebHID,
1101    WebBluetooth,
1102    WebShare,
1103    RequestedStorageAccessGrant,
1104    WebNfc,
1105    OutstandingNetworkRequestFetch,
1106    OutstandingNetworkRequestXHR,
1107    AppBanner,
1108    Printing,
1109    WebDatabase,
1110    PictureInPicture,
1111    SpeechRecognizer,
1112    IdleManager,
1113    PaymentManager,
1114    SpeechSynthesis,
1115    KeyboardLock,
1116    WebOTPService,
1117    OutstandingNetworkRequestDirectSocket,
1118    InjectedJavascript,
1119    InjectedStyleSheet,
1120    KeepaliveRequest,
1121    IndexedDBEvent,
1122    Dummy,
1123    JsNetworkRequestReceivedCacheControlNoStoreResource,
1124    WebRTCUsedWithCCNS,
1125    WebTransportUsedWithCCNS,
1126    WebSocketUsedWithCCNS,
1127    SmartCard,
1128    LiveMediaStreamTrack,
1129    UnloadHandler,
1130    ParserAborted,
1131    ContentSecurityHandler,
1132    ContentWebAuthenticationAPI,
1133    ContentFileChooser,
1134    ContentSerial,
1135    ContentFileSystemAccess,
1136    ContentMediaDevicesDispatcherHost,
1137    ContentWebBluetooth,
1138    ContentWebUSB,
1139    ContentMediaSessionService,
1140    ContentScreenReader,
1141    ContentDiscarded,
1142    EmbedderPopupBlockerTabHelper,
1143    EmbedderSafeBrowsingTriggeredPopupBlocker,
1144    EmbedderSafeBrowsingThreatDetails,
1145    EmbedderAppBannerManager,
1146    EmbedderDomDistillerViewerSource,
1147    EmbedderDomDistillerSelfDeletingRequestDelegate,
1148    EmbedderOomInterventionTabHelper,
1149    EmbedderOfflinePage,
1150    EmbedderChromePasswordManagerClientBindCredentialManager,
1151    EmbedderPermissionRequestManager,
1152    EmbedderModalDialog,
1153    EmbedderExtensions,
1154    EmbedderExtensionMessaging,
1155    EmbedderExtensionMessagingForOpenPort,
1156    EmbedderExtensionSentMessageToCachedFrame,
1157    RequestedByWebViewClient,
1158    PostMessageByWebViewClient,
1159    CacheControlNoStoreDeviceBoundSessionTerminated,
1160    CacheLimitPrunedOnModerateMemoryPressure,
1161    CacheLimitPrunedOnCriticalMemoryPressure,
1162}
1163
1164/// Types of not restored reasons for back-forward cache.
1165
1166#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1167pub enum BackForwardCacheNotRestoredReasonType {
1168    #[default]
1169    SupportPending,
1170    PageSupportNeeded,
1171    Circumstantial,
1172}
1173
1174
1175#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1176#[serde(rename_all = "camelCase")]
1177pub struct BackForwardCacheBlockingDetails {
1178    /// Url of the file where blockage happened. Optional because of tests.
1179
1180    #[serde(skip_serializing_if = "Option::is_none")]
1181    pub url: Option<String>,
1182    /// Function name where blockage happened. Optional because of anonymous functions and tests.
1183
1184    #[serde(skip_serializing_if = "Option::is_none")]
1185    pub function: Option<String>,
1186    /// Line number in the script (0-based).
1187
1188    pub lineNumber: i64,
1189    /// Column number in the script (0-based).
1190
1191    pub columnNumber: i64,
1192}
1193
1194
1195#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1196#[serde(rename_all = "camelCase")]
1197pub struct BackForwardCacheNotRestoredExplanation {
1198    /// Type of the reason
1199
1200    #[serde(rename = "type")]
1201    pub type_: BackForwardCacheNotRestoredReasonType,
1202    /// Not restored reason
1203
1204    pub reason: BackForwardCacheNotRestoredReason,
1205    /// Context associated with the reason. The meaning of this context is
1206    /// dependent on the reason:
1207    /// - EmbedderExtensionSentMessageToCachedFrame: the extension ID.
1208
1209    #[serde(skip_serializing_if = "Option::is_none")]
1210    pub context: Option<String>,
1211
1212    #[serde(skip_serializing_if = "Option::is_none")]
1213    pub details: Option<Vec<BackForwardCacheBlockingDetails>>,
1214}
1215
1216
1217#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1218#[serde(rename_all = "camelCase")]
1219pub struct BackForwardCacheNotRestoredExplanationTree {
1220    /// URL of each frame
1221
1222    pub url: String,
1223    /// Not restored reasons of each frame
1224
1225    pub explanations: Vec<BackForwardCacheNotRestoredExplanation>,
1226    /// Array of children frame
1227
1228    pub children: Vec<BackForwardCacheNotRestoredExplanationTree>,
1229}
1230
1231/// Deprecated, please use addScriptToEvaluateOnNewDocument instead.
1232
1233#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1234#[serde(rename_all = "camelCase")]
1235pub struct AddScriptToEvaluateOnLoadParams {
1236
1237    pub scriptSource: String,
1238}
1239
1240/// Deprecated, please use addScriptToEvaluateOnNewDocument instead.
1241
1242#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1243#[serde(rename_all = "camelCase")]
1244pub struct AddScriptToEvaluateOnLoadReturns {
1245    /// Identifier of the added script.
1246
1247    pub identifier: ScriptIdentifier,
1248}
1249
1250/// Evaluates given script in every frame upon creation (before loading frame's scripts).
1251
1252#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1253#[serde(rename_all = "camelCase")]
1254pub struct AddScriptToEvaluateOnNewDocumentParams {
1255
1256    pub source: String,
1257    /// If specified, creates an isolated world with the given name and evaluates given script in it.
1258    /// This world name will be used as the ExecutionContextDescription::name when the corresponding
1259    /// event is emitted.
1260
1261    #[serde(skip_serializing_if = "Option::is_none")]
1262    pub worldName: Option<String>,
1263    /// Specifies whether command line API should be available to the script, defaults
1264    /// to false.
1265
1266    #[serde(skip_serializing_if = "Option::is_none")]
1267    pub includeCommandLineAPI: Option<bool>,
1268    /// If true, runs the script immediately on existing execution contexts or worlds.
1269    /// Default: false.
1270
1271    #[serde(skip_serializing_if = "Option::is_none")]
1272    pub runImmediately: Option<bool>,
1273}
1274
1275/// Evaluates given script in every frame upon creation (before loading frame's scripts).
1276
1277#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1278#[serde(rename_all = "camelCase")]
1279pub struct AddScriptToEvaluateOnNewDocumentReturns {
1280    /// Identifier of the added script.
1281
1282    pub identifier: ScriptIdentifier,
1283}
1284
1285/// Capture page screenshot.
1286
1287#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1288#[serde(rename_all = "camelCase")]
1289pub struct CaptureScreenshotParams {
1290    /// Image compression format (defaults to png).
1291
1292    #[serde(skip_serializing_if = "Option::is_none")]
1293    pub format: Option<String>,
1294    /// Compression quality from range \[0..100\] (jpeg only).
1295
1296    #[serde(skip_serializing_if = "Option::is_none")]
1297    pub quality: Option<i64>,
1298    /// Capture the screenshot of a given region only.
1299
1300    #[serde(skip_serializing_if = "Option::is_none")]
1301    pub clip: Option<Viewport>,
1302    /// Capture the screenshot from the surface, rather than the view. Defaults to true.
1303
1304    #[serde(skip_serializing_if = "Option::is_none")]
1305    pub fromSurface: Option<bool>,
1306    /// Capture the screenshot beyond the viewport. Defaults to false.
1307
1308    #[serde(skip_serializing_if = "Option::is_none")]
1309    pub captureBeyondViewport: Option<bool>,
1310    /// Optimize image encoding for speed, not for resulting size (defaults to false)
1311
1312    #[serde(skip_serializing_if = "Option::is_none")]
1313    pub optimizeForSpeed: Option<bool>,
1314}
1315
1316/// Capture page screenshot.
1317
1318#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1319#[serde(rename_all = "camelCase")]
1320pub struct CaptureScreenshotReturns {
1321    /// Base64-encoded image data. (Encoded as a base64 string when passed over JSON)
1322
1323    pub data: String,
1324}
1325
1326/// Returns a snapshot of the page as a string. For MHTML format, the serialization includes
1327/// iframes, shadow DOM, external resources, and element-inline styles.
1328
1329#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1330#[serde(rename_all = "camelCase")]
1331pub struct CaptureSnapshotParams {
1332    /// Format (defaults to mhtml).
1333
1334    #[serde(skip_serializing_if = "Option::is_none")]
1335    pub format: Option<String>,
1336}
1337
1338/// Returns a snapshot of the page as a string. For MHTML format, the serialization includes
1339/// iframes, shadow DOM, external resources, and element-inline styles.
1340
1341#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1342#[serde(rename_all = "camelCase")]
1343pub struct CaptureSnapshotReturns {
1344    /// Serialized page data.
1345
1346    pub data: String,
1347}
1348
1349/// Creates an isolated world for the given frame.
1350
1351#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1352#[serde(rename_all = "camelCase")]
1353pub struct CreateIsolatedWorldParams {
1354    /// Id of the frame in which the isolated world should be created.
1355
1356    pub frameId: FrameId,
1357    /// An optional name which is reported in the Execution Context.
1358
1359    #[serde(skip_serializing_if = "Option::is_none")]
1360    pub worldName: Option<String>,
1361    /// Whether or not universal access should be granted to the isolated world. This is a powerful
1362    /// option, use with caution.
1363
1364    #[serde(skip_serializing_if = "Option::is_none")]
1365    pub grantUniveralAccess: Option<bool>,
1366}
1367
1368/// Creates an isolated world for the given frame.
1369
1370#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1371#[serde(rename_all = "camelCase")]
1372pub struct CreateIsolatedWorldReturns {
1373    /// Execution context of the isolated world.
1374
1375    pub executionContextId: crate::runtime::ExecutionContextId,
1376}
1377
1378/// Deletes browser cookie with given name, domain and path.
1379
1380#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1381#[serde(rename_all = "camelCase")]
1382pub struct DeleteCookieParams {
1383    /// Name of the cookie to remove.
1384
1385    pub cookieName: String,
1386    /// URL to match cooke domain and path.
1387
1388    pub url: String,
1389}
1390
1391/// Enables page domain notifications.
1392
1393#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1394#[serde(rename_all = "camelCase")]
1395pub struct EnableParams {
1396    /// If true, the 'Page.fileChooserOpened' event will be emitted regardless of the state set by
1397    /// 'Page.setInterceptFileChooserDialog' command (default: false).
1398
1399    #[serde(skip_serializing_if = "Option::is_none")]
1400    pub enableFileChooserOpenedEvent: Option<bool>,
1401}
1402
1403/// Gets the processed manifest for this current document.
1404/// This API always waits for the manifest to be loaded.
1405/// If manifestId is provided, and it does not match the manifest of the
1406/// current document, this API errors out.
1407/// If there is not a loaded page, this API errors out immediately.
1408
1409#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1410#[serde(rename_all = "camelCase")]
1411pub struct GetAppManifestParams {
1412
1413    #[serde(skip_serializing_if = "Option::is_none")]
1414    pub manifestId: Option<String>,
1415}
1416
1417/// Gets the processed manifest for this current document.
1418/// This API always waits for the manifest to be loaded.
1419/// If manifestId is provided, and it does not match the manifest of the
1420/// current document, this API errors out.
1421/// If there is not a loaded page, this API errors out immediately.
1422
1423#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1424#[serde(rename_all = "camelCase")]
1425pub struct GetAppManifestReturns {
1426    /// Manifest location.
1427
1428    pub url: String,
1429
1430    pub errors: Vec<AppManifestError>,
1431    /// Manifest content.
1432
1433    #[serde(skip_serializing_if = "Option::is_none")]
1434    pub data: Option<String>,
1435    /// Parsed manifest properties. Deprecated, use manifest instead.
1436
1437    #[serde(skip_serializing_if = "Option::is_none")]
1438    pub parsed: Option<AppManifestParsedProperties>,
1439
1440    pub manifest: WebAppManifest,
1441}
1442
1443
1444#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1445#[serde(rename_all = "camelCase")]
1446pub struct GetInstallabilityErrorsReturns {
1447
1448    pub installabilityErrors: Vec<InstallabilityError>,
1449}
1450
1451/// Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation.
1452
1453#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1454#[serde(rename_all = "camelCase")]
1455pub struct GetManifestIconsReturns {
1456
1457    #[serde(skip_serializing_if = "Option::is_none")]
1458    pub primaryIcon: Option<String>,
1459}
1460
1461/// Returns the unique (PWA) app id.
1462/// Only returns values if the feature flag 'WebAppEnableManifestId' is enabled
1463
1464#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1465#[serde(rename_all = "camelCase")]
1466pub struct GetAppIdReturns {
1467    /// App id, either from manifest's id attribute or computed from start_url
1468
1469    #[serde(skip_serializing_if = "Option::is_none")]
1470    pub appId: Option<String>,
1471    /// Recommendation for manifest's id attribute to match current id computed from start_url
1472
1473    #[serde(skip_serializing_if = "Option::is_none")]
1474    pub recommendedId: Option<String>,
1475}
1476
1477
1478#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1479#[serde(rename_all = "camelCase")]
1480pub struct GetAdScriptAncestryParams {
1481
1482    pub frameId: FrameId,
1483}
1484
1485
1486#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1487#[serde(rename_all = "camelCase")]
1488pub struct GetAdScriptAncestryReturns {
1489    /// The ancestry chain of ad script identifiers leading to this frame's
1490    /// creation, along with the root script's filterlist rule. The ancestry
1491    /// chain is ordered from the most immediate script (in the frame creation
1492    /// stack) to more distant ancestors (that created the immediately preceding
1493    /// script). Only sent if frame is labelled as an ad and ids are available.
1494
1495    #[serde(skip_serializing_if = "Option::is_none")]
1496    pub adScriptAncestry: Option<crate::network::AdAncestry>,
1497}
1498
1499/// Returns present frame tree structure.
1500
1501#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1502#[serde(rename_all = "camelCase")]
1503pub struct GetFrameTreeReturns {
1504    /// Present frame tree structure.
1505
1506    pub frameTree: FrameTree,
1507}
1508
1509/// Returns metrics relating to the layouting of the page, such as viewport bounds/scale.
1510
1511#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1512#[serde(rename_all = "camelCase")]
1513pub struct GetLayoutMetricsReturns {
1514    /// Deprecated metrics relating to the layout viewport. Is in device pixels. Use 'cssLayoutViewport' instead.
1515
1516    pub layoutViewport: LayoutViewport,
1517    /// Deprecated metrics relating to the visual viewport. Is in device pixels. Use 'cssVisualViewport' instead.
1518
1519    pub visualViewport: VisualViewport,
1520    /// Deprecated size of scrollable area. Is in DP. Use 'cssContentSize' instead.
1521
1522    pub contentSize: crate::dom::Rect,
1523    /// Metrics relating to the layout viewport in CSS pixels.
1524
1525    pub cssLayoutViewport: LayoutViewport,
1526    /// Metrics relating to the visual viewport in CSS pixels.
1527
1528    pub cssVisualViewport: VisualViewport,
1529    /// Size of scrollable area in CSS pixels.
1530
1531    pub cssContentSize: crate::dom::Rect,
1532}
1533
1534/// Returns navigation history for the current page.
1535
1536#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1537#[serde(rename_all = "camelCase")]
1538pub struct GetNavigationHistoryReturns {
1539    /// Index of the current navigation history entry.
1540
1541    pub currentIndex: u64,
1542    /// Array of navigation history entries.
1543
1544    pub entries: Vec<NavigationEntry>,
1545}
1546
1547/// Returns content of the given resource.
1548
1549#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1550#[serde(rename_all = "camelCase")]
1551pub struct GetResourceContentParams {
1552    /// Frame id to get resource for.
1553
1554    pub frameId: FrameId,
1555    /// URL of the resource to get content for.
1556
1557    pub url: String,
1558}
1559
1560/// Returns content of the given resource.
1561
1562#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1563#[serde(rename_all = "camelCase")]
1564pub struct GetResourceContentReturns {
1565    /// Resource content.
1566
1567    pub content: String,
1568    /// True, if content was served as base64.
1569
1570    pub base64Encoded: bool,
1571}
1572
1573/// Returns present frame / resource tree structure.
1574
1575#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1576#[serde(rename_all = "camelCase")]
1577pub struct GetResourceTreeReturns {
1578    /// Present frame / resource tree structure.
1579
1580    pub frameTree: FrameResourceTree,
1581}
1582
1583/// Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
1584
1585#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1586#[serde(rename_all = "camelCase")]
1587pub struct HandleJavaScriptDialogParams {
1588    /// Whether to accept or dismiss the dialog.
1589
1590    pub accept: bool,
1591    /// The text to enter into the dialog prompt before accepting. Used only if this is a prompt
1592    /// dialog.
1593
1594    #[serde(skip_serializing_if = "Option::is_none")]
1595    pub promptText: Option<String>,
1596}
1597
1598/// Navigates current page to the given URL.
1599
1600#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1601#[serde(rename_all = "camelCase")]
1602pub struct NavigateParams {
1603    /// URL to navigate the page to.
1604
1605    pub url: String,
1606    /// Referrer URL.
1607
1608    #[serde(skip_serializing_if = "Option::is_none")]
1609    pub referrer: Option<String>,
1610    /// Intended transition type.
1611
1612    #[serde(skip_serializing_if = "Option::is_none")]
1613    pub transitionType: Option<TransitionType>,
1614    /// Frame id to navigate, if not specified navigates the top frame.
1615
1616    #[serde(skip_serializing_if = "Option::is_none")]
1617    pub frameId: Option<FrameId>,
1618    /// Referrer-policy used for the navigation.
1619
1620    #[serde(skip_serializing_if = "Option::is_none")]
1621    pub referrerPolicy: Option<ReferrerPolicy>,
1622}
1623
1624/// Navigates current page to the given URL.
1625
1626#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1627#[serde(rename_all = "camelCase")]
1628pub struct NavigateReturns {
1629    /// Frame id that has navigated (or failed to navigate)
1630
1631    pub frameId: FrameId,
1632    /// Loader identifier. This is omitted in case of same-document navigation,
1633    /// as the previously committed loaderId would not change.
1634
1635    #[serde(skip_serializing_if = "Option::is_none")]
1636    pub loaderId: Option<crate::network::LoaderId>,
1637    /// User friendly error message, present if and only if navigation has failed.
1638
1639    #[serde(skip_serializing_if = "Option::is_none")]
1640    pub errorText: Option<String>,
1641    /// Whether the navigation resulted in a download.
1642
1643    #[serde(skip_serializing_if = "Option::is_none")]
1644    pub isDownload: Option<bool>,
1645}
1646
1647/// Navigates current page to the given history entry.
1648
1649#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1650#[serde(rename_all = "camelCase")]
1651pub struct NavigateToHistoryEntryParams {
1652    /// Unique id of the entry to navigate to.
1653
1654    pub entryId: u64,
1655}
1656
1657/// Print page as PDF.
1658
1659#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1660#[serde(rename_all = "camelCase")]
1661pub struct PrintToPDFParams {
1662    /// Paper orientation. Defaults to false.
1663
1664    #[serde(skip_serializing_if = "Option::is_none")]
1665    pub landscape: Option<bool>,
1666    /// Display header and footer. Defaults to false.
1667
1668    #[serde(skip_serializing_if = "Option::is_none")]
1669    pub displayHeaderFooter: Option<bool>,
1670    /// Print background graphics. Defaults to false.
1671
1672    #[serde(skip_serializing_if = "Option::is_none")]
1673    pub printBackground: Option<bool>,
1674    /// Scale of the webpage rendering. Defaults to 1.
1675
1676    #[serde(skip_serializing_if = "Option::is_none")]
1677    pub scale: Option<f64>,
1678    /// Paper width in inches. Defaults to 8.5 inches.
1679
1680    #[serde(skip_serializing_if = "Option::is_none")]
1681    pub paperWidth: Option<f64>,
1682    /// Paper height in inches. Defaults to 11 inches.
1683
1684    #[serde(skip_serializing_if = "Option::is_none")]
1685    pub paperHeight: Option<f64>,
1686    /// Top margin in inches. Defaults to 1cm (~0.4 inches).
1687
1688    #[serde(skip_serializing_if = "Option::is_none")]
1689    pub marginTop: Option<f64>,
1690    /// Bottom margin in inches. Defaults to 1cm (~0.4 inches).
1691
1692    #[serde(skip_serializing_if = "Option::is_none")]
1693    pub marginBottom: Option<f64>,
1694    /// Left margin in inches. Defaults to 1cm (~0.4 inches).
1695
1696    #[serde(skip_serializing_if = "Option::is_none")]
1697    pub marginLeft: Option<f64>,
1698    /// Right margin in inches. Defaults to 1cm (~0.4 inches).
1699
1700    #[serde(skip_serializing_if = "Option::is_none")]
1701    pub marginRight: Option<f64>,
1702    /// Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are
1703    /// printed in the document order, not in the order specified, and no
1704    /// more than once.
1705    /// Defaults to empty string, which implies the entire document is printed.
1706    /// The page numbers are quietly capped to actual page count of the
1707    /// document, and ranges beyond the end of the document are ignored.
1708    /// If this results in no pages to print, an error is reported.
1709    /// It is an error to specify a range with start greater than end.
1710
1711    #[serde(skip_serializing_if = "Option::is_none")]
1712    pub pageRanges: Option<String>,
1713    /// HTML template for the print header. Should be valid HTML markup with following
1714    /// classes used to inject printing values into them:
1715    /// - 'date': formatted print date
1716    /// - 'title': document title
1717    /// - 'url': document location
1718    /// - 'pageNumber': current page number
1719    /// - 'totalPages': total pages in the document
1720    /// 
1721    /// For example, '\<span class=title\>\</span\>' would generate span containing the title.
1722
1723    #[serde(skip_serializing_if = "Option::is_none")]
1724    pub headerTemplate: Option<String>,
1725    /// HTML template for the print footer. Should use the same format as the 'headerTemplate'.
1726
1727    #[serde(skip_serializing_if = "Option::is_none")]
1728    pub footerTemplate: Option<String>,
1729    /// Whether or not to prefer page size as defined by css. Defaults to false,
1730    /// in which case the content will be scaled to fit the paper size.
1731
1732    #[serde(skip_serializing_if = "Option::is_none")]
1733    pub preferCSSPageSize: Option<bool>,
1734    /// return as stream
1735
1736    #[serde(skip_serializing_if = "Option::is_none")]
1737    pub transferMode: Option<String>,
1738    /// Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice.
1739
1740    #[serde(skip_serializing_if = "Option::is_none")]
1741    pub generateTaggedPDF: Option<bool>,
1742    /// Whether or not to embed the document outline into the PDF.
1743
1744    #[serde(skip_serializing_if = "Option::is_none")]
1745    pub generateDocumentOutline: Option<bool>,
1746}
1747
1748/// Print page as PDF.
1749
1750#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1751#[serde(rename_all = "camelCase")]
1752pub struct PrintToPDFReturns {
1753    /// Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded as a base64 string when passed over JSON)
1754
1755    pub data: String,
1756    /// A handle of the stream that holds resulting PDF data.
1757
1758    #[serde(skip_serializing_if = "Option::is_none")]
1759    pub stream: Option<crate::io::StreamHandle>,
1760}
1761
1762/// Reloads given page optionally ignoring the cache.
1763
1764#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1765#[serde(rename_all = "camelCase")]
1766pub struct ReloadParams {
1767    /// If true, browser cache is ignored (as if the user pressed Shift+refresh).
1768
1769    #[serde(skip_serializing_if = "Option::is_none")]
1770    pub ignoreCache: Option<bool>,
1771    /// If set, the script will be injected into all frames of the inspected page after reload.
1772    /// Argument will be ignored if reloading dataURL origin.
1773
1774    #[serde(skip_serializing_if = "Option::is_none")]
1775    pub scriptToEvaluateOnLoad: Option<String>,
1776    /// If set, an error will be thrown if the target page's main frame's
1777    /// loader id does not match the provided id. This prevents accidentally
1778    /// reloading an unintended target in case there's a racing navigation.
1779
1780    #[serde(skip_serializing_if = "Option::is_none")]
1781    pub loaderId: Option<crate::network::LoaderId>,
1782}
1783
1784/// Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
1785
1786#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1787#[serde(rename_all = "camelCase")]
1788pub struct RemoveScriptToEvaluateOnLoadParams {
1789
1790    pub identifier: ScriptIdentifier,
1791}
1792
1793/// Removes given script from the list.
1794
1795#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1796#[serde(rename_all = "camelCase")]
1797pub struct RemoveScriptToEvaluateOnNewDocumentParams {
1798
1799    pub identifier: ScriptIdentifier,
1800}
1801
1802/// Acknowledges that a screencast frame has been received by the frontend.
1803
1804#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1805#[serde(rename_all = "camelCase")]
1806pub struct ScreencastFrameAckParams {
1807    /// Frame number.
1808
1809    pub sessionId: u64,
1810}
1811
1812/// Searches for given string in resource content.
1813
1814#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1815#[serde(rename_all = "camelCase")]
1816pub struct SearchInResourceParams {
1817    /// Frame id for resource to search in.
1818
1819    pub frameId: FrameId,
1820    /// URL of the resource to search in.
1821
1822    pub url: String,
1823    /// String to search for.
1824
1825    pub query: String,
1826    /// If true, search is case sensitive.
1827
1828    #[serde(skip_serializing_if = "Option::is_none")]
1829    pub caseSensitive: Option<bool>,
1830    /// If true, treats string parameter as regex.
1831
1832    #[serde(skip_serializing_if = "Option::is_none")]
1833    pub isRegex: Option<bool>,
1834}
1835
1836/// Searches for given string in resource content.
1837
1838#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1839#[serde(rename_all = "camelCase")]
1840pub struct SearchInResourceReturns {
1841    /// List of search matches.
1842
1843    pub result: Vec<crate::debugger::SearchMatch>,
1844}
1845
1846/// Enable Chrome's experimental ad filter on all sites.
1847
1848#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1849#[serde(rename_all = "camelCase")]
1850pub struct SetAdBlockingEnabledParams {
1851    /// Whether to block ads.
1852
1853    pub enabled: bool,
1854}
1855
1856/// Enable page Content Security Policy by-passing.
1857
1858#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1859#[serde(rename_all = "camelCase")]
1860pub struct SetBypassCSPParams {
1861    /// Whether to bypass page CSP.
1862
1863    pub enabled: bool,
1864}
1865
1866/// Get Permissions Policy state on given frame.
1867
1868#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1869#[serde(rename_all = "camelCase")]
1870pub struct GetPermissionsPolicyStateParams {
1871
1872    pub frameId: FrameId,
1873}
1874
1875/// Get Permissions Policy state on given frame.
1876
1877#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1878#[serde(rename_all = "camelCase")]
1879pub struct GetPermissionsPolicyStateReturns {
1880
1881    pub states: Vec<PermissionsPolicyFeatureState>,
1882}
1883
1884/// Get Origin Trials on given frame.
1885
1886#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1887#[serde(rename_all = "camelCase")]
1888pub struct GetOriginTrialsParams {
1889
1890    pub frameId: FrameId,
1891}
1892
1893/// Get Origin Trials on given frame.
1894
1895#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1896#[serde(rename_all = "camelCase")]
1897pub struct GetOriginTrialsReturns {
1898
1899    pub originTrials: Vec<OriginTrial>,
1900}
1901
1902/// Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
1903/// window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
1904/// query results).
1905
1906#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1907#[serde(rename_all = "camelCase")]
1908pub struct SetDeviceMetricsOverrideParams {
1909    /// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
1910
1911    pub width: u64,
1912    /// Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
1913
1914    pub height: i64,
1915    /// Overriding device scale factor value. 0 disables the override.
1916
1917    pub deviceScaleFactor: f64,
1918    /// Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text
1919    /// autosizing and more.
1920
1921    pub mobile: bool,
1922    /// Scale to apply to resulting view image.
1923
1924    #[serde(skip_serializing_if = "Option::is_none")]
1925    pub scale: Option<f64>,
1926    /// Overriding screen width value in pixels (minimum 0, maximum 10000000).
1927
1928    #[serde(skip_serializing_if = "Option::is_none")]
1929    pub screenWidth: Option<u64>,
1930    /// Overriding screen height value in pixels (minimum 0, maximum 10000000).
1931
1932    #[serde(skip_serializing_if = "Option::is_none")]
1933    pub screenHeight: Option<i64>,
1934    /// Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
1935
1936    #[serde(skip_serializing_if = "Option::is_none")]
1937    pub positionX: Option<i64>,
1938    /// Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
1939
1940    #[serde(skip_serializing_if = "Option::is_none")]
1941    pub positionY: Option<i64>,
1942    /// Do not set visible view size, rely upon explicit setVisibleSize call.
1943
1944    #[serde(skip_serializing_if = "Option::is_none")]
1945    pub dontSetVisibleSize: Option<bool>,
1946    /// Screen orientation override.
1947
1948    #[serde(skip_serializing_if = "Option::is_none")]
1949    pub screenOrientation: Option<crate::emulation::ScreenOrientation>,
1950    /// The viewport dimensions and scale. If not set, the override is cleared.
1951
1952    #[serde(skip_serializing_if = "Option::is_none")]
1953    pub viewport: Option<Viewport>,
1954}
1955
1956/// Overrides the Device Orientation.
1957
1958#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1959#[serde(rename_all = "camelCase")]
1960pub struct SetDeviceOrientationOverrideParams {
1961    /// Mock alpha
1962
1963    pub alpha: f64,
1964    /// Mock beta
1965
1966    pub beta: f64,
1967    /// Mock gamma
1968
1969    pub gamma: f64,
1970}
1971
1972/// Set generic font families.
1973
1974#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1975#[serde(rename_all = "camelCase")]
1976pub struct SetFontFamiliesParams {
1977    /// Specifies font families to set. If a font family is not specified, it won't be changed.
1978
1979    pub fontFamilies: FontFamilies,
1980    /// Specifies font families to set for individual scripts.
1981
1982    #[serde(skip_serializing_if = "Option::is_none")]
1983    pub forScripts: Option<Vec<ScriptFontFamilies>>,
1984}
1985
1986/// Set default font sizes.
1987
1988#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1989#[serde(rename_all = "camelCase")]
1990pub struct SetFontSizesParams {
1991    /// Specifies font sizes to set. If a font size is not specified, it won't be changed.
1992
1993    pub fontSizes: FontSizes,
1994}
1995
1996/// Sets given markup as the document's HTML.
1997
1998#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1999#[serde(rename_all = "camelCase")]
2000pub struct SetDocumentContentParams {
2001    /// Frame id to set HTML for.
2002
2003    pub frameId: FrameId,
2004    /// HTML content to set.
2005
2006    pub html: String,
2007}
2008
2009/// Set the behavior when downloading a file.
2010
2011#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2012#[serde(rename_all = "camelCase")]
2013pub struct SetDownloadBehaviorParams {
2014    /// Whether to allow all or deny all download requests, or use default Chrome behavior if
2015    /// available (otherwise deny).
2016
2017    pub behavior: String,
2018    /// The default path to save downloaded files to. This is required if behavior is set to 'allow'
2019
2020    #[serde(skip_serializing_if = "Option::is_none")]
2021    pub downloadPath: Option<String>,
2022}
2023
2024/// Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
2025/// unavailable.
2026
2027#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2028#[serde(rename_all = "camelCase")]
2029pub struct SetGeolocationOverrideParams {
2030    /// Mock latitude
2031
2032    #[serde(skip_serializing_if = "Option::is_none")]
2033    pub latitude: Option<f64>,
2034    /// Mock longitude
2035
2036    #[serde(skip_serializing_if = "Option::is_none")]
2037    pub longitude: Option<f64>,
2038    /// Mock accuracy
2039
2040    #[serde(skip_serializing_if = "Option::is_none")]
2041    pub accuracy: Option<f64>,
2042}
2043
2044/// Controls whether page will emit lifecycle events.
2045
2046#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2047#[serde(rename_all = "camelCase")]
2048pub struct SetLifecycleEventsEnabledParams {
2049    /// If true, starts emitting lifecycle events.
2050
2051    pub enabled: bool,
2052}
2053
2054/// Toggles mouse event-based touch event emulation.
2055
2056#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2057#[serde(rename_all = "camelCase")]
2058pub struct SetTouchEmulationEnabledParams {
2059    /// Whether the touch event emulation should be enabled.
2060
2061    pub enabled: bool,
2062    /// Touch/gesture events configuration. Default: current platform.
2063
2064    #[serde(skip_serializing_if = "Option::is_none")]
2065    pub configuration: Option<String>,
2066}
2067
2068/// Starts sending each frame using the 'screencastFrame' event.
2069
2070#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2071#[serde(rename_all = "camelCase")]
2072pub struct StartScreencastParams {
2073    /// Image compression format.
2074
2075    #[serde(skip_serializing_if = "Option::is_none")]
2076    pub format: Option<String>,
2077    /// Compression quality from range \[0..100\].
2078
2079    #[serde(skip_serializing_if = "Option::is_none")]
2080    pub quality: Option<i64>,
2081    /// Maximum screenshot width.
2082
2083    #[serde(skip_serializing_if = "Option::is_none")]
2084    pub maxWidth: Option<u64>,
2085    /// Maximum screenshot height.
2086
2087    #[serde(skip_serializing_if = "Option::is_none")]
2088    pub maxHeight: Option<i64>,
2089    /// Send every n-th frame.
2090
2091    #[serde(skip_serializing_if = "Option::is_none")]
2092    pub everyNthFrame: Option<i64>,
2093}
2094
2095/// Tries to update the web lifecycle state of the page.
2096/// It will transition the page to the given state according to:
2097/// <https://github.com/WICG/web-lifecycle/>
2098
2099#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2100#[serde(rename_all = "camelCase")]
2101pub struct SetWebLifecycleStateParams {
2102    /// Target lifecycle state
2103
2104    pub state: String,
2105}
2106
2107/// Requests backend to produce compilation cache for the specified scripts.
2108/// 'scripts' are appended to the list of scripts for which the cache
2109/// would be produced. The list may be reset during page navigation.
2110/// When script with a matching URL is encountered, the cache is optionally
2111/// produced upon backend discretion, based on internal heuristics.
2112/// See also: 'Page.compilationCacheProduced'.
2113
2114#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2115#[serde(rename_all = "camelCase")]
2116pub struct ProduceCompilationCacheParams {
2117
2118    pub scripts: Vec<CompilationCacheParams>,
2119}
2120
2121/// Seeds compilation cache for given url. Compilation cache does not survive
2122/// cross-process navigation.
2123
2124#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2125#[serde(rename_all = "camelCase")]
2126pub struct AddCompilationCacheParams {
2127
2128    pub url: String,
2129    /// Base64-encoded data (Encoded as a base64 string when passed over JSON)
2130
2131    pub data: String,
2132}
2133
2134/// Sets the Secure Payment Confirmation transaction mode.
2135/// <https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode>
2136
2137#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2138#[serde(rename_all = "camelCase")]
2139pub struct SetSPCTransactionModeParams {
2140
2141    pub mode: String,
2142}
2143
2144/// Extensions for Custom Handlers API:
2145/// <https://html.spec.whatwg.org/multipage/system-state.html#rph-automation>
2146
2147#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2148#[serde(rename_all = "camelCase")]
2149pub struct SetRPHRegistrationModeParams {
2150
2151    pub mode: String,
2152}
2153
2154/// Generates a report for testing.
2155
2156#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2157#[serde(rename_all = "camelCase")]
2158pub struct GenerateTestReportParams {
2159    /// Message to be displayed in the report.
2160
2161    pub message: String,
2162    /// Specifies the endpoint group to deliver the report to.
2163
2164    #[serde(skip_serializing_if = "Option::is_none")]
2165    pub group: Option<String>,
2166}
2167
2168/// Intercept file chooser requests and transfer control to protocol clients.
2169/// When file chooser interception is enabled, native file chooser dialog is not shown.
2170/// Instead, a protocol event 'Page.fileChooserOpened' is emitted.
2171
2172#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2173#[serde(rename_all = "camelCase")]
2174pub struct SetInterceptFileChooserDialogParams {
2175
2176    pub enabled: bool,
2177    /// If true, cancels the dialog by emitting relevant events (if any)
2178    /// in addition to not showing it if the interception is enabled
2179    /// (default: false).
2180
2181    #[serde(skip_serializing_if = "Option::is_none")]
2182    pub cancel: Option<bool>,
2183}
2184
2185/// Enable/disable prerendering manually.
2186/// 
2187/// This command is a short-term solution for <https://crbug.com/1440085.>
2188/// See <https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA>
2189/// for more details.
2190/// 
2191/// TODO(<https://crbug.com/1440085>): Remove this once Puppeteer supports tab targets.
2192
2193#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2194#[serde(rename_all = "camelCase")]
2195pub struct SetPrerenderingAllowedParams {
2196
2197    pub isAllowed: bool,
2198}
2199
2200/// Get the annotated page content for the main frame.
2201/// This is an experimental command that is subject to change.
2202
2203#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2204#[serde(rename_all = "camelCase")]
2205pub struct GetAnnotatedPageContentParams {
2206    /// Whether to include actionable information. Defaults to true.
2207
2208    #[serde(skip_serializing_if = "Option::is_none")]
2209    pub includeActionableInformation: Option<bool>,
2210}
2211
2212/// Get the annotated page content for the main frame.
2213/// This is an experimental command that is subject to change.
2214
2215#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2216#[serde(rename_all = "camelCase")]
2217pub struct GetAnnotatedPageContentReturns {
2218    /// The annotated page content as a base64 encoded protobuf.
2219    /// The format is defined by the 'AnnotatedPageContent' message in
2220    /// components/optimization_guide/proto/features/common_quality_data.proto (Encoded as a base64 string when passed over JSON)
2221
2222    pub content: String,
2223}