use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DomBreakpointType {
#[serde(rename = "subtree-modified")]
SubtreeModified,
#[serde(rename = "attribute-modified")]
AttributeModified,
#[serde(rename = "node-removed")]
NodeRemoved,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum CspViolationType {
#[serde(rename = "trustedtype-sink-violation")]
TrustedtypeSinkViolation,
#[serde(rename = "trustedtype-policy-violation")]
TrustedtypePolicyViolation,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EventListener {
pub r#type: String,
#[serde(rename = "useCapture")]
pub use_capture: bool,
pub passive: bool,
pub once: bool,
#[serde(rename = "scriptId")]
pub script_id: crate::protocol::runtime::ScriptId,
#[serde(rename = "lineNumber")]
pub line_number: i64,
#[serde(rename = "columnNumber")]
pub column_number: i64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub handler: Option<crate::protocol::runtime::RemoteObject>,
#[serde(
rename = "originalHandler",
default,
skip_serializing_if = "Option::is_none"
)]
pub original_handler: Option<crate::protocol::runtime::RemoteObject>,
#[serde(
rename = "backendNodeId",
default,
skip_serializing_if = "Option::is_none"
)]
pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetEventListenersParams {
#[serde(rename = "objectId")]
pub object_id: crate::protocol::runtime::RemoteObjectId,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub depth: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pierce: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetEventListenersReturns {
pub listeners: Vec<EventListener>,
}
impl crate::typed::Command for GetEventListenersParams {
const METHOD: &'static str = "DOMDebugger.getEventListeners";
type Returns = GetEventListenersReturns;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveDomBreakpointParams {
#[serde(rename = "nodeId")]
pub node_id: crate::protocol::dom::NodeId,
pub r#type: DomBreakpointType,
}
impl crate::typed::Command for RemoveDomBreakpointParams {
const METHOD: &'static str = "DOMDebugger.removeDOMBreakpoint";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RemoveEventListenerBreakpointParams {
#[serde(rename = "eventName")]
pub event_name: String,
#[serde(
rename = "targetName",
default,
skip_serializing_if = "Option::is_none"
)]
pub target_name: Option<String>,
}
impl crate::typed::Command for RemoveEventListenerBreakpointParams {
const METHOD: &'static str = "DOMDebugger.removeEventListenerBreakpoint";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RemoveInstrumentationBreakpointParams {
#[serde(rename = "eventName")]
pub event_name: String,
}
impl crate::typed::Command for RemoveInstrumentationBreakpointParams {
const METHOD: &'static str = "DOMDebugger.removeInstrumentationBreakpoint";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RemoveXhrBreakpointParams {
pub url: String,
}
impl crate::typed::Command for RemoveXhrBreakpointParams {
const METHOD: &'static str = "DOMDebugger.removeXHRBreakpoint";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetBreakOnCspViolationParams {
#[serde(rename = "violationTypes")]
pub violation_types: Vec<CspViolationType>,
}
impl crate::typed::Command for SetBreakOnCspViolationParams {
const METHOD: &'static str = "DOMDebugger.setBreakOnCSPViolation";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDomBreakpointParams {
#[serde(rename = "nodeId")]
pub node_id: crate::protocol::dom::NodeId,
pub r#type: DomBreakpointType,
}
impl crate::typed::Command for SetDomBreakpointParams {
const METHOD: &'static str = "DOMDebugger.setDOMBreakpoint";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetEventListenerBreakpointParams {
#[serde(rename = "eventName")]
pub event_name: String,
#[serde(
rename = "targetName",
default,
skip_serializing_if = "Option::is_none"
)]
pub target_name: Option<String>,
}
impl crate::typed::Command for SetEventListenerBreakpointParams {
const METHOD: &'static str = "DOMDebugger.setEventListenerBreakpoint";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetInstrumentationBreakpointParams {
#[serde(rename = "eventName")]
pub event_name: String,
}
impl crate::typed::Command for SetInstrumentationBreakpointParams {
const METHOD: &'static str = "DOMDebugger.setInstrumentationBreakpoint";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetXhrBreakpointParams {
pub url: String,
}
impl crate::typed::Command for SetXhrBreakpointParams {
const METHOD: &'static str = "DOMDebugger.setXHRBreakpoint";
type Returns = crate::typed::NoReturns;
}