viewpoint_cdp/protocol/
page.rs1use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct Frame {
11 pub id: String,
13 pub parent_id: Option<String>,
15 pub loader_id: String,
17 pub name: Option<String>,
19 pub url: String,
21 pub security_origin: Option<String>,
23 pub mime_type: Option<String>,
25}
26
27#[derive(Debug, Clone, Serialize)]
29#[serde(rename_all = "camelCase")]
30pub struct NavigateParams {
31 pub url: String,
33 #[serde(skip_serializing_if = "Option::is_none")]
35 pub referrer: Option<String>,
36 #[serde(skip_serializing_if = "Option::is_none")]
38 pub transition_type: Option<String>,
39 #[serde(skip_serializing_if = "Option::is_none")]
41 pub frame_id: Option<String>,
42}
43
44#[derive(Debug, Clone, Deserialize)]
46#[serde(rename_all = "camelCase")]
47pub struct NavigateResult {
48 pub frame_id: String,
50 pub loader_id: Option<String>,
52 pub error_text: Option<String>,
54}
55
56#[derive(Debug, Clone, Serialize, Default)]
58#[serde(rename_all = "camelCase")]
59pub struct ReloadParams {
60 #[serde(skip_serializing_if = "Option::is_none")]
62 pub ignore_cache: Option<bool>,
63 #[serde(skip_serializing_if = "Option::is_none")]
65 pub script_to_evaluate_on_load: Option<String>,
66}
67
68#[derive(Debug, Clone, Deserialize)]
70#[serde(rename_all = "camelCase")]
71pub struct GetFrameTreeResult {
72 pub frame_tree: FrameTree,
74}
75
76#[derive(Debug, Clone, Deserialize)]
78#[serde(rename_all = "camelCase")]
79pub struct FrameTree {
80 pub frame: Frame,
82 pub child_frames: Option<Vec<FrameTree>>,
84}
85
86#[derive(Debug, Clone, Deserialize)]
88pub struct LoadEventFiredEvent {
89 pub timestamp: f64,
91}
92
93#[derive(Debug, Clone, Deserialize)]
95pub struct DomContentEventFiredEvent {
96 pub timestamp: f64,
98}
99
100#[derive(Debug, Clone, Deserialize)]
102#[serde(rename_all = "camelCase")]
103pub struct FrameNavigatedEvent {
104 pub frame: Frame,
106 #[serde(rename = "type")]
108 pub navigation_type: Option<String>,
109}
110
111#[derive(Debug, Clone, Deserialize)]
113#[serde(rename_all = "camelCase")]
114pub struct FrameStartedLoadingEvent {
115 pub frame_id: String,
117}
118
119#[derive(Debug, Clone, Deserialize)]
121#[serde(rename_all = "camelCase")]
122pub struct FrameStoppedLoadingEvent {
123 pub frame_id: String,
125}
126
127#[derive(Debug, Clone, Deserialize)]
129#[serde(rename_all = "camelCase")]
130pub struct LifecycleEvent {
131 pub frame_id: String,
133 pub loader_id: String,
135 pub name: String,
137 pub timestamp: f64,
139}
140
141#[derive(Debug, Clone, Serialize)]
143pub struct SetLifecycleEventsEnabledParams {
144 pub enabled: bool,
146}