protocol/runtime

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

Runtime Domain

Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.

📖 View this domain on the DevTools Protocol API Docs

Types

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

pub type AwaitPromiseResponse {
  AwaitPromiseResponse(
    result: RemoteObject,
    exception_details: option.Option(ExceptionDetails),
  )
}

Constructors

  • AwaitPromiseResponse(
      result: RemoteObject,
      exception_details: option.Option(ExceptionDetails),
    )

    Arguments

    • result

      Promise result. Will contain rejected value if promise was rejected.

    • exception_details

      Exception details if stack strace is available.

Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified.

pub type CallArgument {
  CallArgument(
    value: option.Option(dynamic.Dynamic),
    unserializable_value: option.Option(UnserializableValue),
    object_id: option.Option(RemoteObjectId),
  )
}

Constructors

  • CallArgument(
      value: option.Option(dynamic.Dynamic),
      unserializable_value: option.Option(UnserializableValue),
      object_id: option.Option(RemoteObjectId),
    )

    Arguments

    • value

      Primitive value or serializable javascript object.

    • unserializable_value

      Primitive value which can not be JSON-stringified.

    • object_id

      Remote object handle.

Stack entry for runtime errors and assertions.

pub type CallFrame {
  CallFrame(
    function_name: String,
    script_id: ScriptId,
    url: String,
    line_number: Int,
    column_number: Int,
  )
}

Constructors

  • CallFrame(
      function_name: String,
      script_id: ScriptId,
      url: String,
      line_number: Int,
      column_number: Int,
    )

    Arguments

    • function_name

      JavaScript function name.

    • script_id

      JavaScript script id.

    • url

      JavaScript script name or url.

    • line_number

      JavaScript script line number (0-based).

    • column_number

      JavaScript script column number (0-based).

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

pub type CallFunctionOnResponse {
  CallFunctionOnResponse(
    result: RemoteObject,
    exception_details: option.Option(ExceptionDetails),
  )
}

Constructors

  • CallFunctionOnResponse(
      result: RemoteObject,
      exception_details: option.Option(ExceptionDetails),
    )

    Arguments

    • result

      Call result.

    • exception_details

      Exception details.

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

pub type CompileScriptResponse {
  CompileScriptResponse(
    script_id: option.Option(ScriptId),
    exception_details: option.Option(ExceptionDetails),
  )
}

Constructors

  • CompileScriptResponse(
      script_id: option.Option(ScriptId),
      exception_details: option.Option(ExceptionDetails),
    )

    Arguments

    • script_id

      Id of the script.

    • exception_details

      Exception details.

Represents deep serialized value.

pub type DeepSerializedValue {
  DeepSerializedValue(
    type_: DeepSerializedValueType,
    value: option.Option(dynamic.Dynamic),
    object_id: option.Option(String),
    weak_local_object_reference: option.Option(Int),
  )
}

Constructors

  • DeepSerializedValue(
      type_: DeepSerializedValueType,
      value: option.Option(dynamic.Dynamic),
      object_id: option.Option(String),
      weak_local_object_reference: option.Option(Int),
    )

    Arguments

    • weak_local_object_reference

      Set if value reference met more then once during serialization. In such case, value is provided only to one of the serialized values. Unique per value in the scope of one CDP call.

This type is not part of the protocol spec, it has been generated dynamically to represent the possible values of the enum property type of DeepSerializedValue

pub type DeepSerializedValueType {
  DeepSerializedValueTypeUndefined
  DeepSerializedValueTypeNull
  DeepSerializedValueTypeString
  DeepSerializedValueTypeNumber
  DeepSerializedValueTypeBoolean
  DeepSerializedValueTypeBigint
  DeepSerializedValueTypeRegexp
  DeepSerializedValueTypeDate
  DeepSerializedValueTypeSymbol
  DeepSerializedValueTypeArray
  DeepSerializedValueTypeObject
  DeepSerializedValueTypeFunction
  DeepSerializedValueTypeMap
  DeepSerializedValueTypeSet
  DeepSerializedValueTypeWeakmap
  DeepSerializedValueTypeWeakset
  DeepSerializedValueTypeError
  DeepSerializedValueTypeProxy
  DeepSerializedValueTypePromise
  DeepSerializedValueTypeTypedarray
  DeepSerializedValueTypeArraybuffer
  DeepSerializedValueTypeNode
  DeepSerializedValueTypeWindow
  DeepSerializedValueTypeGenerator
}

