Lynx
This page documents the Lynx CDP domain supported by Lynx DevTool.
This generated reference is still being completed.
- CDP events are not included yet.
- Some Lynx extensions are listed but do not yet have detailed documentation.
- Method descriptions are not automatically verified against the implementation and may be incomplete or inaccurate.
Verify behavior against the implementation and the linked upstream CDP reference before relying on it.
Overview
- Scope:
instance - CDP domain: Lynx-specific
Lynx Extensions
Lynx.getComponentId
Returns the Lynx component id associated with a DevTool node id.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
Returns
Notes
- Dispatches through LynxDevToolMediator to InspectorTasmExecutor on the TASM thread.
- The handler resolves params.nodeId and reads ComponentElement::component_id() only for component elements.
- The response uses mixed value types today. Component ids are strings, while the fallback value is the integer -1.
- If the mediator has no TASM task runner, the current handler does not send an explicit CDP response.
Examples
Resolve a component node id
Request:
Response:
Non-component fallback
Request:
Response:
Lynx.getData
Returns the serialized data string for a Lynx component node.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
Returns
Notes
- Dispatches through LynxDevToolMediator to InspectorTasmExecutor on the TASM thread.
- The handler only calls the component data helper when params.nodeId resolves to a component element.
- The current native component data helper returns an empty string.
- If the mediator has no TASM task runner, the current handler does not send an explicit CDP response.
Examples
Read component data
Request:
Response:
Lynx.getProperties
Returns the serialized properties string for a Lynx component node.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
Returns
Notes
- Dispatches through LynxDevToolMediator to InspectorTasmExecutor on the TASM thread.
- The handler only calls the component properties helper when params.nodeId resolves to a component element.
- The current native component properties helper returns an empty string.
- If the mediator has no TASM task runner, the current handler does not send an explicit CDP response.
Examples
Read component properties
Request:
Response:
Lynx.getRectToWindow
Returns the LynxView rectangle relative to the containing window.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
No parameters.
Returns
Notes
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- The result is the four-value vector returned by the platform facade as left, top, width, and height.
- Android reads the root UI rect from UITreeHelper. Darwin reads the root UI rect and multiplies it by the screen scale.
- The native implementation does not read request params.
- If the mediator has no UI task runner or the platform facade is unavailable, the current handler does not send an explicit CDP response.
Examples
Read the LynxView window rectangle
Request:
Response:
Lynx.getScreenshot
Requests the platform to send a Lynx screenshot or card preview.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
No parameters.
Returns
No return fields.
Notes
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- The handler calls DevToolPlatformFacade::GetLynxScreenShot().
- Android and Darwin delegate this to their sendCardPreview platform hook.
- The current native handler does not send a CDP response after invoking the platform hook.
- The native implementation does not read request params.
- If the mediator has no UI task runner or the platform facade is unavailable, the current handler does not send an explicit CDP response.
Examples
Request a Lynx screenshot
Request:
Lynx.getVersion
Returns the Lynx engine version string reported by the platform.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
No parameters.
Returns
Notes
- Dispatches through LynxDevToolMediator to InspectorDefaultExecutor on the DevTool thread.
- The response result is a string value, not an object wrapper.
- Android delegates to DevToolPlatformAndroidDelegate.getLynxVersion(). Darwin delegates to LynxDeviceInfoHelper.getLynxVersion().
- The native implementation does not read request params.
- If the mediator has no DevTool task runner or the platform facade is unavailable, the current handler does not send an explicit CDP response.
Examples
Read the Lynx version
Request:
Response:
Lynx.getViewLocationOnScreen
Returns the LynxView top-left location on the screen.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
No parameters.
Returns
Notes
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- The handler returns x and y from DevToolPlatformFacade::GetViewLocationOnScreen().
- Android reads the LynxView location on screen and divides the stored coordinates by display density. Darwin returns the root view point converted to screen coordinates.
- If the platform facade returns fewer than two coordinates, the response uses x = -1 and y = -1.
- The native implementation does not read request params.
- If the mediator has no UI task runner or the platform facade is unavailable, the current handler does not send an explicit CDP response.
Examples
Read the LynxView screen location
Request:
Response:
Lynx.sendVMEvent
Sends a DevTool-originated event to a Lynx VM target.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
Returns
No return fields.
Notes
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- The handler forwards the event only when params.vmType and params.event are strings.
- Darwin wraps the payload with origin Devtool and target set to params.vmType before calling the platform delegate.
- The handler returns an empty CDP result object after processing the request, including requests with missing or invalid params.
- If params are valid but the platform facade is unavailable, the current handler does not send an explicit CDP response.
Examples
Send a VM event
Request:
Response:
Lynx.setTraceMode
Deprecated trace-mode method that currently returns a method-not-found error.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
No parameters.
Returns
No return fields.
Notes
- Dispatches through LynxDevToolMediator to InspectorDefaultExecutor on the DevTool thread.
- The native handler no longer supports this method and does not read request params.
- The response is a CDP error with JSON-RPC code -32601 and message SetTraceMode is deprecated. Use global messages.
- If the mediator has no DevTool task runner, the current handler does not send an explicit CDP response.
Examples
Deprecated trace mode request
Request:
Response:
Lynx.transferData
Transfers a template data fragment to the platform reload helper.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_lynx_agent_ng.cc
Parameters
Returns
No return fields.
Notes
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- The handler forwards data only when params.dataType is template, params.data is a string, and params.eof is a boolean.
- Matching requests call DevToolPlatformFacade::OnReceiveTemplateFragment(data, eof).
- Missing params, unsupported dataType values, or invalid field types are ignored.
- The current native handler does not send a CDP response.
- If the mediator has no UI task runner or the platform facade is unavailable, the current handler does not send an explicit CDP response.
Examples
Transfer a template fragment
Request: