CDPEventListener
A protocol (or interface) used to receive CDP Event messages sent by DevTool.
Syntax
iOS
LynxBaseInspectorOwner.h
Android
CDPEventListener.java
Parameters
event: A JSON string containing the CDP Event content.
Data Format
For example, the data for Page.screencastFrame is as follows:
Usage Example
Steps
- Implement
CDPEventListener. - Get the
LynxBaseInspectorOwnerinstance. - Call the
addCDPEventListenermethod to add the message listener.
Code Example
The following example adds a CDP Event listener named TestListener and sends a Page.startScreencast message via invokeCDPFromSDK to enable screen capture functionality.
As a result, the TestCDPEventListener will receive Page.screencastFrame message.
iOS
TestCDPEventListener.h
TestCDPEventListener.m
ViewController.m
Android
TestCDPEventListener.java
MainActivity.java
Compatibility
LCD tables only load in the browser