1use serde::{Deserialize, Serialize};
13
14#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
16pub enum DomBreakpointType {
17 #[serde(rename = "subtree-modified")]
19 SubtreeModified,
20 #[serde(rename = "attribute-modified")]
22 AttributeModified,
23 #[serde(rename = "node-removed")]
25 NodeRemoved,
26 #[serde(untagged)]
30 Unrecognized(String),
31}
32
33#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
37pub enum CspViolationType {
38 #[serde(rename = "trustedtype-sink-violation")]
40 TrustedtypeSinkViolation,
41 #[serde(rename = "trustedtype-policy-violation")]
43 TrustedtypePolicyViolation,
44 #[serde(untagged)]
48 Unrecognized(String),
49}
50
51#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
53pub struct EventListener {
54 pub r#type: String,
56 #[serde(rename = "useCapture")]
58 pub use_capture: bool,
59 pub passive: bool,
61 pub once: bool,
63 #[serde(rename = "scriptId")]
65 pub script_id: crate::protocol::runtime::ScriptId,
66 #[serde(rename = "lineNumber")]
68 pub line_number: i64,
69 #[serde(rename = "columnNumber")]
71 pub column_number: i64,
72 #[serde(default, skip_serializing_if = "Option::is_none")]
74 pub handler: Option<crate::protocol::runtime::RemoteObject>,
75 #[serde(
77 rename = "originalHandler",
78 default,
79 skip_serializing_if = "Option::is_none"
80 )]
81 pub original_handler: Option<crate::protocol::runtime::RemoteObject>,
82 #[serde(
84 rename = "backendNodeId",
85 default,
86 skip_serializing_if = "Option::is_none"
87 )]
88 pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
89}
90
91#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
95pub struct GetEventListenersParams {
96 #[serde(rename = "objectId")]
98 pub object_id: crate::protocol::runtime::RemoteObjectId,
99 #[serde(default, skip_serializing_if = "Option::is_none")]
102 pub depth: Option<i64>,
103 #[serde(default, skip_serializing_if = "Option::is_none")]
107 pub pierce: Option<bool>,
108}
109
110#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
112pub struct GetEventListenersReturns {
113 pub listeners: Vec<EventListener>,
115}
116
117impl crate::typed::Command for GetEventListenersParams {
118 const METHOD: &'static str = "DOMDebugger.getEventListeners";
119 type Returns = GetEventListenersReturns;
120}
121
122#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
126pub struct RemoveDomBreakpointParams {
127 #[serde(rename = "nodeId")]
129 pub node_id: crate::protocol::dom::NodeId,
130 pub r#type: DomBreakpointType,
132}
133
134impl crate::typed::Command for RemoveDomBreakpointParams {
135 const METHOD: &'static str = "DOMDebugger.removeDOMBreakpoint";
136 type Returns = crate::typed::NoReturns;
137}
138
139#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
143pub struct RemoveEventListenerBreakpointParams {
144 #[serde(rename = "eventName")]
146 pub event_name: String,
147 #[serde(
151 rename = "targetName",
152 default,
153 skip_serializing_if = "Option::is_none"
154 )]
155 pub target_name: Option<String>,
156}
157
158impl crate::typed::Command for RemoveEventListenerBreakpointParams {
159 const METHOD: &'static str = "DOMDebugger.removeEventListenerBreakpoint";
160 type Returns = crate::typed::NoReturns;
161}
162
163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
171pub struct RemoveInstrumentationBreakpointParams {
172 #[serde(rename = "eventName")]
174 pub event_name: String,
175}
176
177impl crate::typed::Command for RemoveInstrumentationBreakpointParams {
178 const METHOD: &'static str = "DOMDebugger.removeInstrumentationBreakpoint";
179 type Returns = crate::typed::NoReturns;
180}
181
182#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
186pub struct RemoveXhrBreakpointParams {
187 pub url: String,
189}
190
191impl crate::typed::Command for RemoveXhrBreakpointParams {
192 const METHOD: &'static str = "DOMDebugger.removeXHRBreakpoint";
193 type Returns = crate::typed::NoReturns;
194}
195
196#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
202pub struct SetBreakOnCspViolationParams {
203 #[serde(rename = "violationTypes")]
205 pub violation_types: Vec<CspViolationType>,
206}
207
208impl crate::typed::Command for SetBreakOnCspViolationParams {
209 const METHOD: &'static str = "DOMDebugger.setBreakOnCSPViolation";
210 type Returns = crate::typed::NoReturns;
211}
212
213#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
217pub struct SetDomBreakpointParams {
218 #[serde(rename = "nodeId")]
220 pub node_id: crate::protocol::dom::NodeId,
221 pub r#type: DomBreakpointType,
223}
224
225impl crate::typed::Command for SetDomBreakpointParams {
226 const METHOD: &'static str = "DOMDebugger.setDOMBreakpoint";
227 type Returns = crate::typed::NoReturns;
228}
229
230#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
234pub struct SetEventListenerBreakpointParams {
235 #[serde(rename = "eventName")]
237 pub event_name: String,
238 #[serde(
243 rename = "targetName",
244 default,
245 skip_serializing_if = "Option::is_none"
246 )]
247 pub target_name: Option<String>,
248}
249
250impl crate::typed::Command for SetEventListenerBreakpointParams {
251 const METHOD: &'static str = "DOMDebugger.setEventListenerBreakpoint";
252 type Returns = crate::typed::NoReturns;
253}
254
255#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
263pub struct SetInstrumentationBreakpointParams {
264 #[serde(rename = "eventName")]
266 pub event_name: String,
267}
268
269impl crate::typed::Command for SetInstrumentationBreakpointParams {
270 const METHOD: &'static str = "DOMDebugger.setInstrumentationBreakpoint";
271 type Returns = crate::typed::NoReturns;
272}
273
274#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
278pub struct SetXhrBreakpointParams {
279 pub url: String,
282}
283
284impl crate::typed::Command for SetXhrBreakpointParams {
285 const METHOD: &'static str = "DOMDebugger.setXHRBreakpoint";
286 type Returns = crate::typed::NoReturns;
287}