Constructors

  • DeepSerializedValueTypeUndefined
  • DeepSerializedValueTypeNull
  • DeepSerializedValueTypeString
  • DeepSerializedValueTypeNumber
  • DeepSerializedValueTypeBoolean
  • DeepSerializedValueTypeBigint
  • DeepSerializedValueTypeRegexp
  • DeepSerializedValueTypeDate
  • DeepSerializedValueTypeSymbol
  • DeepSerializedValueTypeArray
  • DeepSerializedValueTypeObject
  • DeepSerializedValueTypeFunction
  • DeepSerializedValueTypeMap
  • DeepSerializedValueTypeSet
  • DeepSerializedValueTypeWeakmap
  • DeepSerializedValueTypeWeakset
  • DeepSerializedValueTypeError
  • DeepSerializedValueTypeProxy
  • DeepSerializedValueTypePromise
  • DeepSerializedValueTypeTypedarray
  • DeepSerializedValueTypeArraybuffer
  • DeepSerializedValueTypeNode
  • DeepSerializedValueTypeWindow
  • DeepSerializedValueTypeGenerator

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

pub type EvaluateResponse {
  EvaluateResponse(
    result: RemoteObject,
    exception_details: option.Option(ExceptionDetails),
  )
}

Constructors

  • EvaluateResponse(
      result: RemoteObject,
      exception_details: option.Option(ExceptionDetails),
    )

    Arguments

    • result

      Evaluation result.

    • exception_details

      Exception details.

Detailed information about exception (or error) that was thrown during script compilation or execution.

pub type ExceptionDetails {
  ExceptionDetails(
    exception_id: Int,
    text: String,
    line_number: Int,
    column_number: Int,
    script_id: option.Option(ScriptId),
    url: option.Option(String),
    stack_trace: option.Option(StackTrace),
    exception: option.Option(RemoteObject),
    execution_context_id: option.Option(ExecutionContextId),
  )
}

Constructors

  • ExceptionDetails(
      exception_id: Int,
      text: String,
      line_number: Int,
      column_number: Int,
      script_id: option.Option(ScriptId),
      url: option.Option(String),
      stack_trace: option.Option(StackTrace),
      exception: option.Option(RemoteObject),
      execution_context_id: option.Option(ExecutionContextId),
    )

    Arguments

    • exception_id

      Exception id.

    • text

      Exception text, which should be used together with exception object when available.

    • line_number

      Line number of the exception location (0-based).

    • column_number

      Column number of the exception location (0-based).

    • script_id

      Script ID of the exception location.

    • url

      URL of the exception location, to be used when the script was not reported.

    • stack_trace

      JavaScript stack trace if available.

    • exception

      Exception object if available.

    • execution_context_id

      Identifier of the context where exception happened.

Description of an isolated world.

pub type ExecutionContextDescription {
  ExecutionContextDescription(
    id: ExecutionContextId,
    origin: String,
    name: String,
    aux_data: option.Option(dict.Dict(String, String)),
  )
}

Constructors

  • ExecutionContextDescription(
      id: ExecutionContextId,
      origin: String,
      name: String,
      aux_data: option.Option(dict.Dict(String, String)),
    )

    Arguments

    • id

      Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.

    • origin

      Execution context origin.

    • name

      Human readable name describing given context.

    • aux_data

      Embedder-specific auxiliary data likely matching {isDefault: boolean, type: ‘default’|‘isolated’|‘worker’, frameId: string}

Id of an execution context.

pub type ExecutionContextId {
  ExecutionContextId(Int)
}

Constructors

  • ExecutionContextId(Int)

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

pub type GetPropertiesResponse {
  GetPropertiesResponse(
    result: List(PropertyDescriptor),
    internal_properties: option.Option(
      List(InternalPropertyDescriptor),
    ),
    exception_details: option.Option(ExceptionDetails),
  )
}

Constructors

  • GetPropertiesResponse(
      result: List(PropertyDescriptor),
      internal_properties: option.Option(
        List(InternalPropertyDescriptor),
      ),
      exception_details: option.Option(ExceptionDetails),
    )

    Arguments

    • result

      Object properties.

    • internal_properties

      Internal object properties (only of the element itself).

    • exception_details

      Exception details.

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

