DOMDebugger#
DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.
Types#
Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.
- class DOMBreakpointType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
DOM breakpoint type.
- SUBTREE_MODIFIED = 'subtree-modified'#
- ATTRIBUTE_MODIFIED = 'attribute-modified'#
- NODE_REMOVED = 'node-removed'#
- class CSPViolationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
CSP Violation type.
- TRUSTEDTYPE_SINK_VIOLATION = 'trustedtype-sink-violation'#
- TRUSTEDTYPE_POLICY_VIOLATION = 'trustedtype-policy-violation'#
- class EventListener(type_, use_capture, passive, once, script_id, line_number, column_number, handler=None, original_handler=None, backend_node_id=None)[source]#
Object event listener.
-
handler:
Optional[RemoteObject] = None# Event handler function value.
-
original_handler:
Optional[RemoteObject] = None# Event original handler function value.
-
backend_node_id:
Optional[BackendNodeId] = None# Node the listener is added to (if any).
-
handler:
Commands#
Each command is a generator function. The return
type Generator[x, y, z] indicates that the generator
yields arguments of type x, it must be resumed with
an argument of type y, and it returns type z. In
this library, types x and y are the same for all
commands, and z is the return type you should pay attention
to. For more information, see
Getting Started: Commands.
- get_event_listeners(object_id, depth=None, pierce=None)[source]#
Returns event listeners of the given object.
- Parameters:
object_id (
RemoteObjectId) – Identifier of the object to return listeners for.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.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.
- Return type:
Generator[Dict[str,Any],Dict[str,Any],List[EventListener]]- Returns:
Array of relevant listeners.
- remove_dom_breakpoint(node_id, type_)[source]#
Removes DOM breakpoint that was set using
setDOMBreakpoint.
- remove_event_listener_breakpoint(event_name, target_name=None)[source]#
Removes breakpoint on particular DOM event.
- remove_instrumentation_breakpoint(event_name)[source]#
Removes breakpoint on particular native event.
Deprecated since version 1.3.
EXPERIMENTAL
- Parameters:
event_name (
str) – Instrumentation name to stop on.- Return type:
Deprecated since version 1.3.
- set_break_on_csp_violation(violation_types)[source]#
Sets breakpoint on particular CSP violations.
EXPERIMENTAL
- set_event_listener_breakpoint(event_name, target_name=None)[source]#
Sets breakpoint on particular DOM event.
- Parameters:
- Return type:
Events#
There are no events in this module.