CDPotion.Domain.DOMDebugger (cdpotion v0.1.4)

Summary

Types

CSP Violation type.

DOM breakpoint type.

Object event listener.

Functions

Returns event listeners of the given object.

Removes DOM breakpoint that was set using setDOMBreakpoint.

Removes breakpoint on particular DOM event.

Removes breakpoint on particular native event.

Removes breakpoint from XMLHttpRequest.

Sets breakpoint on particular CSP violations.

Sets breakpoint on particular operation with DOM.

Sets breakpoint on particular DOM event.

Sets breakpoint on particular native event.

Sets breakpoint on XMLHttpRequest.

Types

Link to this type

csp_violation_type()

@type csp_violation_type() ::
  :"trustedtype-sink-violation" | :"trustedtype-policy-violation"

CSP Violation type.

Link to this type

dom_breakpoint_type()

@type dom_breakpoint_type() ::
  :"subtree-modified" | :"attribute-modified" | :"node-removed"

DOM breakpoint type.

Link to this type

event_listener()

@type event_listener() :: %{
  backendNodeId: CDPotion.Domain.DOM.backend_node_id() | nil,
  columnNumber: integer(),
  handler: CDPotion.Domain.Runtime.remote_object() | nil,
  lineNumber: integer(),
  once: boolean(),
  originalHandler: CDPotion.Domain.Runtime.remote_object() | nil,
  passive: boolean(),
  scriptId: CDPotion.Domain.Runtime.script_id(),
  type: String.t(),
  useCapture: boolean()
}

Object event listener.

Functions

Link to this function

get_event_listeners(object_id, depth \\ nil, pierce \\ nil)

@spec get_event_listeners(
  CDPotion.Domain.Runtime.remote_object_id(),
  integer(),
  boolean()
) ::
  {String.t(), map()}

Returns event listeners of the given object.

Parameters:

  • (Required) object_id: Identifier of the object to return listeners for.
  • (Optional) depth: 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.
  • (Optional) pierce: 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.
Link to this function

remove_dom_breakpoint(node_id, type)

@spec remove_dom_breakpoint(
  CDPotion.Domain.DOM.node_id(),
  dom_breakpoint_type()
) :: {String.t(), map()}

Removes DOM breakpoint that was set using setDOMBreakpoint.

Parameters:

  • (Required) node_id: Identifier of the node to remove breakpoint from.
  • (Required) type: Type of the breakpoint to remove.
Link to this function

remove_event_listener_breakpoint(event_name, target_name \\ nil)

@spec remove_event_listener_breakpoint(String.t(), String.t()) :: {String.t(), map()}

Removes breakpoint on particular DOM event.

Parameters:

  • (Required) event_name: Event name.
  • (Optional) target_name: EventTarget interface name.
Link to this function

remove_instrumentation_breakpoint(event_name)

@spec remove_instrumentation_breakpoint(String.t()) :: {String.t(), map()}

Removes breakpoint on particular native event.

Parameters:

  • (Required) event_name: Instrumentation name to stop on.
Link to this function

remove_xhr_breakpoint(url)

@spec remove_xhr_breakpoint(String.t()) :: {String.t(), map()}

Removes breakpoint from XMLHttpRequest.

Parameters:

  • (Required) url: Resource URL substring.
Link to this function

set_break_on_csp_violation(violation_types)

@spec set_break_on_csp_violation([csp_violation_type()]) :: {String.t(), map()}

Sets breakpoint on particular CSP violations.

Parameters:

  • (Required) violation_types: CSP Violations to stop upon.
Link to this function

set_dom_breakpoint(node_id, type)

@spec set_dom_breakpoint(
  CDPotion.Domain.DOM.node_id(),
  dom_breakpoint_type()
) :: {String.t(), map()}

Sets breakpoint on particular operation with DOM.

Parameters:

  • (Required) node_id: Identifier of the node to set breakpoint on.
  • (Required) type: Type of the operation to stop upon.
Link to this function

set_event_listener_breakpoint(event_name, target_name \\ nil)

@spec set_event_listener_breakpoint(String.t(), String.t()) :: {String.t(), map()}

Sets breakpoint on particular DOM event.

Parameters:

  • (Required) event_name: DOM Event name to stop on (any DOM event will do).
  • (Optional) target_name: EventTarget interface name to stop on. If equal to "*" or not provided, will stop on any EventTarget.
Link to this function

set_instrumentation_breakpoint(event_name)

@spec set_instrumentation_breakpoint(String.t()) :: {String.t(), map()}

Sets breakpoint on particular native event.

Parameters:

  • (Required) event_name: Instrumentation name to stop on.
Link to this function

set_xhr_breakpoint(url)

@spec set_xhr_breakpoint(String.t()) :: {String.t(), map()}

Sets breakpoint on XMLHttpRequest.

Parameters:

  • (Required) url: Resource URL substring. All XHRs having this substring in the URL will get stopped upon.