pub type GlobalLexicalScopeNamesResponse {
  GlobalLexicalScopeNamesResponse(names: List(String))
}

Constructors

  • GlobalLexicalScopeNamesResponse(names: List(String))

Object internal property descriptor. This property isn’t normally visible in JavaScript code.

pub type InternalPropertyDescriptor {
  InternalPropertyDescriptor(
    name: String,
    value: option.Option(RemoteObject),
  )
}

Constructors

  • InternalPropertyDescriptor(
      name: String,
      value: option.Option(RemoteObject),
    )

    Arguments

    • name

      Conventional property name.

    • value

      The value associated with the property.

Object property descriptor.

pub type PropertyDescriptor {
  PropertyDescriptor(
    name: String,
    value: option.Option(RemoteObject),
    writable: option.Option(Bool),
    get: option.Option(RemoteObject),
    set: option.Option(RemoteObject),
    configurable: Bool,
    enumerable: Bool,
    was_thrown: option.Option(Bool),
    is_own: option.Option(Bool),
    symbol: option.Option(RemoteObject),
  )
}

Constructors

  • PropertyDescriptor(
      name: String,
      value: option.Option(RemoteObject),
      writable: option.Option(Bool),
      get: option.Option(RemoteObject),
      set: option.Option(RemoteObject),
      configurable: Bool,
      enumerable: Bool,
      was_thrown: option.Option(Bool),
      is_own: option.Option(Bool),
      symbol: option.Option(RemoteObject),
    )

    Arguments

    • name

      Property name or symbol description.

    • value

      The value associated with the property.

    • writable

      True if the value associated with the property may be changed (data descriptors only).

    • get

      A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only).

    • set

      A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only).

    • configurable

      True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.

    • enumerable

      True if this property shows up during enumeration of the properties on the corresponding object.

    • was_thrown

      True if the result was thrown during the evaluation.

    • is_own

      True if the property is owned for the object.

    • symbol

      Property symbol object, if the property is of the symbol type.

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

pub type QueryObjectsResponse {
  QueryObjectsResponse(objects: RemoteObject)
}

Constructors

  • QueryObjectsResponse(objects: RemoteObject)

    Arguments

    • objects

      Array with objects.

Mirror object referencing original JavaScript object.

pub type RemoteObject {
  RemoteObject(
    type_: RemoteObjectType,
    subtype: option.Option(RemoteObjectSubtype),
    class_name: option.Option(String),
    value: option.Option(dynamic.Dynamic),
    unserializable_value: option.Option(UnserializableValue),
    description: option.Option(String),
    object_id: option.Option(RemoteObjectId),
  )
}

Constructors

  • RemoteObject(
      type_: RemoteObjectType,
      subtype: option.Option(RemoteObjectSubtype),
      class_name: option.Option(String),
      value: option.Option(dynamic.Dynamic),
      unserializable_value: option.Option(UnserializableValue),
      description: option.Option(String),
      object_id: option.Option(RemoteObjectId),
    )

    Arguments

    • type_

      Object type.

    • subtype

      Object subtype hint. Specified for object type values only. NOTE: If you change anything here, make sure to also update subtype in ObjectPreview and PropertyPreview below.

    • class_name

      Object class (constructor) name. Specified for object type values only.

    • value

      Remote object value in case of primitive values or JSON values (if it was requested).

    • unserializable_value

      Primitive value which can not be JSON-stringified does not have value, but gets this property.

    • description

      String representation of the object.

    • object_id

      Unique object identifier (for non-primitive values).

Unique object identifier.

pub type RemoteObjectId {
  RemoteObjectId(String)
}

Constructors

  • RemoteObjectId(String)

This type is not part of the protocol spec, it has been generated dynamically to represent the possible values of the enum property subtype of RemoteObject

pub type RemoteObjectSubtype {
  RemoteObjectSubtypeArray
  RemoteObjectSubtypeNull
  RemoteObjectSubtypeNode
  RemoteObjectSubtypeRegexp
  RemoteObjectSubtypeDate
  RemoteObjectSubtypeMap
  RemoteObjectSubtypeSet
  RemoteObjectSubtypeWeakmap
  RemoteObjectSubtypeWeakset
  RemoteObjectSubtypeIterator
  RemoteObjectSubtypeGenerator
  RemoteObjectSubtypeError
  RemoteObjectSubtypeProxy
  RemoteObjectSubtypePromise
  RemoteObjectSubtypeTypedarray
  RemoteObjectSubtypeArraybuffer
  RemoteObjectSubtypeDataview
  RemoteObjectSubtypeWebassemblymemory
  RemoteObjectSubtypeWasmvalue
}

