invokeCDPFromSDK
Sends a CDP Method to DevTool and asynchronously receives the result.
This can be used simultaneously with the DevTool desktop application without interfering with each other.
Syntax
iOS
LynxBaseInspectorOwner.h
Android
LynxBaseInspectorOwner.java
Parameters
msg/cdpMsg: The message to send, a JSON string formatted as a CDP Method.callback: A callback that conforms to theCDPResultCallbackdefinition, used to receive the result.
Request Data Format
A JSON-formatted string.
For example, the request data for DOM.getDocument is as follows:
Usage Example
Implementation Steps
- Implement
CDPResultCallback. - Get the
LynxBaseInspectorOwnerinstance. - Call the
invokeCDPFromSDKmethod to send the message.
Code Example
The following example code demonstrates the complete process of calling the DOM.getDocument CDP Method after the LynxView has successfully loaded.
iOS
ViewController.m
Android
MainActivity.java
Compatibility
LCD tables only load in the browser