dom_debugger
CSPViolationType
Bases: Enum
CSP Violation type.
Source code in zendriver/cdp/dom_debugger.py
TRUSTEDTYPE_POLICY_VIOLATION = 'trustedtype-policy-violation'
class-attribute
instance-attribute
TRUSTEDTYPE_SINK_VIOLATION = 'trustedtype-sink-violation'
class-attribute
instance-attribute
from_json(json)
classmethod
DOMBreakpointType
Bases: Enum
DOM breakpoint type.
Source code in zendriver/cdp/dom_debugger.py
ATTRIBUTE_MODIFIED = 'attribute-modified'
class-attribute
instance-attribute
NODE_REMOVED = 'node-removed'
class-attribute
instance-attribute
SUBTREE_MODIFIED = 'subtree-modified'
class-attribute
instance-attribute
from_json(json)
classmethod
EventListener
dataclass
Object event listener.
Source code in zendriver/cdp/dom_debugger.py
backend_node_id: typing.Optional[dom.BackendNodeId] = None
class-attribute
instance-attribute
column_number: int
instance-attribute
handler: typing.Optional[runtime.RemoteObject] = None
class-attribute
instance-attribute
line_number: int
instance-attribute
once: bool
instance-attribute
original_handler: typing.Optional[runtime.RemoteObject] = None
class-attribute
instance-attribute
passive: bool
instance-attribute
script_id: runtime.ScriptId
instance-attribute
type_: str
instance-attribute
use_capture: bool
instance-attribute
__init__(type_, use_capture, passive, once, script_id, line_number, column_number, handler=None, original_handler=None, backend_node_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/dom_debugger.py
to_json()
Source code in zendriver/cdp/dom_debugger.py
get_event_listeners(object_id, depth=None, pierce=None)
Returns event listeners of the given object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object_id
|
RemoteObjectId
|
Identifier of the object to return listeners for. |
required |
depth
|
Optional[int]
|
(Optional) The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. |
None
|
pierce
|
Optional[bool]
|
(Optional) Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Reports listeners for all contexts if pierce is enabled. |
None
|
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[EventListener]]
|
Array of relevant listeners. |
Source code in zendriver/cdp/dom_debugger.py
remove_dom_breakpoint(node_id, type_)
Removes DOM breakpoint that was set using setDOMBreakpoint
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_id
|
NodeId
|
Identifier of the node to remove breakpoint from. |
required |
type_
|
DOMBreakpointType
|
Type of the breakpoint to remove. |
required |
Source code in zendriver/cdp/dom_debugger.py
remove_event_listener_breakpoint(event_name, target_name=None)
Removes breakpoint on particular DOM event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event_name
|
str
|
Event name. |
required |
target_name
|
Optional[str]
|
(EXPERIMENTAL) (Optional) EventTarget interface name. |
None
|
Source code in zendriver/cdp/dom_debugger.py
remove_instrumentation_breakpoint(event_name)
Removes breakpoint on particular native event.
.. deprecated:: 1.3
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event_name
|
str
|
Instrumentation name to stop on. |
required |
Source code in zendriver/cdp/dom_debugger.py
remove_xhr_breakpoint(url)
Removes breakpoint from XMLHttpRequest.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
Resource URL substring. |
required |
Source code in zendriver/cdp/dom_debugger.py
set_break_on_csp_violation(violation_types)
Sets breakpoint on particular CSP violations.
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
violation_types
|
List[CSPViolationType]
|
CSP Violations to stop upon. |
required |
Source code in zendriver/cdp/dom_debugger.py
set_dom_breakpoint(node_id, type_)
Sets breakpoint on particular operation with DOM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_id
|
NodeId
|
Identifier of the node to set breakpoint on. |
required |
type_
|
DOMBreakpointType
|
Type of the operation to stop upon. |
required |
Source code in zendriver/cdp/dom_debugger.py
set_event_listener_breakpoint(event_name, target_name=None)
Sets breakpoint on particular DOM event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event_name
|
str
|
DOM Event name to stop on (any DOM event will do). |
required |
target_name
|
Optional[str]
|
(EXPERIMENTAL) (Optional) EventTarget interface name to stop on. If equal to |
None
|
Source code in zendriver/cdp/dom_debugger.py
set_instrumentation_breakpoint(event_name)
Sets breakpoint on particular native event.
.. deprecated:: 1.3
EXPERIMENTAL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event_name
|
str
|
Instrumentation name to stop on. |
required |
Source code in zendriver/cdp/dom_debugger.py
set_xhr_breakpoint(url)
Sets breakpoint on XMLHttpRequest.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
Resource URL substring. All XHRs having this substring in the URL will get stopped upon. |
required |