Constructors

  • RemoteObjectSubtypeArray
  • RemoteObjectSubtypeNull
  • RemoteObjectSubtypeNode
  • RemoteObjectSubtypeRegexp
  • RemoteObjectSubtypeDate
  • RemoteObjectSubtypeMap
  • RemoteObjectSubtypeSet
  • RemoteObjectSubtypeWeakmap
  • RemoteObjectSubtypeWeakset
  • RemoteObjectSubtypeIterator
  • RemoteObjectSubtypeGenerator
  • RemoteObjectSubtypeError
  • RemoteObjectSubtypeProxy
  • RemoteObjectSubtypePromise
  • RemoteObjectSubtypeTypedarray
  • RemoteObjectSubtypeArraybuffer
  • RemoteObjectSubtypeDataview
  • RemoteObjectSubtypeWebassemblymemory
  • RemoteObjectSubtypeWasmvalue

This type is not part of the protocol spec, it has been generated dynamically to represent the possible values of the enum property type of RemoteObject

pub type RemoteObjectType {
  RemoteObjectTypeObject
  RemoteObjectTypeFunction
  RemoteObjectTypeUndefined
  RemoteObjectTypeString
  RemoteObjectTypeNumber
  RemoteObjectTypeBoolean
  RemoteObjectTypeSymbol
  RemoteObjectTypeBigint
}

Constructors

  • RemoteObjectTypeObject
  • RemoteObjectTypeFunction
  • RemoteObjectTypeUndefined
  • RemoteObjectTypeString
  • RemoteObjectTypeNumber
  • RemoteObjectTypeBoolean
  • RemoteObjectTypeSymbol
  • RemoteObjectTypeBigint

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

pub type RunScriptResponse {
  RunScriptResponse(
    result: RemoteObject,
    exception_details: option.Option(ExceptionDetails),
  )
}

Constructors

  • RunScriptResponse(
      result: RemoteObject,
      exception_details: option.Option(ExceptionDetails),
    )

    Arguments

    • result

      Run result.

    • exception_details

      Exception details.

Unique script identifier.

pub type ScriptId {
  ScriptId(String)
}

Constructors

  • ScriptId(String)

Represents options for serialization. Overrides generatePreview and returnByValue.

pub type SerializationOptions {
  SerializationOptions(
    serialization: SerializationOptionsSerialization,
    max_depth: option.Option(Int),
    additional_parameters: option.Option(
      dict.Dict(String, String),
    ),
  )
}

Constructors

  • SerializationOptions(
      serialization: SerializationOptionsSerialization,
      max_depth: option.Option(Int),
      additional_parameters: option.Option(dict.Dict(String, String)),
    )

    Arguments

    • max_depth

      Deep serialization depth. Default is full depth. Respected only in deep serialization mode.

    • additional_parameters

      Embedder-specific parameters. For example if connected to V8 in Chrome these control DOM serialization via maxNodeDepth: integer and includeShadowTree: "none" | "open" | "all". Values can be only of type string or integer.

This type is not part of the protocol spec, it has been generated dynamically to represent the possible values of the enum property serialization of SerializationOptions

pub type SerializationOptionsSerialization {
  SerializationOptionsSerializationDeep
  SerializationOptionsSerializationJson
  SerializationOptionsSerializationIdOnly
}

Constructors

  • SerializationOptionsSerializationDeep
  • SerializationOptionsSerializationJson
  • SerializationOptionsSerializationIdOnly

Call frames for assertions or error messages.

pub type StackTrace {
  StackTrace(
    description: option.Option(String),
    call_frames: List(CallFrame),
    parent: option.Option(StackTrace),
  )
}

Constructors

  • StackTrace(
      description: option.Option(String),
      call_frames: List(CallFrame),
      parent: option.Option(StackTrace),
    )

    Arguments

    • description

      String label of this stack trace. For async traces this may be a name of the function that initiated the async call.

    • call_frames

      JavaScript function name.

    • parent

      Asynchronous JavaScript stack trace that preceded this stack, if available.

