Lynx

CDPResultCallback

A callback for receiving the asynchronous result from invokeCDPFromSDK.

Syntax

iOS

LynxBaseInspectorOwner.h
typedef void (^CDPResultCallback)(NSString *result);

Android

CDPResultCallback.java
public interface CDPResultCallback {
  void onResult(String result);
}

Parameters

  • result: A JSON string containing the CDP Method result.

Return Data Format

A JSON-formatted string.

FieldTypeDescription
idnumberMessage ID, which is consistent with the value passed in invokeCDPFromSDK
resultobjectMethod return value, please refer to CDP

For example, the return data for DOM.getDocument is as follows:

{
  "id" : 1,
  "result" : {
    "root" : {
      "attributes" : [],
      "backendNodeId" : 11,
      "childNodeCount" : 1,
      "children" : [
         ...
      ],
      "localName" : "",
      "nodeId" : 11,
      "nodeName" : "#document",
      "nodeType" : 9,
      "nodeValue" : ""
   }
}

Usage Example

Please refer to invokeCDPFromSDK.

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.