Skip to main content

cdp_driver/protocol/
preload.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! The `Preload` domain.
5//!
6//! Types, command parameters and event payloads for the `Preload`
7//! domain. The method-name constants for the same domain are in
8//! [`crate::methods`].
9//!
10//! This domain is experimental and may change without notice.
11
12use serde::{Deserialize, Serialize};
13
14/// Unique id
15pub type RuleSetId = String;
16
17/// Corresponds to SpeculationRuleSet
18#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19pub struct RuleSet {
20    pub id: RuleSetId,
21    /// Identifies a document which the rule set is associated with.
22    #[serde(rename = "loaderId")]
23    pub loader_id: crate::protocol::network::LoaderId,
24    /// Source text of JSON representing the rule set. If it comes from
25    /// `\<script\>` tag, it is the textContent of the node. Note that it is a
26    /// JSON for valid case. See also: -
27    /// <https://wicg.github.io/nav-speculation/speculation-rules.html> -
28    /// <https://github.com/WICG/nav-speculation/blob/main/triggers.md>
29    #[serde(rename = "sourceText")]
30    pub source_text: String,
31    /// A speculation rule set is either added through an inline `\<script\>` tag
32    /// or through an external resource via the 'Speculation-Rules' HTTP header.
33    /// For the first case, we include the BackendNodeId of the relevant
34    /// `\<script\>` tag. For the second case, we include the external URL where
35    /// the rule set was loaded from, and also RequestId if Network domain is
36    /// enabled. See also: -
37    /// <https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-script>
38    /// -
39    /// <https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-header>
40    #[serde(
41        rename = "backendNodeId",
42        default,
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
46    #[serde(default, skip_serializing_if = "Option::is_none")]
47    pub url: Option<String>,
48    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
49    pub request_id: Option<crate::protocol::network::RequestId>,
50    /// Error information `errorMessage` is null iff `errorType` is null.
51    #[serde(rename = "errorType", default, skip_serializing_if = "Option::is_none")]
52    pub error_type: Option<RuleSetErrorType>,
53    /// TODO(<https://crbug.com/1425354>): Replace this property with structured
54    /// error.
55    ///
56    /// Deprecated in the protocol.
57    #[serde(
58        rename = "errorMessage",
59        default,
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub error_message: Option<String>,
63    /// For more details, see:
64    /// <https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md>
65    #[serde(default, skip_serializing_if = "Option::is_none")]
66    pub tag: Option<String>,
67}
68
69#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
70pub enum RuleSetErrorType {
71    /// `SourceIsNotJsonObject`
72    SourceIsNotJsonObject,
73    /// `InvalidRulesSkipped`
74    InvalidRulesSkipped,
75    /// `InvalidRulesetLevelTag`
76    InvalidRulesetLevelTag,
77    /// A value this vendored schema does not list. Chrome adds values ahead of
78    /// the published protocol, so an unrecognised one is kept as it arrived
79    /// rather than failing the payload it came in.
80    #[serde(untagged)]
81    Unrecognized(String),
82}
83
84/// The type of preloading attempted. It corresponds to
85/// mojom::SpeculationAction (although PrefetchWithSubresources is omitted as
86/// it isn't being used by clients).
87#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
88pub enum SpeculationAction {
89    /// `Prefetch`
90    Prefetch,
91    /// `Prerender`
92    Prerender,
93    /// `PrerenderUntilScript`
94    PrerenderUntilScript,
95    /// A value this vendored schema does not list. Chrome adds values ahead of
96    /// the published protocol, so an unrecognised one is kept as it arrived
97    /// rather than failing the payload it came in.
98    #[serde(untagged)]
99    Unrecognized(String),
100}
101
102/// Corresponds to mojom::SpeculationTargetHint. See
103/// <https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints>
104#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
105pub enum SpeculationTargetHint {
106    /// `Blank`
107    Blank,
108    /// `Self`
109    #[serde(rename = "Self")]
110    Self_,
111    /// A value this vendored schema does not list. Chrome adds values ahead of
112    /// the published protocol, so an unrecognised one is kept as it arrived
113    /// rather than failing the payload it came in.
114    #[serde(untagged)]
115    Unrecognized(String),
116}
117
118/// A key that identifies a preloading attempt. The url used is the url
119/// specified by the trigger (i.e. the initial URL), and not the final url
120/// that is navigated to. For example, prerendering allows same-origin main
121/// frame navigations during the attempt, but the attempt is still keyed with
122/// the initial URL.
123#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
124pub struct PreloadingAttemptKey {
125    #[serde(rename = "loaderId")]
126    pub loader_id: crate::protocol::network::LoaderId,
127    pub action: SpeculationAction,
128    pub url: String,
129    #[serde(
130        rename = "formSubmission",
131        default,
132        skip_serializing_if = "Option::is_none"
133    )]
134    pub form_submission: Option<bool>,
135    #[serde(
136        rename = "targetHint",
137        default,
138        skip_serializing_if = "Option::is_none"
139    )]
140    pub target_hint: Option<SpeculationTargetHint>,
141}
142
143/// Lists sources for a preloading attempt, specifically the ids of rule sets
144/// that had a speculation rule that triggered the attempt, and the
145/// BackendNodeIds of \<a href\> or \<area href\> elements that triggered the
146/// attempt (in the case of attempts triggered by a document rule). It is
147/// possible for multiple rule sets and links to trigger a single attempt.
148#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
149pub struct PreloadingAttemptSource {
150    pub key: PreloadingAttemptKey,
151    #[serde(rename = "ruleSetIds")]
152    pub rule_set_ids: Vec<RuleSetId>,
153    #[serde(rename = "nodeIds")]
154    pub node_ids: Vec<crate::protocol::dom::BackendNodeId>,
155}
156
157/// Chrome manages different types of preloads together using a concept of
158/// preloading pipeline. For example, if a site uses a SpeculationRules for
159/// prerender, Chrome first starts a prefetch and then upgrades it to
160/// prerender. CDP events for them are emitted separately but they share
161/// `PreloadPipelineId`.
162pub type PreloadPipelineId = String;
163
164/// List of FinalStatus reasons for Prerender2.
165#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
166pub enum PrerenderFinalStatus {
167    /// `Activated`
168    Activated,
169    /// `Destroyed`
170    Destroyed,
171    /// `LowEndDevice`
172    LowEndDevice,
173    /// `InvalidSchemeRedirect`
174    InvalidSchemeRedirect,
175    /// `InvalidSchemeNavigation`
176    InvalidSchemeNavigation,
177    /// `NavigationRequestBlockedByCsp`
178    NavigationRequestBlockedByCsp,
179    /// `MojoBinderPolicy`
180    MojoBinderPolicy,
181    /// `RendererProcessCrashed`
182    RendererProcessCrashed,
183    /// `RendererProcessKilled`
184    RendererProcessKilled,
185    /// `Download`
186    Download,
187    /// `TriggerDestroyed`
188    TriggerDestroyed,
189    /// `NavigationNotCommitted`
190    NavigationNotCommitted,
191    /// `NavigationBadHttpStatus`
192    NavigationBadHttpStatus,
193    /// `ClientCertRequested`
194    ClientCertRequested,
195    /// `NavigationRequestNetworkError`
196    NavigationRequestNetworkError,
197    /// `CancelAllHostsForTesting`
198    CancelAllHostsForTesting,
199    /// `DidFailLoad`
200    DidFailLoad,
201    /// `Stop`
202    Stop,
203    /// `SslCertificateError`
204    SslCertificateError,
205    /// `LoginAuthRequested`
206    LoginAuthRequested,
207    /// `UaChangeRequiresReload`
208    UaChangeRequiresReload,
209    /// `BlockedByClient`
210    BlockedByClient,
211    /// `AudioOutputDeviceRequested`
212    AudioOutputDeviceRequested,
213    /// `MixedContent`
214    MixedContent,
215    /// `TriggerBackgrounded`
216    TriggerBackgrounded,
217    /// `MemoryLimitExceeded`
218    MemoryLimitExceeded,
219    /// `DataSaverEnabled`
220    DataSaverEnabled,
221    /// `TriggerUrlHasEffectiveUrl`
222    TriggerUrlHasEffectiveUrl,
223    /// `ActivatedBeforeStarted`
224    ActivatedBeforeStarted,
225    /// `InactivePageRestriction`
226    InactivePageRestriction,
227    /// `StartFailed`
228    StartFailed,
229    /// `TimeoutBackgrounded`
230    TimeoutBackgrounded,
231    /// `CrossSiteRedirectInInitialNavigation`
232    CrossSiteRedirectInInitialNavigation,
233    /// `CrossSiteNavigationInInitialNavigation`
234    CrossSiteNavigationInInitialNavigation,
235    /// `SameSiteCrossOriginRedirectNotOptInInInitialNavigation`
236    SameSiteCrossOriginRedirectNotOptInInInitialNavigation,
237    /// `SameSiteCrossOriginNavigationNotOptInInInitialNavigation`
238    SameSiteCrossOriginNavigationNotOptInInInitialNavigation,
239    /// `ActivationNavigationParameterMismatch`
240    ActivationNavigationParameterMismatch,
241    /// `ActivatedInBackground`
242    ActivatedInBackground,
243    /// `EmbedderHostDisallowed`
244    EmbedderHostDisallowed,
245    /// `ActivationNavigationDestroyedBeforeSuccess`
246    ActivationNavigationDestroyedBeforeSuccess,
247    /// `TabClosedByUserGesture`
248    TabClosedByUserGesture,
249    /// `TabClosedWithoutUserGesture`
250    TabClosedWithoutUserGesture,
251    /// `PrimaryMainFrameRendererProcessCrashed`
252    PrimaryMainFrameRendererProcessCrashed,
253    /// `PrimaryMainFrameRendererProcessKilled`
254    PrimaryMainFrameRendererProcessKilled,
255    /// `ActivationFramePolicyNotCompatible`
256    ActivationFramePolicyNotCompatible,
257    /// `PreloadingDisabled`
258    PreloadingDisabled,
259    /// `BatterySaverEnabled`
260    BatterySaverEnabled,
261    /// `ActivatedDuringMainFrameNavigation`
262    ActivatedDuringMainFrameNavigation,
263    /// `PreloadingUnsupportedByWebContents`
264    PreloadingUnsupportedByWebContents,
265    /// `CrossSiteRedirectInMainFrameNavigation`
266    CrossSiteRedirectInMainFrameNavigation,
267    /// `CrossSiteNavigationInMainFrameNavigation`
268    CrossSiteNavigationInMainFrameNavigation,
269    /// `SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation`
270    SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation,
271    /// `SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation`
272    SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation,
273    /// `MemoryPressureOnTrigger`
274    MemoryPressureOnTrigger,
275    /// `MemoryPressureAfterTriggered`
276    MemoryPressureAfterTriggered,
277    /// `PrerenderingDisabledByDevTools`
278    PrerenderingDisabledByDevTools,
279    /// `SpeculationRuleRemoved`
280    SpeculationRuleRemoved,
281    /// `ActivatedWithAuxiliaryBrowsingContexts`
282    ActivatedWithAuxiliaryBrowsingContexts,
283    /// `MaxNumOfRunningEagerPrerendersExceeded`
284    MaxNumOfRunningEagerPrerendersExceeded,
285    /// `MaxNumOfRunningNonEagerPrerendersExceeded`
286    MaxNumOfRunningNonEagerPrerendersExceeded,
287    /// `MaxNumOfRunningEmbedderPrerendersExceeded`
288    MaxNumOfRunningEmbedderPrerendersExceeded,
289    /// `PrerenderingUrlHasEffectiveUrl`
290    PrerenderingUrlHasEffectiveUrl,
291    /// `RedirectedPrerenderingUrlHasEffectiveUrl`
292    RedirectedPrerenderingUrlHasEffectiveUrl,
293    /// `ActivationUrlHasEffectiveUrl`
294    ActivationUrlHasEffectiveUrl,
295    /// `JavaScriptInterfaceAdded`
296    JavaScriptInterfaceAdded,
297    /// `JavaScriptInterfaceRemoved`
298    JavaScriptInterfaceRemoved,
299    /// `AllPrerenderingCanceled`
300    AllPrerenderingCanceled,
301    /// `WindowClosed`
302    WindowClosed,
303    /// `SlowNetwork`
304    SlowNetwork,
305    /// `OtherPrerenderedPageActivated`
306    OtherPrerenderedPageActivated,
307    /// `V8OptimizerDisabled`
308    V8OptimizerDisabled,
309    /// `PrerenderFailedDuringPrefetch`
310    PrerenderFailedDuringPrefetch,
311    /// `BrowsingDataRemoved`
312    BrowsingDataRemoved,
313    /// `PrerenderHostReused`
314    PrerenderHostReused,
315    /// `FormSubmitWhenPrerendering`
316    FormSubmitWhenPrerendering,
317    /// `CrossDocumentRestart`
318    CrossDocumentRestart,
319    /// `PrefetchFailedCrossOriginSubframe`
320    PrefetchFailedCrossOriginSubframe,
321    /// A value this vendored schema does not list. Chrome adds values ahead of
322    /// the published protocol, so an unrecognised one is kept as it arrived
323    /// rather than failing the payload it came in.
324    #[serde(untagged)]
325    Unrecognized(String),
326}
327
328/// Preloading status values, see also PreloadingTriggeringOutcome. This
329/// status is shared by prefetchStatusUpdated and prerenderStatusUpdated.
330#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
331pub enum PreloadingStatus {
332    /// `Pending`
333    Pending,
334    /// `Running`
335    Running,
336    /// `Ready`
337    Ready,
338    /// `Success`
339    Success,
340    /// `Failure`
341    Failure,
342    /// `NotSupported`
343    NotSupported,
344    /// A value this vendored schema does not list. Chrome adds values ahead of
345    /// the published protocol, so an unrecognised one is kept as it arrived
346    /// rather than failing the payload it came in.
347    #[serde(untagged)]
348    Unrecognized(String),
349}
350
351/// TODO(<https://crbug.com/1384419>): revisit the list of PrefetchStatus and
352/// filter out the ones that aren't necessary to the developers.
353#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
354pub enum PrefetchStatus {
355    /// `PrefetchAllowed`
356    PrefetchAllowed,
357    /// `PrefetchFailedIneligibleRedirect`
358    PrefetchFailedIneligibleRedirect,
359    /// `PrefetchFailedInvalidRedirect`
360    PrefetchFailedInvalidRedirect,
361    /// `PrefetchFailedMIMENotSupported`
362    #[serde(rename = "PrefetchFailedMIMENotSupported")]
363    PrefetchFailedMimeNotSupported,
364    /// `PrefetchFailedNetError`
365    PrefetchFailedNetError,
366    /// `PrefetchFailedNon2XX`
367    #[serde(rename = "PrefetchFailedNon2XX")]
368    PrefetchFailedNon2Xx,
369    /// `PrefetchEvictedAfterBrowsingDataRemoved`
370    PrefetchEvictedAfterBrowsingDataRemoved,
371    /// `PrefetchEvictedAfterCandidateRemoved`
372    PrefetchEvictedAfterCandidateRemoved,
373    /// `PrefetchEvictedForNewerPrefetch`
374    PrefetchEvictedForNewerPrefetch,
375    /// `PrefetchHeldback`
376    PrefetchHeldback,
377    /// `PrefetchIneligibleRetryAfter`
378    PrefetchIneligibleRetryAfter,
379    /// `PrefetchIsPrivacyDecoy`
380    PrefetchIsPrivacyDecoy,
381    /// `PrefetchIsStale`
382    PrefetchIsStale,
383    /// `PrefetchNotEligibleBlockedByConnectionAllowlist`
384    PrefetchNotEligibleBlockedByConnectionAllowlist,
385    /// `PrefetchNotEligibleBrowserContextOffTheRecord`
386    PrefetchNotEligibleBrowserContextOffTheRecord,
387    /// `PrefetchNotEligibleCrossOrigin`
388    PrefetchNotEligibleCrossOrigin,
389    /// `PrefetchNotEligibleDataSaverEnabled`
390    PrefetchNotEligibleDataSaverEnabled,
391    /// `PrefetchNotEligibleExistingProxy`
392    PrefetchNotEligibleExistingProxy,
393    /// `PrefetchNotEligibleHostIsNonUnique`
394    PrefetchNotEligibleHostIsNonUnique,
395    /// `PrefetchNotEligibleNonDefaultStoragePartition`
396    PrefetchNotEligibleNonDefaultStoragePartition,
397    /// `PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy`
398    PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy,
399    /// `PrefetchNotEligibleSchemeIsNotHttps`
400    PrefetchNotEligibleSchemeIsNotHttps,
401    /// `PrefetchNotEligibleUserHasCookies`
402    PrefetchNotEligibleUserHasCookies,
403    /// `PrefetchNotEligibleUserHasServiceWorker`
404    PrefetchNotEligibleUserHasServiceWorker,
405    /// `PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler`
406    PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler,
407    /// `PrefetchNotEligibleRedirectFromServiceWorker`
408    PrefetchNotEligibleRedirectFromServiceWorker,
409    /// `PrefetchNotEligibleRedirectToServiceWorker`
410    PrefetchNotEligibleRedirectToServiceWorker,
411    /// `PrefetchNotEligibleBatterySaverEnabled`
412    PrefetchNotEligibleBatterySaverEnabled,
413    /// `PrefetchNotEligiblePreloadingDisabled`
414    PrefetchNotEligiblePreloadingDisabled,
415    /// `PrefetchNotFinishedInTime`
416    PrefetchNotFinishedInTime,
417    /// `PrefetchNotStarted`
418    PrefetchNotStarted,
419    /// `PrefetchNotUsedCookiesChanged`
420    PrefetchNotUsedCookiesChanged,
421    /// `PrefetchProxyNotAvailable`
422    PrefetchProxyNotAvailable,
423    /// `PrefetchResponseUsed`
424    PrefetchResponseUsed,
425    /// `PrefetchSuccessfulButNotUsed`
426    PrefetchSuccessfulButNotUsed,
427    /// `PrefetchNotUsedProbeFailed`
428    PrefetchNotUsedProbeFailed,
429    /// `PrefetchCancelledOnUserNavigation`
430    PrefetchCancelledOnUserNavigation,
431    /// A value this vendored schema does not list. Chrome adds values ahead of
432    /// the published protocol, so an unrecognised one is kept as it arrived
433    /// rather than failing the payload it came in.
434    #[serde(untagged)]
435    Unrecognized(String),
436}
437
438/// Information of headers to be displayed when the header mismatch occurred.
439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
440pub struct PrerenderMismatchedHeaders {
441    #[serde(rename = "headerName")]
442    pub header_name: String,
443    #[serde(
444        rename = "initialValue",
445        default,
446        skip_serializing_if = "Option::is_none"
447    )]
448    pub initial_value: Option<String>,
449    #[serde(
450        rename = "activationValue",
451        default,
452        skip_serializing_if = "Option::is_none"
453    )]
454    pub activation_value: Option<String>,
455}
456
457/// Parameters of `Preload.enable`.
458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
459pub struct EnableParams {}
460
461impl crate::typed::Command for EnableParams {
462    const METHOD: &'static str = "Preload.enable";
463    type Returns = crate::typed::NoReturns;
464}
465
466/// Parameters of `Preload.disable`.
467#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
468pub struct DisableParams {}
469
470impl crate::typed::Command for DisableParams {
471    const METHOD: &'static str = "Preload.disable";
472    type Returns = crate::typed::NoReturns;
473}
474
475/// Upsert. Currently, it is only emitted when a rule set added.
476///
477/// Payload of the `Preload.ruleSetUpdated` event.
478#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
479pub struct RuleSetUpdatedEvent {
480    #[serde(rename = "ruleSet")]
481    pub rule_set: RuleSet,
482}
483
484impl crate::typed::Event for RuleSetUpdatedEvent {
485    const METHOD: &'static str = "Preload.ruleSetUpdated";
486}
487
488/// Payload of the `Preload.ruleSetRemoved` event.
489#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
490pub struct RuleSetRemovedEvent {
491    pub id: RuleSetId,
492}
493
494impl crate::typed::Event for RuleSetRemovedEvent {
495    const METHOD: &'static str = "Preload.ruleSetRemoved";
496}
497
498/// Fired when a preload enabled state is updated.
499///
500/// Payload of the `Preload.preloadEnabledStateUpdated` event.
501#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
502pub struct PreloadEnabledStateUpdatedEvent {
503    #[serde(rename = "disabledByPreference")]
504    pub disabled_by_preference: bool,
505    #[serde(rename = "disabledByDataSaver")]
506    pub disabled_by_data_saver: bool,
507    #[serde(rename = "disabledByBatterySaver")]
508    pub disabled_by_battery_saver: bool,
509    #[serde(rename = "disabledByHoldbackPrefetchSpeculationRules")]
510    pub disabled_by_holdback_prefetch_speculation_rules: bool,
511    #[serde(rename = "disabledByHoldbackPrerenderSpeculationRules")]
512    pub disabled_by_holdback_prerender_speculation_rules: bool,
513}
514
515impl crate::typed::Event for PreloadEnabledStateUpdatedEvent {
516    const METHOD: &'static str = "Preload.preloadEnabledStateUpdated";
517}
518
519/// Fired when a prefetch attempt is updated.
520///
521/// Payload of the `Preload.prefetchStatusUpdated` event.
522#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
523pub struct PrefetchStatusUpdatedEvent {
524    pub key: PreloadingAttemptKey,
525    #[serde(rename = "pipelineId")]
526    pub pipeline_id: PreloadPipelineId,
527    /// The frame id of the frame initiating prefetch.
528    #[serde(rename = "initiatingFrameId")]
529    pub initiating_frame_id: crate::protocol::page::FrameId,
530    #[serde(rename = "prefetchUrl")]
531    pub prefetch_url: String,
532    pub status: PreloadingStatus,
533    #[serde(rename = "prefetchStatus")]
534    pub prefetch_status: PrefetchStatus,
535    #[serde(rename = "requestId")]
536    pub request_id: crate::protocol::network::RequestId,
537}
538
539impl crate::typed::Event for PrefetchStatusUpdatedEvent {
540    const METHOD: &'static str = "Preload.prefetchStatusUpdated";
541}
542
543/// Fired when a prerender attempt is updated.
544///
545/// Payload of the `Preload.prerenderStatusUpdated` event.
546#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
547pub struct PrerenderStatusUpdatedEvent {
548    pub key: PreloadingAttemptKey,
549    #[serde(rename = "pipelineId")]
550    pub pipeline_id: PreloadPipelineId,
551    pub status: PreloadingStatus,
552    /// The action currently performed by this attempt. This differs from
553    /// `key.action` after a prerender-until-script attempt is upgraded in place
554    /// to a full prerender.
555    #[serde(
556        rename = "effectiveAction",
557        default,
558        skip_serializing_if = "Option::is_none"
559    )]
560    pub effective_action: Option<SpeculationAction>,
561    #[serde(
562        rename = "prerenderStatus",
563        default,
564        skip_serializing_if = "Option::is_none"
565    )]
566    pub prerender_status: Option<PrerenderFinalStatus>,
567    /// This is used to give users more information about the name of Mojo
568    /// interface that is incompatible with prerender and has caused the
569    /// cancellation of the attempt.
570    #[serde(
571        rename = "disallowedMojoInterface",
572        default,
573        skip_serializing_if = "Option::is_none"
574    )]
575    pub disallowed_mojo_interface: Option<String>,
576    #[serde(
577        rename = "mismatchedHeaders",
578        default,
579        skip_serializing_if = "Option::is_none"
580    )]
581    pub mismatched_headers: Option<Vec<PrerenderMismatchedHeaders>>,
582}
583
584impl crate::typed::Event for PrerenderStatusUpdatedEvent {
585    const METHOD: &'static str = "Preload.prerenderStatusUpdated";
586}
587
588/// Send a list of sources for all preloading attempts in a document.
589///
590/// Payload of the `Preload.preloadingAttemptSourcesUpdated` event.
591#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
592pub struct PreloadingAttemptSourcesUpdatedEvent {
593    #[serde(rename = "loaderId")]
594    pub loader_id: crate::protocol::network::LoaderId,
595    #[serde(rename = "preloadingAttemptSources")]
596    pub preloading_attempt_sources: Vec<PreloadingAttemptSource>,
597}
598
599impl crate::typed::Event for PreloadingAttemptSourcesUpdatedEvent {
600    const METHOD: &'static str = "Preload.preloadingAttemptSourcesUpdated";
601}