Number of milliseconds.

pub type TimeDelta {
  TimeDelta(Float)
}

Constructors

  • TimeDelta(Float)

Number of milliseconds since epoch.

pub type Timestamp {
  Timestamp(Float)
}

Constructors

  • Timestamp(Float)

Primitive value which cannot be JSON-stringified. Includes values -0, NaN, Infinity, -Infinity, and bigint literals.

pub type UnserializableValue {
  UnserializableValue(String)
}

Constructors

  • UnserializableValue(String)

Functions

pub fn add_binding(
  callback__: fn(String, Option(Json)) -> a,
  name name: String,
  execution_context_name execution_context_name: Option(String),
) -> a

If executionContextId is empty, adds binding with the given name on the global objects of all inspected contexts, including those created later, bindings survive reloads. Binding function takes exactly one argument, this argument should be string, in case of any other input, function throws an exception. Each binding function call produces Runtime.bindingCalled notification.

Parameters:

  • name
  • execution_context_name : If specified, the binding is exposed to the executionContext with matching name, even for contexts created after the binding is added. See also ExecutionContext.name and worldName parameter to Page.addScriptToEvaluateOnNewDocument. This parameter is mutually exclusive with executionContextId.

Returns:

pub fn await_promise(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  promise_object_id promise_object_id: RemoteObjectId,
  return_by_value return_by_value: Option(Bool),
  generate_preview generate_preview: Option(Bool),
) -> Result(AwaitPromiseResponse, RequestError)

Add handler to promise with given promise object id.

Parameters:

  • promise_object_id : Identifier of the promise.
  • return_by_value : Whether the result is expected to be a JSON object that should be sent by value.
  • generate_preview : Whether preview should be generated for the result.

Returns:

  • result : Promise result. Will contain rejected value if promise was rejected.
  • exception_details : Exception details if stack strace is available.
pub fn call_function_on(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  function_declaration function_declaration: String,
  object_id object_id: Option(RemoteObjectId),
  arguments arguments: Option(List(CallArgument)),
  silent silent: Option(Bool),
  return_by_value return_by_value: Option(Bool),
  user_gesture user_gesture: Option(Bool),
  await_promise await_promise: Option(Bool),
  execution_context_id execution_context_id: Option(
    ExecutionContextId,
  ),
  object_group object_group: Option(String),
) -> Result(CallFunctionOnResponse, RequestError)

Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

Parameters:

  • function_declaration : Declaration of the function to call.
  • object_id : Identifier of the object to call function on. Either objectId or executionContextId should be specified.
  • arguments : Call arguments. All call arguments must belong to the same JavaScript world as the target object.
  • silent : In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
  • return_by_value : Whether the result is expected to be a JSON object which should be sent by value. Can be overriden by serializationOptions.
  • user_gesture : Whether execution should be treated as initiated by user in the UI.
  • await_promise : Whether execution should await for resulting value and return once awaited promise is resolved.
  • execution_context_id : Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.
  • object_group : Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.

Returns:

  • result : Call result.
  • exception_details : Exception details.
pub fn compile_script(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  expression expression: String,
  source_url source_url: String,
  persist_script persist_script: Bool,
  execution_context_id execution_context_id: Option(
    ExecutionContextId,
  ),
) -> Result(CompileScriptResponse, RequestError)

Compiles expression.

Parameters:

  • expression : Expression to compile.
  • source_url : Source url to be set for the script.
  • persist_script : Specifies whether the compiled script should be persisted.
  • execution_context_id : Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.

Returns:

  • script_id : Id of the script.
  • exception_details : Exception details.
pub fn disable(callback__: fn(String, Option(a)) -> b) -> b

Disables reporting of execution contexts creation.

pub fn discard_console_entries(
  callback__: fn(String, Option(a)) -> b,
) -> b

Discards collected exceptions and console API calls.

pub fn enable(callback__: fn(String, Option(a)) -> b) -> b

Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

pub fn evaluate(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  expression expression: String,
  object_group object_group: Option(String),
  include_command_line_api include_command_line_api: Option(Bool),
  silent silent: Option(Bool),
  context_id context_id: Option(ExecutionContextId),
  return_by_value return_by_value: Option(Bool),
  user_gesture user_gesture: Option(Bool),
  await_promise await_promise: Option(Bool),
) -> Result(EvaluateResponse, RequestError)

