Skip to main content

browser_protocol/page/
mod.rs

1//! Actions and events related to the inspected page belong to the page domain.
2use serde::{Serialize, Deserialize};
3use serde_json::Value as JsonValue;
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
1250impl AddScriptToEvaluateOnLoadParams { pub const METHOD: &'static str = "Page.addScriptToEvaluateOnLoad"; }
1251
1252impl crate::CdpCommand for AddScriptToEvaluateOnLoadParams {
1253    const METHOD: &'static str = "Page.addScriptToEvaluateOnLoad";
1254    type Response = AddScriptToEvaluateOnLoadReturns;
1255}
1256
1257/// Evaluates given script in every frame upon creation (before loading frame's scripts).
1258
1259#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1260#[serde(rename_all = "camelCase")]
1261pub struct AddScriptToEvaluateOnNewDocumentParams {
1262
1263    pub source: String,
1264    /// If specified, creates an isolated world with the given name and evaluates given script in it.
1265    /// This world name will be used as the ExecutionContextDescription::name when the corresponding
1266    /// event is emitted.
1267
1268    #[serde(skip_serializing_if = "Option::is_none")]
1269    pub worldName: Option<String>,
1270    /// Specifies whether command line API should be available to the script, defaults
1271    /// to false.
1272
1273    #[serde(skip_serializing_if = "Option::is_none")]
1274    pub includeCommandLineAPI: Option<bool>,
1275    /// If true, runs the script immediately on existing execution contexts or worlds.
1276    /// Default: false.
1277
1278    #[serde(skip_serializing_if = "Option::is_none")]
1279    pub runImmediately: Option<bool>,
1280}
1281
1282/// Evaluates given script in every frame upon creation (before loading frame's scripts).
1283
1284#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1285#[serde(rename_all = "camelCase")]
1286pub struct AddScriptToEvaluateOnNewDocumentReturns {
1287    /// Identifier of the added script.
1288
1289    pub identifier: ScriptIdentifier,
1290}
1291
1292impl AddScriptToEvaluateOnNewDocumentParams { pub const METHOD: &'static str = "Page.addScriptToEvaluateOnNewDocument"; }
1293
1294impl crate::CdpCommand for AddScriptToEvaluateOnNewDocumentParams {
1295    const METHOD: &'static str = "Page.addScriptToEvaluateOnNewDocument";
1296    type Response = AddScriptToEvaluateOnNewDocumentReturns;
1297}
1298
1299#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1300pub struct BringToFrontParams {}
1301
1302impl BringToFrontParams { pub const METHOD: &'static str = "Page.bringToFront"; }
1303
1304impl crate::CdpCommand for BringToFrontParams {
1305    const METHOD: &'static str = "Page.bringToFront";
1306    type Response = crate::EmptyReturns;
1307}
1308
1309/// Capture page screenshot.
1310
1311#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1312#[serde(rename_all = "camelCase")]
1313pub struct CaptureScreenshotParams {
1314    /// Image compression format (defaults to png).
1315
1316    #[serde(skip_serializing_if = "Option::is_none")]
1317    pub format: Option<String>,
1318    /// Compression quality from range [0..100] (jpeg only).
1319
1320    #[serde(skip_serializing_if = "Option::is_none")]
1321    pub quality: Option<i64>,
1322    /// Capture the screenshot of a given region only.
1323
1324    #[serde(skip_serializing_if = "Option::is_none")]
1325    pub clip: Option<Viewport>,
1326    /// Capture the screenshot from the surface, rather than the view. Defaults to true.
1327
1328    #[serde(skip_serializing_if = "Option::is_none")]
1329    pub fromSurface: Option<bool>,
1330    /// Capture the screenshot beyond the viewport. Defaults to false.
1331
1332    #[serde(skip_serializing_if = "Option::is_none")]
1333    pub captureBeyondViewport: Option<bool>,
1334    /// Optimize image encoding for speed, not for resulting size (defaults to false)
1335
1336    #[serde(skip_serializing_if = "Option::is_none")]
1337    pub optimizeForSpeed: Option<bool>,
1338}
1339
1340/// Capture page screenshot.
1341
1342#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1343#[serde(rename_all = "camelCase")]
1344pub struct CaptureScreenshotReturns {
1345    /// Base64-encoded image data. (Encoded as a base64 string when passed over JSON)
1346
1347    pub data: String,
1348}
1349
1350impl CaptureScreenshotParams { pub const METHOD: &'static str = "Page.captureScreenshot"; }
1351
1352impl crate::CdpCommand for CaptureScreenshotParams {
1353    const METHOD: &'static str = "Page.captureScreenshot";
1354    type Response = CaptureScreenshotReturns;
1355}
1356
1357/// Returns a snapshot of the page as a string. For MHTML format, the serialization includes
1358/// iframes, shadow DOM, external resources, and element-inline styles.
1359
1360#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1361#[serde(rename_all = "camelCase")]
1362pub struct CaptureSnapshotParams {
1363    /// Format (defaults to mhtml).
1364
1365    #[serde(skip_serializing_if = "Option::is_none")]
1366    pub format: Option<String>,
1367}
1368
1369/// Returns a snapshot of the page as a string. For MHTML format, the serialization includes
1370/// iframes, shadow DOM, external resources, and element-inline styles.
1371
1372#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1373#[serde(rename_all = "camelCase")]
1374pub struct CaptureSnapshotReturns {
1375    /// Serialized page data.
1376
1377    pub data: String,
1378}
1379
1380impl CaptureSnapshotParams { pub const METHOD: &'static str = "Page.captureSnapshot"; }
1381
1382impl crate::CdpCommand for CaptureSnapshotParams {
1383    const METHOD: &'static str = "Page.captureSnapshot";
1384    type Response = CaptureSnapshotReturns;
1385}
1386
1387#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1388pub struct ClearDeviceMetricsOverrideParams {}
1389
1390impl ClearDeviceMetricsOverrideParams { pub const METHOD: &'static str = "Page.clearDeviceMetricsOverride"; }
1391
1392impl crate::CdpCommand for ClearDeviceMetricsOverrideParams {
1393    const METHOD: &'static str = "Page.clearDeviceMetricsOverride";
1394    type Response = crate::EmptyReturns;
1395}
1396
1397#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1398pub struct ClearDeviceOrientationOverrideParams {}
1399
1400impl ClearDeviceOrientationOverrideParams { pub const METHOD: &'static str = "Page.clearDeviceOrientationOverride"; }
1401
1402impl crate::CdpCommand for ClearDeviceOrientationOverrideParams {
1403    const METHOD: &'static str = "Page.clearDeviceOrientationOverride";
1404    type Response = crate::EmptyReturns;
1405}
1406
1407#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1408pub struct ClearGeolocationOverrideParams {}
1409
1410impl ClearGeolocationOverrideParams { pub const METHOD: &'static str = "Page.clearGeolocationOverride"; }
1411
1412impl crate::CdpCommand for ClearGeolocationOverrideParams {
1413    const METHOD: &'static str = "Page.clearGeolocationOverride";
1414    type Response = crate::EmptyReturns;
1415}
1416
1417/// Creates an isolated world for the given frame.
1418
1419#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1420#[serde(rename_all = "camelCase")]
1421pub struct CreateIsolatedWorldParams {
1422    /// Id of the frame in which the isolated world should be created.
1423
1424    pub frameId: FrameId,
1425    /// An optional name which is reported in the Execution Context.
1426
1427    #[serde(skip_serializing_if = "Option::is_none")]
1428    pub worldName: Option<String>,
1429    /// Whether or not universal access should be granted to the isolated world. This is a powerful
1430    /// option, use with caution.
1431
1432    #[serde(skip_serializing_if = "Option::is_none")]
1433    pub grantUniveralAccess: Option<bool>,
1434}
1435
1436/// Creates an isolated world for the given frame.
1437
1438#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1439#[serde(rename_all = "camelCase")]
1440pub struct CreateIsolatedWorldReturns {
1441    /// Execution context of the isolated world.
1442
1443    pub executionContextId: crate::runtime::ExecutionContextId,
1444}
1445
1446impl CreateIsolatedWorldParams { pub const METHOD: &'static str = "Page.createIsolatedWorld"; }
1447
1448impl crate::CdpCommand for CreateIsolatedWorldParams {
1449    const METHOD: &'static str = "Page.createIsolatedWorld";
1450    type Response = CreateIsolatedWorldReturns;
1451}
1452
1453/// Deletes browser cookie with given name, domain and path.
1454
1455#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1456#[serde(rename_all = "camelCase")]
1457pub struct DeleteCookieParams {
1458    /// Name of the cookie to remove.
1459
1460    pub cookieName: String,
1461    /// URL to match cooke domain and path.
1462
1463    pub url: String,
1464}
1465
1466impl DeleteCookieParams { pub const METHOD: &'static str = "Page.deleteCookie"; }
1467
1468impl crate::CdpCommand for DeleteCookieParams {
1469    const METHOD: &'static str = "Page.deleteCookie";
1470    type Response = crate::EmptyReturns;
1471}
1472
1473#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1474pub struct DisableParams {}
1475
1476impl DisableParams { pub const METHOD: &'static str = "Page.disable"; }
1477
1478impl crate::CdpCommand for DisableParams {
1479    const METHOD: &'static str = "Page.disable";
1480    type Response = crate::EmptyReturns;
1481}
1482
1483/// Enables page domain notifications.
1484
1485#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1486#[serde(rename_all = "camelCase")]
1487pub struct EnableParams {
1488    /// If true, the 'Page.fileChooserOpened' event will be emitted regardless of the state set by
1489    /// 'Page.setInterceptFileChooserDialog' command (default: false).
1490
1491    #[serde(skip_serializing_if = "Option::is_none")]
1492    pub enableFileChooserOpenedEvent: Option<bool>,
1493}
1494
1495impl EnableParams { pub const METHOD: &'static str = "Page.enable"; }
1496
1497impl crate::CdpCommand for EnableParams {
1498    const METHOD: &'static str = "Page.enable";
1499    type Response = crate::EmptyReturns;
1500}
1501
1502/// Gets the processed manifest for this current document.
1503/// This API always waits for the manifest to be loaded.
1504/// If manifestId is provided, and it does not match the manifest of the
1505/// current document, this API errors out.
1506/// If there is not a loaded page, this API errors out immediately.
1507
1508#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1509#[serde(rename_all = "camelCase")]
1510pub struct GetAppManifestParams {
1511
1512    #[serde(skip_serializing_if = "Option::is_none")]
1513    pub manifestId: Option<String>,
1514}
1515
1516/// Gets the processed manifest for this current document.
1517/// This API always waits for the manifest to be loaded.
1518/// If manifestId is provided, and it does not match the manifest of the
1519/// current document, this API errors out.
1520/// If there is not a loaded page, this API errors out immediately.
1521
1522#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1523#[serde(rename_all = "camelCase")]
1524pub struct GetAppManifestReturns {
1525    /// Manifest location.
1526
1527    pub url: String,
1528
1529    pub errors: Vec<AppManifestError>,
1530    /// Manifest content.
1531
1532    #[serde(skip_serializing_if = "Option::is_none")]
1533    pub data: Option<String>,
1534    /// Parsed manifest properties. Deprecated, use manifest instead.
1535
1536    #[serde(skip_serializing_if = "Option::is_none")]
1537    pub parsed: Option<AppManifestParsedProperties>,
1538
1539    pub manifest: WebAppManifest,
1540}
1541
1542impl GetAppManifestParams { pub const METHOD: &'static str = "Page.getAppManifest"; }
1543
1544impl crate::CdpCommand for GetAppManifestParams {
1545    const METHOD: &'static str = "Page.getAppManifest";
1546    type Response = GetAppManifestReturns;
1547}
1548
1549
1550#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1551#[serde(rename_all = "camelCase")]
1552pub struct GetInstallabilityErrorsReturns {
1553
1554    pub installabilityErrors: Vec<InstallabilityError>,
1555}
1556
1557#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1558pub struct GetInstallabilityErrorsParams {}
1559
1560impl GetInstallabilityErrorsParams { pub const METHOD: &'static str = "Page.getInstallabilityErrors"; }
1561
1562impl crate::CdpCommand for GetInstallabilityErrorsParams {
1563    const METHOD: &'static str = "Page.getInstallabilityErrors";
1564    type Response = GetInstallabilityErrorsReturns;
1565}
1566
1567/// Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation.
1568
1569#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1570#[serde(rename_all = "camelCase")]
1571pub struct GetManifestIconsReturns {
1572
1573    #[serde(skip_serializing_if = "Option::is_none")]
1574    pub primaryIcon: Option<String>,
1575}
1576
1577#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1578pub struct GetManifestIconsParams {}
1579
1580impl GetManifestIconsParams { pub const METHOD: &'static str = "Page.getManifestIcons"; }
1581
1582impl crate::CdpCommand for GetManifestIconsParams {
1583    const METHOD: &'static str = "Page.getManifestIcons";
1584    type Response = GetManifestIconsReturns;
1585}
1586
1587/// Returns the unique (PWA) app id.
1588/// Only returns values if the feature flag 'WebAppEnableManifestId' is enabled
1589
1590#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1591#[serde(rename_all = "camelCase")]
1592pub struct GetAppIdReturns {
1593    /// App id, either from manifest's id attribute or computed from start_url
1594
1595    #[serde(skip_serializing_if = "Option::is_none")]
1596    pub appId: Option<String>,
1597    /// Recommendation for manifest's id attribute to match current id computed from start_url
1598
1599    #[serde(skip_serializing_if = "Option::is_none")]
1600    pub recommendedId: Option<String>,
1601}
1602
1603#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1604pub struct GetAppIdParams {}
1605
1606impl GetAppIdParams { pub const METHOD: &'static str = "Page.getAppId"; }
1607
1608impl crate::CdpCommand for GetAppIdParams {
1609    const METHOD: &'static str = "Page.getAppId";
1610    type Response = GetAppIdReturns;
1611}
1612
1613
1614#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1615#[serde(rename_all = "camelCase")]
1616pub struct GetAdScriptAncestryParams {
1617
1618    pub frameId: FrameId,
1619}
1620
1621
1622#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1623#[serde(rename_all = "camelCase")]
1624pub struct GetAdScriptAncestryReturns {
1625    /// The ancestry chain of ad script identifiers leading to this frame's
1626    /// creation, along with the root script's filterlist rule. The ancestry
1627    /// chain is ordered from the most immediate script (in the frame creation
1628    /// stack) to more distant ancestors (that created the immediately preceding
1629    /// script). Only sent if frame is labelled as an ad and ids are available.
1630
1631    #[serde(skip_serializing_if = "Option::is_none")]
1632    pub adScriptAncestry: Option<crate::network::AdAncestry>,
1633}
1634
1635impl GetAdScriptAncestryParams { pub const METHOD: &'static str = "Page.getAdScriptAncestry"; }
1636
1637impl crate::CdpCommand for GetAdScriptAncestryParams {
1638    const METHOD: &'static str = "Page.getAdScriptAncestry";
1639    type Response = GetAdScriptAncestryReturns;
1640}
1641
1642/// Returns present frame tree structure.
1643
1644#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1645#[serde(rename_all = "camelCase")]
1646pub struct GetFrameTreeReturns {
1647    /// Present frame tree structure.
1648
1649    pub frameTree: FrameTree,
1650}
1651
1652#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1653pub struct GetFrameTreeParams {}
1654
1655impl GetFrameTreeParams { pub const METHOD: &'static str = "Page.getFrameTree"; }
1656
1657impl crate::CdpCommand for GetFrameTreeParams {
1658    const METHOD: &'static str = "Page.getFrameTree";
1659    type Response = GetFrameTreeReturns;
1660}
1661
1662/// Returns metrics relating to the layouting of the page, such as viewport bounds/scale.
1663
1664#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1665#[serde(rename_all = "camelCase")]
1666pub struct GetLayoutMetricsReturns {
1667    /// Deprecated metrics relating to the layout viewport. Is in device pixels. Use 'cssLayoutViewport' instead.
1668
1669    pub layoutViewport: LayoutViewport,
1670    /// Deprecated metrics relating to the visual viewport. Is in device pixels. Use 'cssVisualViewport' instead.
1671
1672    pub visualViewport: VisualViewport,
1673    /// Deprecated size of scrollable area. Is in DP. Use 'cssContentSize' instead.
1674
1675    pub contentSize: crate::dom::Rect,
1676    /// Metrics relating to the layout viewport in CSS pixels.
1677
1678    pub cssLayoutViewport: LayoutViewport,
1679    /// Metrics relating to the visual viewport in CSS pixels.
1680
1681    pub cssVisualViewport: VisualViewport,
1682    /// Size of scrollable area in CSS pixels.
1683
1684    pub cssContentSize: crate::dom::Rect,
1685}
1686
1687#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1688pub struct GetLayoutMetricsParams {}
1689
1690impl GetLayoutMetricsParams { pub const METHOD: &'static str = "Page.getLayoutMetrics"; }
1691
1692impl crate::CdpCommand for GetLayoutMetricsParams {
1693    const METHOD: &'static str = "Page.getLayoutMetrics";
1694    type Response = GetLayoutMetricsReturns;
1695}
1696
1697/// Returns navigation history for the current page.
1698
1699#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1700#[serde(rename_all = "camelCase")]
1701pub struct GetNavigationHistoryReturns {
1702    /// Index of the current navigation history entry.
1703
1704    pub currentIndex: u64,
1705    /// Array of navigation history entries.
1706
1707    pub entries: Vec<NavigationEntry>,
1708}
1709
1710#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1711pub struct GetNavigationHistoryParams {}
1712
1713impl GetNavigationHistoryParams { pub const METHOD: &'static str = "Page.getNavigationHistory"; }
1714
1715impl crate::CdpCommand for GetNavigationHistoryParams {
1716    const METHOD: &'static str = "Page.getNavigationHistory";
1717    type Response = GetNavigationHistoryReturns;
1718}
1719
1720#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1721pub struct ResetNavigationHistoryParams {}
1722
1723impl ResetNavigationHistoryParams { pub const METHOD: &'static str = "Page.resetNavigationHistory"; }
1724
1725impl crate::CdpCommand for ResetNavigationHistoryParams {
1726    const METHOD: &'static str = "Page.resetNavigationHistory";
1727    type Response = crate::EmptyReturns;
1728}
1729
1730/// Returns content of the given resource.
1731
1732#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1733#[serde(rename_all = "camelCase")]
1734pub struct GetResourceContentParams {
1735    /// Frame id to get resource for.
1736
1737    pub frameId: FrameId,
1738    /// URL of the resource to get content for.
1739
1740    pub url: String,
1741}
1742
1743/// Returns content of the given resource.
1744
1745#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1746#[serde(rename_all = "camelCase")]
1747pub struct GetResourceContentReturns {
1748    /// Resource content.
1749
1750    pub content: String,
1751    /// True, if content was served as base64.
1752
1753    pub base64Encoded: bool,
1754}
1755
1756impl GetResourceContentParams { pub const METHOD: &'static str = "Page.getResourceContent"; }
1757
1758impl crate::CdpCommand for GetResourceContentParams {
1759    const METHOD: &'static str = "Page.getResourceContent";
1760    type Response = GetResourceContentReturns;
1761}
1762
1763/// Returns present frame / resource tree structure.
1764
1765#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1766#[serde(rename_all = "camelCase")]
1767pub struct GetResourceTreeReturns {
1768    /// Present frame / resource tree structure.
1769
1770    pub frameTree: FrameResourceTree,
1771}
1772
1773#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1774pub struct GetResourceTreeParams {}
1775
1776impl GetResourceTreeParams { pub const METHOD: &'static str = "Page.getResourceTree"; }
1777
1778impl crate::CdpCommand for GetResourceTreeParams {
1779    const METHOD: &'static str = "Page.getResourceTree";
1780    type Response = GetResourceTreeReturns;
1781}
1782
1783/// Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
1784
1785#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1786#[serde(rename_all = "camelCase")]
1787pub struct HandleJavaScriptDialogParams {
1788    /// Whether to accept or dismiss the dialog.
1789
1790    pub accept: bool,
1791    /// The text to enter into the dialog prompt before accepting. Used only if this is a prompt
1792    /// dialog.
1793
1794    #[serde(skip_serializing_if = "Option::is_none")]
1795    pub promptText: Option<String>,
1796}
1797
1798impl HandleJavaScriptDialogParams { pub const METHOD: &'static str = "Page.handleJavaScriptDialog"; }
1799
1800impl crate::CdpCommand for HandleJavaScriptDialogParams {
1801    const METHOD: &'static str = "Page.handleJavaScriptDialog";
1802    type Response = crate::EmptyReturns;
1803}
1804
1805/// Navigates current page to the given URL.
1806
1807#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1808#[serde(rename_all = "camelCase")]
1809pub struct NavigateParams {
1810    /// URL to navigate the page to.
1811
1812    pub url: String,
1813    /// Referrer URL.
1814
1815    #[serde(skip_serializing_if = "Option::is_none")]
1816    pub referrer: Option<String>,
1817    /// Intended transition type.
1818
1819    #[serde(skip_serializing_if = "Option::is_none")]
1820    pub transitionType: Option<TransitionType>,
1821    /// Frame id to navigate, if not specified navigates the top frame.
1822
1823    #[serde(skip_serializing_if = "Option::is_none")]
1824    pub frameId: Option<FrameId>,
1825    /// Referrer-policy used for the navigation.
1826
1827    #[serde(skip_serializing_if = "Option::is_none")]
1828    pub referrerPolicy: Option<ReferrerPolicy>,
1829}
1830
1831/// Navigates current page to the given URL.
1832
1833#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1834#[serde(rename_all = "camelCase")]
1835pub struct NavigateReturns {
1836    /// Frame id that has navigated (or failed to navigate)
1837
1838    pub frameId: FrameId,
1839    /// Loader identifier. This is omitted in case of same-document navigation,
1840    /// as the previously committed loaderId would not change.
1841
1842    #[serde(skip_serializing_if = "Option::is_none")]
1843    pub loaderId: Option<crate::network::LoaderId>,
1844    /// User friendly error message, present if and only if navigation has failed.
1845
1846    #[serde(skip_serializing_if = "Option::is_none")]
1847    pub errorText: Option<String>,
1848    /// Whether the navigation resulted in a download.
1849
1850    #[serde(skip_serializing_if = "Option::is_none")]
1851    pub isDownload: Option<bool>,
1852}
1853
1854impl NavigateParams { pub const METHOD: &'static str = "Page.navigate"; }
1855
1856impl crate::CdpCommand for NavigateParams {
1857    const METHOD: &'static str = "Page.navigate";
1858    type Response = NavigateReturns;
1859}
1860
1861/// Navigates current page to the given history entry.
1862
1863#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1864#[serde(rename_all = "camelCase")]
1865pub struct NavigateToHistoryEntryParams {
1866    /// Unique id of the entry to navigate to.
1867
1868    pub entryId: u64,
1869}
1870
1871impl NavigateToHistoryEntryParams { pub const METHOD: &'static str = "Page.navigateToHistoryEntry"; }
1872
1873impl crate::CdpCommand for NavigateToHistoryEntryParams {
1874    const METHOD: &'static str = "Page.navigateToHistoryEntry";
1875    type Response = crate::EmptyReturns;
1876}
1877
1878/// Print page as PDF.
1879
1880#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1881#[serde(rename_all = "camelCase")]
1882pub struct PrintToPDFParams {
1883    /// Paper orientation. Defaults to false.
1884
1885    #[serde(skip_serializing_if = "Option::is_none")]
1886    pub landscape: Option<bool>,
1887    /// Display header and footer. Defaults to false.
1888
1889    #[serde(skip_serializing_if = "Option::is_none")]
1890    pub displayHeaderFooter: Option<bool>,
1891    /// Print background graphics. Defaults to false.
1892
1893    #[serde(skip_serializing_if = "Option::is_none")]
1894    pub printBackground: Option<bool>,
1895    /// Scale of the webpage rendering. Defaults to 1.
1896
1897    #[serde(skip_serializing_if = "Option::is_none")]
1898    pub scale: Option<f64>,
1899    /// Paper width in inches. Defaults to 8.5 inches.
1900
1901    #[serde(skip_serializing_if = "Option::is_none")]
1902    pub paperWidth: Option<f64>,
1903    /// Paper height in inches. Defaults to 11 inches.
1904
1905    #[serde(skip_serializing_if = "Option::is_none")]
1906    pub paperHeight: Option<f64>,
1907    /// Top margin in inches. Defaults to 1cm (~0.4 inches).
1908
1909    #[serde(skip_serializing_if = "Option::is_none")]
1910    pub marginTop: Option<f64>,
1911    /// Bottom margin in inches. Defaults to 1cm (~0.4 inches).
1912
1913    #[serde(skip_serializing_if = "Option::is_none")]
1914    pub marginBottom: Option<f64>,
1915    /// Left margin in inches. Defaults to 1cm (~0.4 inches).
1916
1917    #[serde(skip_serializing_if = "Option::is_none")]
1918    pub marginLeft: Option<f64>,
1919    /// Right margin in inches. Defaults to 1cm (~0.4 inches).
1920
1921    #[serde(skip_serializing_if = "Option::is_none")]
1922    pub marginRight: Option<f64>,
1923    /// Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are
1924    /// printed in the document order, not in the order specified, and no
1925    /// more than once.
1926    /// Defaults to empty string, which implies the entire document is printed.
1927    /// The page numbers are quietly capped to actual page count of the
1928    /// document, and ranges beyond the end of the document are ignored.
1929    /// If this results in no pages to print, an error is reported.
1930    /// It is an error to specify a range with start greater than end.
1931
1932    #[serde(skip_serializing_if = "Option::is_none")]
1933    pub pageRanges: Option<String>,
1934    /// HTML template for the print header. Should be valid HTML markup with following
1935    /// classes used to inject printing values into them:
1936    /// - 'date': formatted print date
1937    /// - 'title': document title
1938    /// - 'url': document location
1939    /// - 'pageNumber': current page number
1940    /// - 'totalPages': total pages in the document
1941    /// 
1942    /// For example, '<span class=title></span>' would generate span containing the title.
1943
1944    #[serde(skip_serializing_if = "Option::is_none")]
1945    pub headerTemplate: Option<String>,
1946    /// HTML template for the print footer. Should use the same format as the 'headerTemplate'.
1947
1948    #[serde(skip_serializing_if = "Option::is_none")]
1949    pub footerTemplate: Option<String>,
1950    /// Whether or not to prefer page size as defined by css. Defaults to false,
1951    /// in which case the content will be scaled to fit the paper size.
1952
1953    #[serde(skip_serializing_if = "Option::is_none")]
1954    pub preferCSSPageSize: Option<bool>,
1955    /// return as stream
1956
1957    #[serde(skip_serializing_if = "Option::is_none")]
1958    pub transferMode: Option<String>,
1959    /// Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice.
1960
1961    #[serde(skip_serializing_if = "Option::is_none")]
1962    pub generateTaggedPDF: Option<bool>,
1963    /// Whether or not to embed the document outline into the PDF.
1964
1965    #[serde(skip_serializing_if = "Option::is_none")]
1966    pub generateDocumentOutline: Option<bool>,
1967}
1968
1969/// Print page as PDF.
1970
1971#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1972#[serde(rename_all = "camelCase")]
1973pub struct PrintToPDFReturns {
1974    /// Base64-encoded pdf data. Empty if |returnAsStream| is specified. (Encoded as a base64 string when passed over JSON)
1975
1976    pub data: String,
1977    /// A handle of the stream that holds resulting PDF data.
1978
1979    #[serde(skip_serializing_if = "Option::is_none")]
1980    pub stream: Option<crate::io::StreamHandle>,
1981}
1982
1983impl PrintToPDFParams { pub const METHOD: &'static str = "Page.printToPDF"; }
1984
1985impl crate::CdpCommand for PrintToPDFParams {
1986    const METHOD: &'static str = "Page.printToPDF";
1987    type Response = PrintToPDFReturns;
1988}
1989
1990/// Reloads given page optionally ignoring the cache.
1991
1992#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1993#[serde(rename_all = "camelCase")]
1994pub struct ReloadParams {
1995    /// If true, browser cache is ignored (as if the user pressed Shift+refresh).
1996
1997    #[serde(skip_serializing_if = "Option::is_none")]
1998    pub ignoreCache: Option<bool>,
1999    /// If set, the script will be injected into all frames of the inspected page after reload.
2000    /// Argument will be ignored if reloading dataURL origin.
2001
2002    #[serde(skip_serializing_if = "Option::is_none")]
2003    pub scriptToEvaluateOnLoad: Option<String>,
2004    /// If set, an error will be thrown if the target page's main frame's
2005    /// loader id does not match the provided id. This prevents accidentally
2006    /// reloading an unintended target in case there's a racing navigation.
2007
2008    #[serde(skip_serializing_if = "Option::is_none")]
2009    pub loaderId: Option<crate::network::LoaderId>,
2010}
2011
2012impl ReloadParams { pub const METHOD: &'static str = "Page.reload"; }
2013
2014impl crate::CdpCommand for ReloadParams {
2015    const METHOD: &'static str = "Page.reload";
2016    type Response = crate::EmptyReturns;
2017}
2018
2019/// Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
2020
2021#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2022#[serde(rename_all = "camelCase")]
2023pub struct RemoveScriptToEvaluateOnLoadParams {
2024
2025    pub identifier: ScriptIdentifier,
2026}
2027
2028impl RemoveScriptToEvaluateOnLoadParams { pub const METHOD: &'static str = "Page.removeScriptToEvaluateOnLoad"; }
2029
2030impl crate::CdpCommand for RemoveScriptToEvaluateOnLoadParams {
2031    const METHOD: &'static str = "Page.removeScriptToEvaluateOnLoad";
2032    type Response = crate::EmptyReturns;
2033}
2034
2035/// Removes given script from the list.
2036
2037#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2038#[serde(rename_all = "camelCase")]
2039pub struct RemoveScriptToEvaluateOnNewDocumentParams {
2040
2041    pub identifier: ScriptIdentifier,
2042}
2043
2044impl RemoveScriptToEvaluateOnNewDocumentParams { pub const METHOD: &'static str = "Page.removeScriptToEvaluateOnNewDocument"; }
2045
2046impl crate::CdpCommand for RemoveScriptToEvaluateOnNewDocumentParams {
2047    const METHOD: &'static str = "Page.removeScriptToEvaluateOnNewDocument";
2048    type Response = crate::EmptyReturns;
2049}
2050
2051/// Acknowledges that a screencast frame has been received by the frontend.
2052
2053#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2054#[serde(rename_all = "camelCase")]
2055pub struct ScreencastFrameAckParams {
2056    /// Frame number.
2057
2058    pub sessionId: u64,
2059}
2060
2061impl ScreencastFrameAckParams { pub const METHOD: &'static str = "Page.screencastFrameAck"; }
2062
2063impl crate::CdpCommand for ScreencastFrameAckParams {
2064    const METHOD: &'static str = "Page.screencastFrameAck";
2065    type Response = crate::EmptyReturns;
2066}
2067
2068/// Searches for given string in resource content.
2069
2070#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2071#[serde(rename_all = "camelCase")]
2072pub struct SearchInResourceParams {
2073    /// Frame id for resource to search in.
2074
2075    pub frameId: FrameId,
2076    /// URL of the resource to search in.
2077
2078    pub url: String,
2079    /// String to search for.
2080
2081    pub query: String,
2082    /// If true, search is case sensitive.
2083
2084    #[serde(skip_serializing_if = "Option::is_none")]
2085    pub caseSensitive: Option<bool>,
2086    /// If true, treats string parameter as regex.
2087
2088    #[serde(skip_serializing_if = "Option::is_none")]
2089    pub isRegex: Option<bool>,
2090}
2091
2092/// Searches for given string in resource content.
2093
2094#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2095#[serde(rename_all = "camelCase")]
2096pub struct SearchInResourceReturns {
2097    /// List of search matches.
2098
2099    pub result: Vec<crate::debugger::SearchMatch>,
2100}
2101
2102impl SearchInResourceParams { pub const METHOD: &'static str = "Page.searchInResource"; }
2103
2104impl crate::CdpCommand for SearchInResourceParams {
2105    const METHOD: &'static str = "Page.searchInResource";
2106    type Response = SearchInResourceReturns;
2107}
2108
2109/// Enable Chrome's experimental ad filter on all sites.
2110
2111#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2112#[serde(rename_all = "camelCase")]
2113pub struct SetAdBlockingEnabledParams {
2114    /// Whether to block ads.
2115
2116    pub enabled: bool,
2117}
2118
2119impl SetAdBlockingEnabledParams { pub const METHOD: &'static str = "Page.setAdBlockingEnabled"; }
2120
2121impl crate::CdpCommand for SetAdBlockingEnabledParams {
2122    const METHOD: &'static str = "Page.setAdBlockingEnabled";
2123    type Response = crate::EmptyReturns;
2124}
2125
2126/// Enable page Content Security Policy by-passing.
2127
2128#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2129#[serde(rename_all = "camelCase")]
2130pub struct SetBypassCSPParams {
2131    /// Whether to bypass page CSP.
2132
2133    pub enabled: bool,
2134}
2135
2136impl SetBypassCSPParams { pub const METHOD: &'static str = "Page.setBypassCSP"; }
2137
2138impl crate::CdpCommand for SetBypassCSPParams {
2139    const METHOD: &'static str = "Page.setBypassCSP";
2140    type Response = crate::EmptyReturns;
2141}
2142
2143/// Get Permissions Policy state on given frame.
2144
2145#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2146#[serde(rename_all = "camelCase")]
2147pub struct GetPermissionsPolicyStateParams {
2148
2149    pub frameId: FrameId,
2150}
2151
2152/// Get Permissions Policy state on given frame.
2153
2154#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2155#[serde(rename_all = "camelCase")]
2156pub struct GetPermissionsPolicyStateReturns {
2157
2158    pub states: Vec<PermissionsPolicyFeatureState>,
2159}
2160
2161impl GetPermissionsPolicyStateParams { pub const METHOD: &'static str = "Page.getPermissionsPolicyState"; }
2162
2163impl crate::CdpCommand for GetPermissionsPolicyStateParams {
2164    const METHOD: &'static str = "Page.getPermissionsPolicyState";
2165    type Response = GetPermissionsPolicyStateReturns;
2166}
2167
2168/// Get Origin Trials on given frame.
2169
2170#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2171#[serde(rename_all = "camelCase")]
2172pub struct GetOriginTrialsParams {
2173
2174    pub frameId: FrameId,
2175}
2176
2177/// Get Origin Trials on given frame.
2178
2179#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2180#[serde(rename_all = "camelCase")]
2181pub struct GetOriginTrialsReturns {
2182
2183    pub originTrials: Vec<OriginTrial>,
2184}
2185
2186impl GetOriginTrialsParams { pub const METHOD: &'static str = "Page.getOriginTrials"; }
2187
2188impl crate::CdpCommand for GetOriginTrialsParams {
2189    const METHOD: &'static str = "Page.getOriginTrials";
2190    type Response = GetOriginTrialsReturns;
2191}
2192
2193/// Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
2194/// window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
2195/// query results).
2196
2197#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2198#[serde(rename_all = "camelCase")]
2199pub struct SetDeviceMetricsOverrideParams {
2200    /// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
2201
2202    pub width: u64,
2203    /// Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
2204
2205    pub height: i64,
2206    /// Overriding device scale factor value. 0 disables the override.
2207
2208    pub deviceScaleFactor: f64,
2209    /// Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text
2210    /// autosizing and more.
2211
2212    pub mobile: bool,
2213    /// Scale to apply to resulting view image.
2214
2215    #[serde(skip_serializing_if = "Option::is_none")]
2216    pub scale: Option<f64>,
2217    /// Overriding screen width value in pixels (minimum 0, maximum 10000000).
2218
2219    #[serde(skip_serializing_if = "Option::is_none")]
2220    pub screenWidth: Option<u64>,
2221    /// Overriding screen height value in pixels (minimum 0, maximum 10000000).
2222
2223    #[serde(skip_serializing_if = "Option::is_none")]
2224    pub screenHeight: Option<i64>,
2225    /// Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
2226
2227    #[serde(skip_serializing_if = "Option::is_none")]
2228    pub positionX: Option<i64>,
2229    /// Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
2230
2231    #[serde(skip_serializing_if = "Option::is_none")]
2232    pub positionY: Option<i64>,
2233    /// Do not set visible view size, rely upon explicit setVisibleSize call.
2234
2235    #[serde(skip_serializing_if = "Option::is_none")]
2236    pub dontSetVisibleSize: Option<bool>,
2237    /// Screen orientation override.
2238
2239    #[serde(skip_serializing_if = "Option::is_none")]
2240    pub screenOrientation: Option<crate::emulation::ScreenOrientation>,
2241    /// The viewport dimensions and scale. If not set, the override is cleared.
2242
2243    #[serde(skip_serializing_if = "Option::is_none")]
2244    pub viewport: Option<Viewport>,
2245}
2246
2247impl SetDeviceMetricsOverrideParams { pub const METHOD: &'static str = "Page.setDeviceMetricsOverride"; }
2248
2249impl crate::CdpCommand for SetDeviceMetricsOverrideParams {
2250    const METHOD: &'static str = "Page.setDeviceMetricsOverride";
2251    type Response = crate::EmptyReturns;
2252}
2253
2254/// Overrides the Device Orientation.
2255
2256#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2257#[serde(rename_all = "camelCase")]
2258pub struct SetDeviceOrientationOverrideParams {
2259    /// Mock alpha
2260
2261    pub alpha: f64,
2262    /// Mock beta
2263
2264    pub beta: f64,
2265    /// Mock gamma
2266
2267    pub gamma: f64,
2268}
2269
2270impl SetDeviceOrientationOverrideParams { pub const METHOD: &'static str = "Page.setDeviceOrientationOverride"; }
2271
2272impl crate::CdpCommand for SetDeviceOrientationOverrideParams {
2273    const METHOD: &'static str = "Page.setDeviceOrientationOverride";
2274    type Response = crate::EmptyReturns;
2275}
2276
2277/// Set generic font families.
2278
2279#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2280#[serde(rename_all = "camelCase")]
2281pub struct SetFontFamiliesParams {
2282    /// Specifies font families to set. If a font family is not specified, it won't be changed.
2283
2284    pub fontFamilies: FontFamilies,
2285    /// Specifies font families to set for individual scripts.
2286
2287    #[serde(skip_serializing_if = "Option::is_none")]
2288    pub forScripts: Option<Vec<ScriptFontFamilies>>,
2289}
2290
2291impl SetFontFamiliesParams { pub const METHOD: &'static str = "Page.setFontFamilies"; }
2292
2293impl crate::CdpCommand for SetFontFamiliesParams {
2294    const METHOD: &'static str = "Page.setFontFamilies";
2295    type Response = crate::EmptyReturns;
2296}
2297
2298/// Set default font sizes.
2299
2300#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2301#[serde(rename_all = "camelCase")]
2302pub struct SetFontSizesParams {
2303    /// Specifies font sizes to set. If a font size is not specified, it won't be changed.
2304
2305    pub fontSizes: FontSizes,
2306}
2307
2308impl SetFontSizesParams { pub const METHOD: &'static str = "Page.setFontSizes"; }
2309
2310impl crate::CdpCommand for SetFontSizesParams {
2311    const METHOD: &'static str = "Page.setFontSizes";
2312    type Response = crate::EmptyReturns;
2313}
2314
2315/// Sets given markup as the document's HTML.
2316
2317#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2318#[serde(rename_all = "camelCase")]
2319pub struct SetDocumentContentParams {
2320    /// Frame id to set HTML for.
2321
2322    pub frameId: FrameId,
2323    /// HTML content to set.
2324
2325    pub html: String,
2326}
2327
2328impl SetDocumentContentParams { pub const METHOD: &'static str = "Page.setDocumentContent"; }
2329
2330impl crate::CdpCommand for SetDocumentContentParams {
2331    const METHOD: &'static str = "Page.setDocumentContent";
2332    type Response = crate::EmptyReturns;
2333}
2334
2335/// Set the behavior when downloading a file.
2336
2337#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2338#[serde(rename_all = "camelCase")]
2339pub struct SetDownloadBehaviorParams {
2340    /// Whether to allow all or deny all download requests, or use default Chrome behavior if
2341    /// available (otherwise deny).
2342
2343    pub behavior: String,
2344    /// The default path to save downloaded files to. This is required if behavior is set to 'allow'
2345
2346    #[serde(skip_serializing_if = "Option::is_none")]
2347    pub downloadPath: Option<String>,
2348}
2349
2350impl SetDownloadBehaviorParams { pub const METHOD: &'static str = "Page.setDownloadBehavior"; }
2351
2352impl crate::CdpCommand for SetDownloadBehaviorParams {
2353    const METHOD: &'static str = "Page.setDownloadBehavior";
2354    type Response = crate::EmptyReturns;
2355}
2356
2357/// Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
2358/// unavailable.
2359
2360#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2361#[serde(rename_all = "camelCase")]
2362pub struct SetGeolocationOverrideParams {
2363    /// Mock latitude
2364
2365    #[serde(skip_serializing_if = "Option::is_none")]
2366    pub latitude: Option<f64>,
2367    /// Mock longitude
2368
2369    #[serde(skip_serializing_if = "Option::is_none")]
2370    pub longitude: Option<f64>,
2371    /// Mock accuracy
2372
2373    #[serde(skip_serializing_if = "Option::is_none")]
2374    pub accuracy: Option<f64>,
2375}
2376
2377impl SetGeolocationOverrideParams { pub const METHOD: &'static str = "Page.setGeolocationOverride"; }
2378
2379impl crate::CdpCommand for SetGeolocationOverrideParams {
2380    const METHOD: &'static str = "Page.setGeolocationOverride";
2381    type Response = crate::EmptyReturns;
2382}
2383
2384/// Controls whether page will emit lifecycle events.
2385
2386#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2387#[serde(rename_all = "camelCase")]
2388pub struct SetLifecycleEventsEnabledParams {
2389    /// If true, starts emitting lifecycle events.
2390
2391    pub enabled: bool,
2392}
2393
2394impl SetLifecycleEventsEnabledParams { pub const METHOD: &'static str = "Page.setLifecycleEventsEnabled"; }
2395
2396impl crate::CdpCommand for SetLifecycleEventsEnabledParams {
2397    const METHOD: &'static str = "Page.setLifecycleEventsEnabled";
2398    type Response = crate::EmptyReturns;
2399}
2400
2401/// Toggles mouse event-based touch event emulation.
2402
2403#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2404#[serde(rename_all = "camelCase")]
2405pub struct SetTouchEmulationEnabledParams {
2406    /// Whether the touch event emulation should be enabled.
2407
2408    pub enabled: bool,
2409    /// Touch/gesture events configuration. Default: current platform.
2410
2411    #[serde(skip_serializing_if = "Option::is_none")]
2412    pub configuration: Option<String>,
2413}
2414
2415impl SetTouchEmulationEnabledParams { pub const METHOD: &'static str = "Page.setTouchEmulationEnabled"; }
2416
2417impl crate::CdpCommand for SetTouchEmulationEnabledParams {
2418    const METHOD: &'static str = "Page.setTouchEmulationEnabled";
2419    type Response = crate::EmptyReturns;
2420}
2421
2422/// Starts sending each frame using the 'screencastFrame' event.
2423
2424#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2425#[serde(rename_all = "camelCase")]
2426pub struct StartScreencastParams {
2427    /// Image compression format.
2428
2429    #[serde(skip_serializing_if = "Option::is_none")]
2430    pub format: Option<String>,
2431    /// Compression quality from range [0..100].
2432
2433    #[serde(skip_serializing_if = "Option::is_none")]
2434    pub quality: Option<i64>,
2435    /// Maximum screenshot width.
2436
2437    #[serde(skip_serializing_if = "Option::is_none")]
2438    pub maxWidth: Option<u64>,
2439    /// Maximum screenshot height.
2440
2441    #[serde(skip_serializing_if = "Option::is_none")]
2442    pub maxHeight: Option<i64>,
2443    /// Send every n-th frame.
2444
2445    #[serde(skip_serializing_if = "Option::is_none")]
2446    pub everyNthFrame: Option<i64>,
2447}
2448
2449impl StartScreencastParams { pub const METHOD: &'static str = "Page.startScreencast"; }
2450
2451impl crate::CdpCommand for StartScreencastParams {
2452    const METHOD: &'static str = "Page.startScreencast";
2453    type Response = crate::EmptyReturns;
2454}
2455
2456#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2457pub struct StopLoadingParams {}
2458
2459impl StopLoadingParams { pub const METHOD: &'static str = "Page.stopLoading"; }
2460
2461impl crate::CdpCommand for StopLoadingParams {
2462    const METHOD: &'static str = "Page.stopLoading";
2463    type Response = crate::EmptyReturns;
2464}
2465
2466#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2467pub struct CrashParams {}
2468
2469impl CrashParams { pub const METHOD: &'static str = "Page.crash"; }
2470
2471impl crate::CdpCommand for CrashParams {
2472    const METHOD: &'static str = "Page.crash";
2473    type Response = crate::EmptyReturns;
2474}
2475
2476#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2477pub struct CloseParams {}
2478
2479impl CloseParams { pub const METHOD: &'static str = "Page.close"; }
2480
2481impl crate::CdpCommand for CloseParams {
2482    const METHOD: &'static str = "Page.close";
2483    type Response = crate::EmptyReturns;
2484}
2485
2486/// Tries to update the web lifecycle state of the page.
2487/// It will transition the page to the given state according to:
2488/// https://github.com/WICG/web-lifecycle/
2489
2490#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2491#[serde(rename_all = "camelCase")]
2492pub struct SetWebLifecycleStateParams {
2493    /// Target lifecycle state
2494
2495    pub state: String,
2496}
2497
2498impl SetWebLifecycleStateParams { pub const METHOD: &'static str = "Page.setWebLifecycleState"; }
2499
2500impl crate::CdpCommand for SetWebLifecycleStateParams {
2501    const METHOD: &'static str = "Page.setWebLifecycleState";
2502    type Response = crate::EmptyReturns;
2503}
2504
2505#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2506pub struct StopScreencastParams {}
2507
2508impl StopScreencastParams { pub const METHOD: &'static str = "Page.stopScreencast"; }
2509
2510impl crate::CdpCommand for StopScreencastParams {
2511    const METHOD: &'static str = "Page.stopScreencast";
2512    type Response = crate::EmptyReturns;
2513}
2514
2515/// Requests backend to produce compilation cache for the specified scripts.
2516/// 'scripts' are appended to the list of scripts for which the cache
2517/// would be produced. The list may be reset during page navigation.
2518/// When script with a matching URL is encountered, the cache is optionally
2519/// produced upon backend discretion, based on internal heuristics.
2520/// See also: 'Page.compilationCacheProduced'.
2521
2522#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2523#[serde(rename_all = "camelCase")]
2524pub struct ProduceCompilationCacheParams {
2525
2526    pub scripts: Vec<CompilationCacheParams>,
2527}
2528
2529impl ProduceCompilationCacheParams { pub const METHOD: &'static str = "Page.produceCompilationCache"; }
2530
2531impl crate::CdpCommand for ProduceCompilationCacheParams {
2532    const METHOD: &'static str = "Page.produceCompilationCache";
2533    type Response = crate::EmptyReturns;
2534}
2535
2536/// Seeds compilation cache for given url. Compilation cache does not survive
2537/// cross-process navigation.
2538
2539#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2540#[serde(rename_all = "camelCase")]
2541pub struct AddCompilationCacheParams {
2542
2543    pub url: String,
2544    /// Base64-encoded data (Encoded as a base64 string when passed over JSON)
2545
2546    pub data: String,
2547}
2548
2549impl AddCompilationCacheParams { pub const METHOD: &'static str = "Page.addCompilationCache"; }
2550
2551impl crate::CdpCommand for AddCompilationCacheParams {
2552    const METHOD: &'static str = "Page.addCompilationCache";
2553    type Response = crate::EmptyReturns;
2554}
2555
2556#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2557pub struct ClearCompilationCacheParams {}
2558
2559impl ClearCompilationCacheParams { pub const METHOD: &'static str = "Page.clearCompilationCache"; }
2560
2561impl crate::CdpCommand for ClearCompilationCacheParams {
2562    const METHOD: &'static str = "Page.clearCompilationCache";
2563    type Response = crate::EmptyReturns;
2564}
2565
2566/// Sets the Secure Payment Confirmation transaction mode.
2567/// https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode
2568
2569#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2570#[serde(rename_all = "camelCase")]
2571pub struct SetSPCTransactionModeParams {
2572
2573    pub mode: String,
2574}
2575
2576impl SetSPCTransactionModeParams { pub const METHOD: &'static str = "Page.setSPCTransactionMode"; }
2577
2578impl crate::CdpCommand for SetSPCTransactionModeParams {
2579    const METHOD: &'static str = "Page.setSPCTransactionMode";
2580    type Response = crate::EmptyReturns;
2581}
2582
2583/// Extensions for Custom Handlers API:
2584/// https://html.spec.whatwg.org/multipage/system-state.html#rph-automation
2585
2586#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2587#[serde(rename_all = "camelCase")]
2588pub struct SetRPHRegistrationModeParams {
2589
2590    pub mode: String,
2591}
2592
2593impl SetRPHRegistrationModeParams { pub const METHOD: &'static str = "Page.setRPHRegistrationMode"; }
2594
2595impl crate::CdpCommand for SetRPHRegistrationModeParams {
2596    const METHOD: &'static str = "Page.setRPHRegistrationMode";
2597    type Response = crate::EmptyReturns;
2598}
2599
2600/// Generates a report for testing.
2601
2602#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2603#[serde(rename_all = "camelCase")]
2604pub struct GenerateTestReportParams {
2605    /// Message to be displayed in the report.
2606
2607    pub message: String,
2608    /// Specifies the endpoint group to deliver the report to.
2609
2610    #[serde(skip_serializing_if = "Option::is_none")]
2611    pub group: Option<String>,
2612}
2613
2614impl GenerateTestReportParams { pub const METHOD: &'static str = "Page.generateTestReport"; }
2615
2616impl crate::CdpCommand for GenerateTestReportParams {
2617    const METHOD: &'static str = "Page.generateTestReport";
2618    type Response = crate::EmptyReturns;
2619}
2620
2621#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2622pub struct WaitForDebuggerParams {}
2623
2624impl WaitForDebuggerParams { pub const METHOD: &'static str = "Page.waitForDebugger"; }
2625
2626impl crate::CdpCommand for WaitForDebuggerParams {
2627    const METHOD: &'static str = "Page.waitForDebugger";
2628    type Response = crate::EmptyReturns;
2629}
2630
2631/// Intercept file chooser requests and transfer control to protocol clients.
2632/// When file chooser interception is enabled, native file chooser dialog is not shown.
2633/// Instead, a protocol event 'Page.fileChooserOpened' is emitted.
2634
2635#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2636#[serde(rename_all = "camelCase")]
2637pub struct SetInterceptFileChooserDialogParams {
2638
2639    pub enabled: bool,
2640    /// If true, cancels the dialog by emitting relevant events (if any)
2641    /// in addition to not showing it if the interception is enabled
2642    /// (default: false).
2643
2644    #[serde(skip_serializing_if = "Option::is_none")]
2645    pub cancel: Option<bool>,
2646}
2647
2648impl SetInterceptFileChooserDialogParams { pub const METHOD: &'static str = "Page.setInterceptFileChooserDialog"; }
2649
2650impl crate::CdpCommand for SetInterceptFileChooserDialogParams {
2651    const METHOD: &'static str = "Page.setInterceptFileChooserDialog";
2652    type Response = crate::EmptyReturns;
2653}
2654
2655/// Enable/disable prerendering manually.
2656/// 
2657/// This command is a short-term solution for https://crbug.com/1440085.
2658/// See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA
2659/// for more details.
2660/// 
2661/// TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets.
2662
2663#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2664#[serde(rename_all = "camelCase")]
2665pub struct SetPrerenderingAllowedParams {
2666
2667    pub isAllowed: bool,
2668}
2669
2670impl SetPrerenderingAllowedParams { pub const METHOD: &'static str = "Page.setPrerenderingAllowed"; }
2671
2672impl crate::CdpCommand for SetPrerenderingAllowedParams {
2673    const METHOD: &'static str = "Page.setPrerenderingAllowed";
2674    type Response = crate::EmptyReturns;
2675}
2676
2677/// Get the annotated page content for the main frame.
2678/// This is an experimental command that is subject to change.
2679
2680#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2681#[serde(rename_all = "camelCase")]
2682pub struct GetAnnotatedPageContentParams {
2683    /// Whether to include actionable information. Defaults to true.
2684
2685    #[serde(skip_serializing_if = "Option::is_none")]
2686    pub includeActionableInformation: Option<bool>,
2687}
2688
2689/// Get the annotated page content for the main frame.
2690/// This is an experimental command that is subject to change.
2691
2692#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2693#[serde(rename_all = "camelCase")]
2694pub struct GetAnnotatedPageContentReturns {
2695    /// The annotated page content as a base64 encoded protobuf.
2696    /// The format is defined by the 'AnnotatedPageContent' message in
2697    /// components/optimization_guide/proto/features/common_quality_data.proto (Encoded as a base64 string when passed over JSON)
2698
2699    pub content: String,
2700}
2701
2702impl GetAnnotatedPageContentParams { pub const METHOD: &'static str = "Page.getAnnotatedPageContent"; }
2703
2704impl crate::CdpCommand for GetAnnotatedPageContentParams {
2705    const METHOD: &'static str = "Page.getAnnotatedPageContent";
2706    type Response = GetAnnotatedPageContentReturns;
2707}