For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/lynx-devtool-native-api/cdp-result-callback.md.
Lynx
  • English
  • 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.