Evaluates expression on global object.

Parameters:

  • expression : Expression to evaluate.
  • object_group : Symbolic group name that can be used to release multiple objects.
  • include_command_line_api : Determines whether Command Line API should be available during the evaluation.
  • silent : In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
  • context_id : Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. This is mutually exclusive with uniqueContextId, which offers an alternative way to identify the execution context that is more reliable in a multi-process environment.
  • return_by_value : Whether the result is expected to be a JSON object that should be sent by value.
  • user_gesture : Whether execution should be treated as initiated by user in the UI.
  • await_promise : Whether execution should await for resulting value and return once awaited promise is resolved.

Returns:

  • result : Evaluation result.
  • exception_details : Exception details.
pub fn get_properties(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  object_id object_id: RemoteObjectId,
  own_properties own_properties: Option(Bool),
) -> Result(GetPropertiesResponse, RequestError)

Returns properties of a given object. Object group of the result is inherited from the target object.

Parameters:

  • object_id : Identifier of the object to return properties for.
  • own_properties : If true, returns properties belonging only to the element itself, not to its prototype chain.

Returns:

  • result : Object properties.
  • internal_properties : Internal object properties (only of the element itself).
  • exception_details : Exception details.
pub fn global_lexical_scope_names(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  execution_context_id execution_context_id: Option(
    ExecutionContextId,
  ),
) -> Result(GlobalLexicalScopeNamesResponse, RequestError)

Returns all let, const and class variables from global scope.

Parameters:

  • execution_context_id : Specifies in which execution context to lookup global scope variables.

Returns:

  • names
pub fn query_objects(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  prototype_object_id prototype_object_id: RemoteObjectId,
  object_group object_group: Option(String),
) -> Result(QueryObjectsResponse, RequestError)

This generated protocol command has no description

Parameters:

  • prototype_object_id : Identifier of the prototype to return objects for.
  • object_group : Symbolic group name that can be used to release the results.

Returns:

  • objects : Array with objects.
pub fn release_object(
  callback__: fn(String, Option(Json)) -> a,
  object_id object_id: RemoteObjectId,
) -> a

Releases remote object with given id.

Parameters:

  • object_id : Identifier of the object to release.

Returns:

pub fn release_object_group(
  callback__: fn(String, Option(Json)) -> a,
  object_group object_group: String,
) -> a

Releases all remote objects that belong to a given group.

Parameters:

  • object_group : Symbolic object group name.

Returns:

pub fn remove_binding(
  callback__: fn(String, Option(Json)) -> a,
  name name: String,
) -> a

This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications.

Parameters:

  • name

Returns:

pub fn run_if_waiting_for_debugger(
  callback__: fn(String, Option(a)) -> b,
) -> b

Tells inspected instance to run if it was waiting for debugger to attach.

pub fn run_script(
  callback__: fn(String, Option(Json)) ->
    Result(Dynamic, RequestError),
  script_id script_id: ScriptId,
  execution_context_id execution_context_id: Option(
    ExecutionContextId,
  ),
  object_group object_group: Option(String),
  silent silent: Option(Bool),
  include_command_line_api include_command_line_api: Option(Bool),
  return_by_value return_by_value: Option(Bool),
  generate_preview generate_preview: Option(Bool),
  await_promise await_promise: Option(Bool),
) -> Result(RunScriptResponse, RequestError)

Runs script with given id in a given context.

Parameters:

  • script_id : Id of the script to run.
  • execution_context_id : Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
  • object_group : Symbolic group name that can be used to release multiple objects.
  • silent : In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
  • include_command_line_api : Determines whether Command Line API should be available during the evaluation.
  • return_by_value : Whether the result is expected to be a JSON object which should be sent by value.
  • generate_preview : Whether preview should be generated for the result.
  • await_promise : Whether execution should await for resulting value and return once awaited promise is resolved.

Returns:

  • result : Run result.
  • exception_details : Exception details.
pub fn set_async_call_stack_depth(
  callback__: fn(String, Option(Json)) -> a,
  max_depth max_depth: Int,
) -> a

Enables or disables async call stacks tracking.

Parameters:

  • max_depth : Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default).

Returns:

Search Document