protocol/dom_debugger

⚙️ This module was generated from the Chrome DevTools Protocol version 1.3

DOMDebugger Domain

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.

📖 View this domain on the DevTools Protocol API Docs

Types

DOM breakpoint type.

pub type DOMBreakpointType {
  DOMBreakpointTypeSubtreeModified
  DOMBreakpointTypeAttributeModified
  DOMBreakpointTypeNodeRemoved
}

Constructors

  • DOMBreakpointTypeSubtreeModified
  • DOMBreakpointTypeAttributeModified
  • DOMBreakpointTypeNodeRemoved

Object event listener.

pub type EventListener {
  EventListener(
    type_: String,
    use_capture: Bool,
    passive: Bool,
    once: Bool,
    script_id: runtime.ScriptId,
    line_number: Int,
    column_number: Int,
    handler: option.Option(runtime.RemoteObject),
    original_handler: option.Option(runtime.RemoteObject),
    backend_node_id: option.Option(dom.BackendNodeId),
  )
}

Constructors

  • EventListener(
      type_: String,
      use_capture: Bool,
      passive: Bool,
      once: Bool,
      script_id: runtime.ScriptId,
      line_number: Int,
      column_number: Int,
      handler: option.Option(runtime.RemoteObject),
      original_handler: option.Option(runtime.RemoteObject),
      backend_node_id: option.Option(dom.BackendNodeId),
    )

    Arguments

    • type_

      EventListener’s type.

    • use_capture

      EventListener’s useCapture.

    • passive

      EventListener’s passive flag.

    • once

      EventListener’s once flag.

    • script_id

      Script id of the handler code.

    • line_number

      Line number in the script (0-based).

    • column_number

      Column number in the script (0-based).

    • handler

      Event handler function value.

    • original_handler

      Event original handler function value.

    • backend_node_id

      Node the listener is added to (if any).

This type is not part of the protocol spec, it has been generated dynamically to represent the response to the command get_event_listeners

pub type GetEventListenersResponse {
  GetEventListenersResponse(listeners: List(EventListener))
}

Constructors

  • GetEventListenersResponse(listeners: List(EventListener))

    Arguments

    • listeners

      Array of relevant listeners.

Functions

pub fn get_event_listeners(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  object_id object_id: RemoteObjectId,
  depth depth: Option(Int),
  pierce pierce: Option(Bool),
) -> Result(GetEventListenersResponse, RequestError)

Returns event listeners of the given object.

Parameters:

  • object_id : Identifier of the object to return listeners for.
  • 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.
  • 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.

Returns:

  • listeners : Array of relevant listeners.
pub fn remove_dom_breakpoint(
  callback__: fn(String, Option(Json)) -> a,
  node_id node_id: NodeId,
  type_ type_: DOMBreakpointType,
) -> a

Removes DOM breakpoint that was set using setDOMBreakpoint.

Parameters:

  • node_id : Identifier of the node to remove breakpoint from.
  • type_ : Type of the breakpoint to remove.

Returns:

pub fn remove_event_listener_breakpoint(
  callback__: fn(String, Option(Json)) -> a,
  event_name event_name: String,
) -> a

Removes breakpoint on particular DOM event.

Parameters:

  • event_name : Event name.

Returns:

pub fn remove_xhr_breakpoint(
  callback__: fn(String, Option(Json)) -> a,
  url url: String,
) -> a

Removes breakpoint from XMLHttpRequest.

Parameters:

  • url : Resource URL substring.

Returns:

pub fn set_dom_breakpoint(
  callback__: fn(String, Option(Json)) -> a,
  node_id node_id: NodeId,
  type_ type_: DOMBreakpointType,
) -> a

Sets breakpoint on particular operation with DOM.

Parameters:

  • node_id : Identifier of the node to set breakpoint on.
  • type_ : Type of the operation to stop upon.

Returns:

pub fn set_event_listener_breakpoint(
  callback__: fn(String, Option(Json)) -> a,
  event_name event_name: String,
) -> a

Sets breakpoint on particular DOM event.

Parameters:

  • event_name : DOM Event name to stop on (any DOM event will do).

Returns:

pub fn set_xhr_breakpoint(
  callback__: fn(String, Option(Json)) -> a,
  url url: String,
) -> a

Sets breakpoint on XMLHttpRequest.

Parameters:

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

Returns:

Search Document