1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Page accessor methods.
//!
//! This module contains getter methods for accessing page properties.
use std::sync::Arc;
use viewpoint_cdp::CdpConnection;
use super::Page;
impl Page {
/// Get the target ID.
pub fn target_id(&self) -> &str {
&self.target_id
}
/// Get the session ID.
pub fn session_id(&self) -> &str {
&self.session_id
}
/// Get the main frame ID.
pub fn frame_id(&self) -> &str {
&self.frame_id
}
/// Get the context index.
///
/// This is used for generating scoped element refs in the format
/// `c{contextIndex}p{pageIndex}e{counter}`.
pub fn context_index(&self) -> usize {
self.context_index
}
/// Get the page index.
///
/// This is used for generating scoped element refs in the format
/// `c{contextIndex}p{pageIndex}e{counter}`.
pub fn index(&self) -> usize {
self.page_index
}
/// Get a reference to the CDP connection.
pub fn connection(&self) -> &Arc<CdpConnection> {
&self.connection
}
}