1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3pub struct DomContentEventFiredParams {
4 #[serde(rename = "timestamp")]
5 pub timestamp: crate::browser_protocol::network::types::MonotonicTime,
6}
7#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8pub enum DomContentEventFiredMethod {
9 #[serde(rename = "Page.domContentEventFired")]
10 DomContentEventFired,
11}
12#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
13pub struct DomContentEventFired {
14 pub method: DomContentEventFiredMethod,
15 pub params: DomContentEventFiredParams,
16}
17impl DomContentEventFired {
18 pub const IDENTIFIER: &'static str = "Page.domContentEventFired";
19 pub fn identifier(&self) -> &'static str {
20 Self::IDENTIFIER
21 }
22}
23#[doc = "Emitted only when `page.interceptFileChooser` is enabled.\n[fileChooserOpened](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-fileChooserOpened)"]
24#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
25pub struct FileChooserOpenedParams {
26 #[doc = "Id of the frame containing input node."]
27 #[serde(rename = "frameId")]
28 pub frame_id: Box<super::types::FrameId>,
29 #[doc = "Input mode."]
30 #[serde(rename = "mode")]
31 pub mode: FileChooserOpenedMode,
32 #[doc = "Input node id. Only present for file choosers opened via an `<input type=\"file\">` element."]
33 #[serde(rename = "backendNodeId")]
34 #[serde(skip_serializing_if = "Option::is_none")]
35 #[serde(default)]
36 pub backend_node_id: Option<crate::browser_protocol::dom::types::BackendNodeId>,
37}
38#[doc = "Input mode."]
39#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
40pub enum FileChooserOpenedMode {
41 #[serde(rename = "selectSingle")]
42 SelectSingle,
43 #[serde(rename = "selectMultiple")]
44 SelectMultiple,
45}
46#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
47pub enum FileChooserOpenedMethod {
48 #[serde(rename = "Page.fileChooserOpened")]
49 FileChooserOpened,
50}
51#[doc = "Emitted only when `page.interceptFileChooser` is enabled.\n[fileChooserOpened](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-fileChooserOpened)"]
52#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
53pub struct FileChooserOpened {
54 pub method: FileChooserOpenedMethod,
55 pub params: FileChooserOpenedParams,
56}
57impl FileChooserOpened {
58 pub const IDENTIFIER: &'static str = "Page.fileChooserOpened";
59 pub fn identifier(&self) -> &'static str {
60 Self::IDENTIFIER
61 }
62}
63#[doc = "Fired when frame has been attached to its parent.\n[frameAttached](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameAttached)"]
64#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
65pub struct FrameAttachedParams {
66 #[doc = "Id of the frame that has been attached."]
67 #[serde(rename = "frameId")]
68 pub frame_id: Box<super::types::FrameId>,
69 #[doc = "Parent frame identifier."]
70 #[serde(rename = "parentFrameId")]
71 pub parent_frame_id: super::types::FrameId,
72 #[doc = "JavaScript stack trace of when frame was attached, only set if frame initiated from script."]
73 #[serde(rename = "stack")]
74 #[serde(skip_serializing_if = "Option::is_none")]
75 #[serde(default)]
76 pub stack: Option<crate::js_protocol::runtime::types::StackTrace>,
77}
78#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
79pub enum FrameAttachedMethod {
80 #[serde(rename = "Page.frameAttached")]
81 FrameAttached,
82}
83#[doc = "Fired when frame has been attached to its parent.\n[frameAttached](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameAttached)"]
84#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
85pub struct FrameAttached {
86 pub method: FrameAttachedMethod,
87 pub params: FrameAttachedParams,
88}
89impl FrameAttached {
90 pub const IDENTIFIER: &'static str = "Page.frameAttached";
91 pub fn identifier(&self) -> &'static str {
92 Self::IDENTIFIER
93 }
94}
95#[doc = "Fired when frame has been detached from its parent.\n[frameDetached](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameDetached)"]
96#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
97pub struct FrameDetachedParams {
98 #[doc = "Id of the frame that has been detached."]
99 #[serde(rename = "frameId")]
100 pub frame_id: Box<super::types::FrameId>,
101 #[serde(rename = "reason")]
102 pub reason: FrameDetachedReason,
103}
104#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
105pub enum FrameDetachedReason {
106 #[doc = "The frame is removed from the DOM."]
107 #[serde(rename = "remove")]
108 Remove,
109 #[doc = "The frame is being swapped out in favor of an out-of-process iframe.\nA new frame target will be created (see Target.attachedToTarget)."]
110 #[serde(rename = "swap")]
111 Swap,
112}
113#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
114pub enum FrameDetachedMethod {
115 #[serde(rename = "Page.frameDetached")]
116 FrameDetached,
117}
118#[doc = "Fired when frame has been detached from its parent.\n[frameDetached](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameDetached)"]
119#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
120pub struct FrameDetached {
121 pub method: FrameDetachedMethod,
122 pub params: FrameDetachedParams,
123}
124impl FrameDetached {
125 pub const IDENTIFIER: &'static str = "Page.frameDetached";
126 pub fn identifier(&self) -> &'static str {
127 Self::IDENTIFIER
128 }
129}
130#[doc = "Fired before frame subtree is detached. Emitted before any frame of the\nsubtree is actually detached.\n[frameSubtreeWillBeDetached](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameSubtreeWillBeDetached)"]
131#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
132pub struct FrameSubtreeWillBeDetachedParams {
133 #[doc = "Id of the frame that is the root of the subtree that will be detached."]
134 #[serde(rename = "frameId")]
135 pub frame_id: Box<super::types::FrameId>,
136}
137#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
138pub enum FrameSubtreeWillBeDetachedMethod {
139 #[serde(rename = "Page.frameSubtreeWillBeDetached")]
140 FrameSubtreeWillBeDetached,
141}
142#[doc = "Fired before frame subtree is detached. Emitted before any frame of the\nsubtree is actually detached.\n[frameSubtreeWillBeDetached](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameSubtreeWillBeDetached)"]
143#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
144pub struct FrameSubtreeWillBeDetached {
145 pub method: FrameSubtreeWillBeDetachedMethod,
146 pub params: FrameSubtreeWillBeDetachedParams,
147}
148impl FrameSubtreeWillBeDetached {
149 pub const IDENTIFIER: &'static str = "Page.frameSubtreeWillBeDetached";
150 pub fn identifier(&self) -> &'static str {
151 Self::IDENTIFIER
152 }
153}
154#[doc = "Fired once navigation of the frame has completed. Frame is now associated with the new loader.\n[frameNavigated](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameNavigated)"]
155#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
156pub struct FrameNavigatedParams {
157 #[doc = "Frame object."]
158 #[serde(rename = "frame")]
159 pub frame: Box<super::types::Frame>,
160 #[serde(rename = "type")]
161 pub r#type: super::types::NavigationType,
162}
163#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
164pub enum FrameNavigatedMethod {
165 #[serde(rename = "Page.frameNavigated")]
166 FrameNavigated,
167}
168#[doc = "Fired once navigation of the frame has completed. Frame is now associated with the new loader.\n[frameNavigated](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameNavigated)"]
169#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
170pub struct FrameNavigated {
171 pub method: FrameNavigatedMethod,
172 pub params: FrameNavigatedParams,
173}
174impl FrameNavigated {
175 pub const IDENTIFIER: &'static str = "Page.frameNavigated";
176 pub fn identifier(&self) -> &'static str {
177 Self::IDENTIFIER
178 }
179}
180#[doc = "Fired when opening document to write to.\n[documentOpened](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-documentOpened)"]
181#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
182pub struct DocumentOpenedParams {
183 #[doc = "Frame object."]
184 #[serde(rename = "frame")]
185 pub frame: Box<super::types::Frame>,
186}
187#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
188pub enum DocumentOpenedMethod {
189 #[serde(rename = "Page.documentOpened")]
190 DocumentOpened,
191}
192#[doc = "Fired when opening document to write to.\n[documentOpened](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-documentOpened)"]
193#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
194pub struct DocumentOpened {
195 pub method: DocumentOpenedMethod,
196 pub params: DocumentOpenedParams,
197}
198impl DocumentOpened {
199 pub const IDENTIFIER: &'static str = "Page.documentOpened";
200 pub fn identifier(&self) -> &'static str {
201 Self::IDENTIFIER
202 }
203}
204#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
205pub struct FrameResizedParams {}
206#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
207pub enum FrameResizedMethod {
208 #[serde(rename = "Page.frameResized")]
209 FrameResized,
210}
211#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
212pub struct FrameResized {
213 pub method: FrameResizedMethod,
214 pub params: FrameResizedParams,
215}
216impl FrameResized {
217 pub const IDENTIFIER: &'static str = "Page.frameResized";
218 pub fn identifier(&self) -> &'static str {
219 Self::IDENTIFIER
220 }
221}
222#[doc = "Fired when a navigation starts. This event is fired for both\nrenderer-initiated and browser-initiated navigations. For renderer-initiated\nnavigations, the event is fired after `frameRequestedNavigation`.\nNavigation may still be cancelled after the event is issued. Multiple events\ncan be fired for a single navigation, for example, when a same-document\nnavigation becomes a cross-document navigation (such as in the case of a\nframeset).\n[frameStartedNavigating](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameStartedNavigating)"]
223#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
224pub struct FrameStartedNavigatingParams {
225 #[doc = "ID of the frame that is being navigated."]
226 #[serde(rename = "frameId")]
227 pub frame_id: Box<super::types::FrameId>,
228 #[doc = "The URL the navigation started with. The final URL can be different."]
229 #[serde(rename = "url")]
230 pub url: String,
231 #[doc = "Loader identifier. Even though it is present in case of same-document\nnavigation, the previously committed loaderId would not change unless\nthe navigation changes from a same-document to a cross-document\nnavigation."]
232 #[serde(rename = "loaderId")]
233 pub loader_id: crate::browser_protocol::network::types::LoaderId,
234 #[serde(rename = "navigationType")]
235 pub navigation_type: FrameStartedNavigatingNavigationType,
236}
237#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
238pub enum FrameStartedNavigatingNavigationType {
239 #[serde(rename = "reload")]
240 Reload,
241 #[serde(rename = "reloadBypassingCache")]
242 ReloadBypassingCache,
243 #[serde(rename = "restore")]
244 Restore,
245 #[serde(rename = "restoreWithPost")]
246 RestoreWithPost,
247 #[serde(rename = "historySameDocument")]
248 HistorySameDocument,
249 #[serde(rename = "historyDifferentDocument")]
250 HistoryDifferentDocument,
251 #[serde(rename = "sameDocument")]
252 SameDocument,
253 #[serde(rename = "differentDocument")]
254 DifferentDocument,
255}
256#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
257pub enum FrameStartedNavigatingMethod {
258 #[serde(rename = "Page.frameStartedNavigating")]
259 FrameStartedNavigating,
260}
261#[doc = "Fired when a navigation starts. This event is fired for both\nrenderer-initiated and browser-initiated navigations. For renderer-initiated\nnavigations, the event is fired after `frameRequestedNavigation`.\nNavigation may still be cancelled after the event is issued. Multiple events\ncan be fired for a single navigation, for example, when a same-document\nnavigation becomes a cross-document navigation (such as in the case of a\nframeset).\n[frameStartedNavigating](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameStartedNavigating)"]
262#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
263pub struct FrameStartedNavigating {
264 pub method: FrameStartedNavigatingMethod,
265 pub params: FrameStartedNavigatingParams,
266}
267impl FrameStartedNavigating {
268 pub const IDENTIFIER: &'static str = "Page.frameStartedNavigating";
269 pub fn identifier(&self) -> &'static str {
270 Self::IDENTIFIER
271 }
272}
273#[doc = "Fired when a renderer-initiated navigation is requested.\nNavigation may still be cancelled after the event is issued.\n[frameRequestedNavigation](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameRequestedNavigation)"]
274#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
275pub struct FrameRequestedNavigationParams {
276 #[doc = "Id of the frame that is being navigated."]
277 #[serde(rename = "frameId")]
278 pub frame_id: Box<super::types::FrameId>,
279 #[doc = "The reason for the navigation."]
280 #[serde(rename = "reason")]
281 pub reason: super::types::ClientNavigationReason,
282 #[doc = "The destination URL for the requested navigation."]
283 #[serde(rename = "url")]
284 pub url: String,
285 #[doc = "The disposition for the navigation."]
286 #[serde(rename = "disposition")]
287 pub disposition: super::types::ClientNavigationDisposition,
288}
289#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
290pub enum FrameRequestedNavigationMethod {
291 #[serde(rename = "Page.frameRequestedNavigation")]
292 FrameRequestedNavigation,
293}
294#[doc = "Fired when a renderer-initiated navigation is requested.\nNavigation may still be cancelled after the event is issued.\n[frameRequestedNavigation](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameRequestedNavigation)"]
295#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
296pub struct FrameRequestedNavigation {
297 pub method: FrameRequestedNavigationMethod,
298 pub params: FrameRequestedNavigationParams,
299}
300impl FrameRequestedNavigation {
301 pub const IDENTIFIER: &'static str = "Page.frameRequestedNavigation";
302 pub fn identifier(&self) -> &'static str {
303 Self::IDENTIFIER
304 }
305}
306#[doc = "Fired when frame has started loading.\n[frameStartedLoading](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameStartedLoading)"]
307#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
308pub struct FrameStartedLoadingParams {
309 #[doc = "Id of the frame that has started loading."]
310 #[serde(rename = "frameId")]
311 pub frame_id: Box<super::types::FrameId>,
312}
313#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
314pub enum FrameStartedLoadingMethod {
315 #[serde(rename = "Page.frameStartedLoading")]
316 FrameStartedLoading,
317}
318#[doc = "Fired when frame has started loading.\n[frameStartedLoading](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameStartedLoading)"]
319#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
320pub struct FrameStartedLoading {
321 pub method: FrameStartedLoadingMethod,
322 pub params: FrameStartedLoadingParams,
323}
324impl FrameStartedLoading {
325 pub const IDENTIFIER: &'static str = "Page.frameStartedLoading";
326 pub fn identifier(&self) -> &'static str {
327 Self::IDENTIFIER
328 }
329}
330#[doc = "Fired when frame has stopped loading.\n[frameStoppedLoading](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameStoppedLoading)"]
331#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
332pub struct FrameStoppedLoadingParams {
333 #[doc = "Id of the frame that has stopped loading."]
334 #[serde(rename = "frameId")]
335 pub frame_id: Box<super::types::FrameId>,
336}
337#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
338pub enum FrameStoppedLoadingMethod {
339 #[serde(rename = "Page.frameStoppedLoading")]
340 FrameStoppedLoading,
341}
342#[doc = "Fired when frame has stopped loading.\n[frameStoppedLoading](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameStoppedLoading)"]
343#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
344pub struct FrameStoppedLoading {
345 pub method: FrameStoppedLoadingMethod,
346 pub params: FrameStoppedLoadingParams,
347}
348impl FrameStoppedLoading {
349 pub const IDENTIFIER: &'static str = "Page.frameStoppedLoading";
350 pub fn identifier(&self) -> &'static str {
351 Self::IDENTIFIER
352 }
353}
354#[doc = "Fired when interstitial page was hidden\n[interstitialHidden](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-interstitialHidden)"]
355#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
356pub struct InterstitialHiddenParams {}
357#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
358pub enum InterstitialHiddenMethod {
359 #[serde(rename = "Page.interstitialHidden")]
360 InterstitialHidden,
361}
362#[doc = "Fired when interstitial page was hidden\n[interstitialHidden](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-interstitialHidden)"]
363#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
364pub struct InterstitialHidden {
365 pub method: InterstitialHiddenMethod,
366 pub params: InterstitialHiddenParams,
367}
368impl InterstitialHidden {
369 pub const IDENTIFIER: &'static str = "Page.interstitialHidden";
370 pub fn identifier(&self) -> &'static str {
371 Self::IDENTIFIER
372 }
373}
374#[doc = "Fired when interstitial page was shown\n[interstitialShown](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-interstitialShown)"]
375#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
376pub struct InterstitialShownParams {}
377#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
378pub enum InterstitialShownMethod {
379 #[serde(rename = "Page.interstitialShown")]
380 InterstitialShown,
381}
382#[doc = "Fired when interstitial page was shown\n[interstitialShown](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-interstitialShown)"]
383#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
384pub struct InterstitialShown {
385 pub method: InterstitialShownMethod,
386 pub params: InterstitialShownParams,
387}
388impl InterstitialShown {
389 pub const IDENTIFIER: &'static str = "Page.interstitialShown";
390 pub fn identifier(&self) -> &'static str {
391 Self::IDENTIFIER
392 }
393}
394#[doc = "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been\nclosed.\n[javascriptDialogClosed](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-javascriptDialogClosed)"]
395#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
396pub struct JavascriptDialogClosedParams {
397 #[doc = "Frame id."]
398 #[serde(rename = "frameId")]
399 pub frame_id: Box<super::types::FrameId>,
400 #[doc = "Whether dialog was confirmed."]
401 #[serde(rename = "result")]
402 pub result: bool,
403 #[doc = "User input in case of prompt."]
404 #[serde(rename = "userInput")]
405 pub user_input: String,
406}
407#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
408pub enum JavascriptDialogClosedMethod {
409 #[serde(rename = "Page.javascriptDialogClosed")]
410 JavascriptDialogClosed,
411}
412#[doc = "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been\nclosed.\n[javascriptDialogClosed](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-javascriptDialogClosed)"]
413#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
414pub struct JavascriptDialogClosed {
415 pub method: JavascriptDialogClosedMethod,
416 pub params: JavascriptDialogClosedParams,
417}
418impl JavascriptDialogClosed {
419 pub const IDENTIFIER: &'static str = "Page.javascriptDialogClosed";
420 pub fn identifier(&self) -> &'static str {
421 Self::IDENTIFIER
422 }
423}
424#[doc = "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to\nopen.\n[javascriptDialogOpening](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-javascriptDialogOpening)"]
425#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
426pub struct JavascriptDialogOpeningParams {
427 #[doc = "Frame url."]
428 #[serde(rename = "url")]
429 pub url: String,
430 #[doc = "Frame id."]
431 #[serde(rename = "frameId")]
432 pub frame_id: Box<super::types::FrameId>,
433 #[doc = "Message that will be displayed by the dialog."]
434 #[serde(rename = "message")]
435 pub message: String,
436 #[doc = "Dialog type."]
437 #[serde(rename = "type")]
438 pub r#type: super::types::DialogType,
439 #[doc = "True iff browser is capable showing or acting on the given dialog. When browser has no\ndialog handler for given target, calling alert while Page domain is engaged will stall\nthe page execution. Execution can be resumed via calling Page.handleJavaScriptDialog."]
440 #[serde(rename = "hasBrowserHandler")]
441 pub has_browser_handler: bool,
442 #[doc = "Default dialog prompt."]
443 #[serde(rename = "defaultPrompt")]
444 #[serde(skip_serializing_if = "Option::is_none")]
445 #[serde(default)]
446 pub default_prompt: Option<String>,
447}
448#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
449pub enum JavascriptDialogOpeningMethod {
450 #[serde(rename = "Page.javascriptDialogOpening")]
451 JavascriptDialogOpening,
452}
453#[doc = "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to\nopen.\n[javascriptDialogOpening](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-javascriptDialogOpening)"]
454#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
455pub struct JavascriptDialogOpening {
456 pub method: JavascriptDialogOpeningMethod,
457 pub params: JavascriptDialogOpeningParams,
458}
459impl JavascriptDialogOpening {
460 pub const IDENTIFIER: &'static str = "Page.javascriptDialogOpening";
461 pub fn identifier(&self) -> &'static str {
462 Self::IDENTIFIER
463 }
464}
465#[doc = "Fired for lifecycle events (navigation, load, paint, etc) in the current\ntarget (including local frames).\n[lifecycleEvent](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-lifecycleEvent)"]
466#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
467pub struct LifecycleEventParams {
468 #[doc = "Id of the frame."]
469 #[serde(rename = "frameId")]
470 pub frame_id: Box<super::types::FrameId>,
471 #[doc = "Loader identifier. Empty string if the request is fetched from worker."]
472 #[serde(rename = "loaderId")]
473 pub loader_id: crate::browser_protocol::network::types::LoaderId,
474 #[serde(rename = "name")]
475 pub name: String,
476 #[serde(rename = "timestamp")]
477 pub timestamp: crate::browser_protocol::network::types::MonotonicTime,
478}
479#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
480pub enum LifecycleEventMethod {
481 #[serde(rename = "Page.lifecycleEvent")]
482 LifecycleEvent,
483}
484#[doc = "Fired for lifecycle events (navigation, load, paint, etc) in the current\ntarget (including local frames).\n[lifecycleEvent](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-lifecycleEvent)"]
485#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
486pub struct LifecycleEvent {
487 pub method: LifecycleEventMethod,
488 pub params: LifecycleEventParams,
489}
490impl LifecycleEvent {
491 pub const IDENTIFIER: &'static str = "Page.lifecycleEvent";
492 pub fn identifier(&self) -> &'static str {
493 Self::IDENTIFIER
494 }
495}
496#[doc = "Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do\nnot assume any ordering with the Page.frameNavigated event. This event is fired only for\nmain-frame history navigation where the document changes (non-same-document navigations),\nwhen bfcache navigation fails.\n[backForwardCacheNotUsed](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-backForwardCacheNotUsed)"]
497#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
498pub struct BackForwardCacheNotUsedParams {
499 #[doc = "The loader id for the associated navigation."]
500 #[serde(rename = "loaderId")]
501 pub loader_id: crate::browser_protocol::network::types::LoaderId,
502 #[doc = "The frame id of the associated frame."]
503 #[serde(rename = "frameId")]
504 pub frame_id: Box<super::types::FrameId>,
505 #[doc = "Array of reasons why the page could not be cached. This must not be empty."]
506 #[serde(rename = "notRestoredExplanations")]
507 #[serde(skip_serializing_if = "Vec::is_empty")]
508 pub not_restored_explanations: Vec<super::types::BackForwardCacheNotRestoredExplanation>,
509 #[doc = "Tree structure of reasons why the page could not be cached for each frame."]
510 #[serde(rename = "notRestoredExplanationsTree")]
511 #[serde(skip_serializing_if = "Option::is_none")]
512 #[serde(default)]
513 pub not_restored_explanations_tree:
514 Option<super::types::BackForwardCacheNotRestoredExplanationTree>,
515}
516#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
517pub enum BackForwardCacheNotUsedMethod {
518 #[serde(rename = "Page.backForwardCacheNotUsed")]
519 BackForwardCacheNotUsed,
520}
521#[doc = "Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do\nnot assume any ordering with the Page.frameNavigated event. This event is fired only for\nmain-frame history navigation where the document changes (non-same-document navigations),\nwhen bfcache navigation fails.\n[backForwardCacheNotUsed](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-backForwardCacheNotUsed)"]
522#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
523pub struct BackForwardCacheNotUsed {
524 pub method: BackForwardCacheNotUsedMethod,
525 pub params: BackForwardCacheNotUsedParams,
526}
527impl BackForwardCacheNotUsed {
528 pub const IDENTIFIER: &'static str = "Page.backForwardCacheNotUsed";
529 pub fn identifier(&self) -> &'static str {
530 Self::IDENTIFIER
531 }
532}
533#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
534pub struct LoadEventFiredParams {
535 #[serde(rename = "timestamp")]
536 pub timestamp: crate::browser_protocol::network::types::MonotonicTime,
537}
538#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
539pub enum LoadEventFiredMethod {
540 #[serde(rename = "Page.loadEventFired")]
541 LoadEventFired,
542}
543#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
544pub struct LoadEventFired {
545 pub method: LoadEventFiredMethod,
546 pub params: LoadEventFiredParams,
547}
548impl LoadEventFired {
549 pub const IDENTIFIER: &'static str = "Page.loadEventFired";
550 pub fn identifier(&self) -> &'static str {
551 Self::IDENTIFIER
552 }
553}
554#[doc = "Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation.\n[navigatedWithinDocument](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-navigatedWithinDocument)"]
555#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
556pub struct NavigatedWithinDocumentParams {
557 #[doc = "Id of the frame."]
558 #[serde(rename = "frameId")]
559 pub frame_id: Box<super::types::FrameId>,
560 #[doc = "Frame's new url."]
561 #[serde(rename = "url")]
562 pub url: String,
563 #[doc = "Navigation type"]
564 #[serde(rename = "navigationType")]
565 pub navigation_type: NavigatedWithinDocumentNavigationType,
566}
567#[doc = "Navigation type"]
568#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
569pub enum NavigatedWithinDocumentNavigationType {
570 #[doc = "Navigation due to fragment navigation."]
571 #[serde(rename = "fragment")]
572 Fragment,
573 #[doc = "Navigation due to history API usage."]
574 #[serde(rename = "historyApi")]
575 HistoryApi,
576 #[doc = "Navigation due to other reasons."]
577 #[serde(rename = "other")]
578 Other,
579}
580#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
581pub enum NavigatedWithinDocumentMethod {
582 #[serde(rename = "Page.navigatedWithinDocument")]
583 NavigatedWithinDocument,
584}
585#[doc = "Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation.\n[navigatedWithinDocument](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-navigatedWithinDocument)"]
586#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
587pub struct NavigatedWithinDocument {
588 pub method: NavigatedWithinDocumentMethod,
589 pub params: NavigatedWithinDocumentParams,
590}
591impl NavigatedWithinDocument {
592 pub const IDENTIFIER: &'static str = "Page.navigatedWithinDocument";
593 pub fn identifier(&self) -> &'static str {
594 Self::IDENTIFIER
595 }
596}
597#[doc = "Compressed image data requested by the `startScreencast`.\n[screencastFrame](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-screencastFrame)"]
598#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
599pub struct ScreencastFrameParams {
600 #[doc = "Base64-encoded compressed image."]
601 #[serde(rename = "data")]
602 pub data: crate::Binary,
603 #[doc = "Screencast frame metadata."]
604 #[serde(rename = "metadata")]
605 pub metadata: super::types::ScreencastFrameMetadata,
606 #[doc = "Frame number."]
607 #[serde(rename = "sessionId")]
608 pub session_id: i64,
609}
610#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
611pub enum ScreencastFrameMethod {
612 #[serde(rename = "Page.screencastFrame")]
613 ScreencastFrame,
614}
615#[doc = "Compressed image data requested by the `startScreencast`.\n[screencastFrame](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-screencastFrame)"]
616#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
617pub struct ScreencastFrame {
618 pub method: ScreencastFrameMethod,
619 pub params: ScreencastFrameParams,
620}
621impl ScreencastFrame {
622 pub const IDENTIFIER: &'static str = "Page.screencastFrame";
623 pub fn identifier(&self) -> &'static str {
624 Self::IDENTIFIER
625 }
626}
627#[doc = "Fired when the page with currently enabled screencast was shown or hidden `.\n[screencastVisibilityChanged](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-screencastVisibilityChanged)"]
628#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
629pub struct ScreencastVisibilityChangedParams {
630 #[doc = "True if the page is visible."]
631 #[serde(rename = "visible")]
632 pub visible: bool,
633}
634#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
635pub enum ScreencastVisibilityChangedMethod {
636 #[serde(rename = "Page.screencastVisibilityChanged")]
637 ScreencastVisibilityChanged,
638}
639#[doc = "Fired when the page with currently enabled screencast was shown or hidden `.\n[screencastVisibilityChanged](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-screencastVisibilityChanged)"]
640#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
641pub struct ScreencastVisibilityChanged {
642 pub method: ScreencastVisibilityChangedMethod,
643 pub params: ScreencastVisibilityChangedParams,
644}
645impl ScreencastVisibilityChanged {
646 pub const IDENTIFIER: &'static str = "Page.screencastVisibilityChanged";
647 pub fn identifier(&self) -> &'static str {
648 Self::IDENTIFIER
649 }
650}
651#[doc = "Fired when a new window is going to be opened, via window.open(), link click, form submission,\netc.\n[windowOpen](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-windowOpen)"]
652#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
653pub struct WindowOpenParams {
654 #[doc = "The URL for the new window."]
655 #[serde(rename = "url")]
656 pub url: String,
657 #[doc = "Window name."]
658 #[serde(rename = "windowName")]
659 pub window_name: String,
660 #[doc = "An array of enabled window features."]
661 #[serde(rename = "windowFeatures")]
662 #[serde(skip_serializing_if = "Vec::is_empty")]
663 pub window_features: Vec<String>,
664 #[doc = "Whether or not it was triggered by user gesture."]
665 #[serde(rename = "userGesture")]
666 pub user_gesture: bool,
667}
668#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
669pub enum WindowOpenMethod {
670 #[serde(rename = "Page.windowOpen")]
671 WindowOpen,
672}
673#[doc = "Fired when a new window is going to be opened, via window.open(), link click, form submission,\netc.\n[windowOpen](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-windowOpen)"]
674#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
675pub struct WindowOpen {
676 pub method: WindowOpenMethod,
677 pub params: WindowOpenParams,
678}
679impl WindowOpen {
680 pub const IDENTIFIER: &'static str = "Page.windowOpen";
681 pub fn identifier(&self) -> &'static str {
682 Self::IDENTIFIER
683 }
684}
685#[doc = "Issued for every compilation cache generated.\n[compilationCacheProduced](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-compilationCacheProduced)"]
686#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
687pub struct CompilationCacheProducedParams {
688 #[serde(rename = "url")]
689 pub url: String,
690 #[doc = "Base64-encoded data"]
691 #[serde(rename = "data")]
692 pub data: crate::Binary,
693}
694#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
695pub enum CompilationCacheProducedMethod {
696 #[serde(rename = "Page.compilationCacheProduced")]
697 CompilationCacheProduced,
698}
699#[doc = "Issued for every compilation cache generated.\n[compilationCacheProduced](https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-compilationCacheProduced)"]
700#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
701pub struct CompilationCacheProduced {
702 pub method: CompilationCacheProducedMethod,
703 pub params: CompilationCacheProducedParams,
704}
705impl CompilationCacheProduced {
706 pub const IDENTIFIER: &'static str = "Page.compilationCacheProduced";
707 pub fn identifier(&self) -> &'static str {
708 Self::IDENTIFIER
709 }
710}
711group_enum ! (PageEvents { DomContentEventFired (DomContentEventFired) , FileChooserOpened (FileChooserOpened) , FrameAttached (FrameAttached) , FrameDetached (FrameDetached) , FrameSubtreeWillBeDetached (FrameSubtreeWillBeDetached) , FrameNavigated (FrameNavigated) , DocumentOpened (DocumentOpened) , FrameResized (FrameResized) , FrameStartedNavigating (FrameStartedNavigating) , FrameRequestedNavigation (FrameRequestedNavigation) , FrameStartedLoading (FrameStartedLoading) , FrameStoppedLoading (FrameStoppedLoading) , InterstitialHidden (InterstitialHidden) , InterstitialShown (InterstitialShown) , JavascriptDialogClosed (JavascriptDialogClosed) , JavascriptDialogOpening (JavascriptDialogOpening) , LifecycleEvent (LifecycleEvent) , BackForwardCacheNotUsed (BackForwardCacheNotUsed) , LoadEventFired (LoadEventFired) , NavigatedWithinDocument (NavigatedWithinDocument) , ScreencastFrame (ScreencastFrame) , ScreencastVisibilityChanged (ScreencastVisibilityChanged) , WindowOpen (WindowOpen) , CompilationCacheProduced (CompilationCacheProduced) } + identifiable);