glendam/protocol/dom_debugger

This module is generated from the Chrome DevTools Protocol schema.

Do not edit this file manually. Generator: dev/codegen/generate_bindings.gleam Regenerate with:

gleam run -m codegen/generate_bindings

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

    Represents the subtree-modified protocol value.

  • DOMBreakpointTypeAttributeModified

    Represents the attribute-modified protocol value.

  • DOMBreakpointTypeNodeRemoved

    Represents the node-removed protocol value.

Object event listener.

pub type EventListener {
  EventListener(
    type_: String,
    use_capture: protocol_support.BooleanSetting,
    passive: protocol_support.BooleanSetting,
    once: protocol_support.BooleanSetting,
    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

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))

    Represents the GetEventListenersResponse protocol value.

    Arguments

    listeners

    Array of relevant listeners.

Values

pub fn get_event_listeners(
  callback callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  object_id object_id: runtime.RemoteObjectId,
  depth depth: option.Option(Int),
  pierce pierce: option.Option(protocol_support.BooleanSetting),
) -> Result(GetEventListenersResponse, chrome.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 callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  node_id node_id: dom.NodeId,
  type_ type_: DOMBreakpointType,
) -> Result(dynamic.Dynamic, chrome.RequestError)

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 callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  event_name event_name: String,
) -> Result(dynamic.Dynamic, chrome.RequestError)

Removes breakpoint on particular DOM event.

Parameters:

  • event_name : Event name.

Returns:

pub fn remove_xhr_breakpoint(
  callback callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  url url: String,
) -> Result(dynamic.Dynamic, chrome.RequestError)

Removes breakpoint from XMLHttpRequest.

Parameters:

  • url : Resource URL substring.

Returns:

pub fn set_dom_breakpoint(
  callback callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  node_id node_id: dom.NodeId,
  type_ type_: DOMBreakpointType,
) -> Result(dynamic.Dynamic, chrome.RequestError)

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 callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  event_name event_name: String,
) -> Result(dynamic.Dynamic, chrome.RequestError)

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 callback__: fn(String, option.Option(json.Json)) -> Result(
    dynamic.Dynamic,
    chrome.RequestError,
  ),
  url url: String,
) -> Result(dynamic.Dynamic, chrome.RequestError)

Sets breakpoint on XMLHttpRequest.

Parameters:

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

Returns:

Search Document