Lynx

Lynx

This page documents the Lynx CDP domain supported by Lynx DevTool.

Experimental reference

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
NameTypeRequiredDescription
nodeIdintegerYesDevTool node id to resolve in the current Lynx element tree.
Returns
NameTypeDescription
componentIdstring|integerComponent id string for component nodes. The value is the integer -1 when the node is missing or is not a component node.
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:

{
  "id": 1,
  "method": "Lynx.getComponentId",
  "params": {
    "nodeId": 42
  }
}

Response:

{
  "id": 1,
  "result": {
    "componentId": "21"
  }
}

Non-component fallback

Request:

{
  "id": 2,
  "method": "Lynx.getComponentId",
  "params": {
    "nodeId": 7
  }
}

Response:

{
  "id": 2,
  "result": {
    "componentId": -1
  }
}

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
NameTypeRequiredDescription
nodeIdintegerYesDevTool node id to resolve in the current Lynx element tree.
Returns
NameTypeDescription
datastringSerialized component data. Empty string when the node is missing, is not a component node, or the component data helper has no data.
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:

{
  "id": 1,
  "method": "Lynx.getData",
  "params": {
    "nodeId": 42
  }
}

Response:

{
  "id": 1,
  "result": {
    "data": ""
  }
}

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
NameTypeRequiredDescription
nodeIdintegerYesDevTool node id to resolve in the current Lynx element tree.
Returns
NameTypeDescription
propertiesstringSerialized component properties. Empty string when the node is missing, is not a component node, or the component properties helper has no data.
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:

{
  "id": 1,
  "method": "Lynx.getProperties",
  "params": {
    "nodeId": 42
  }
}

Response:

{
  "id": 1,
  "result": {
    "properties": ""
  }
}

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
NameTypeDescription
leftnumberLeft coordinate of the LynxView rectangle.
topnumberTop coordinate of the LynxView rectangle.
widthnumberWidth of the LynxView rectangle.
heightnumberHeight of the LynxView rectangle.
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:

{
  "id": 1,
  "method": "Lynx.getRectToWindow"
}

Response:

{
  "id": 1,
  "result": {
    "left": 0,
    "top": 0,
    "width": 390,
    "height": 844
  }
}

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:

{
  "id": 1,
  "method": "Lynx.getScreenshot"
}

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
NameTypeDescription
resultstringLynx version string returned directly as the CDP result value.
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:

{
  "id": 1,
  "method": "Lynx.getVersion"
}

Response:

{
  "id": 1,
  "result": "1.1.5"
}

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
NameTypeDescription
xintegerPlatform-provided x coordinate for the LynxView on screen, or -1 when unavailable.
yintegerPlatform-provided y coordinate for the LynxView on screen, or -1 when unavailable.
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:

{
  "id": 1,
  "method": "Lynx.getViewLocationOnScreen"
}

Response:

{
  "id": 1,
  "result": {
    "x": 12,
    "y": 48
  }
}

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
NameTypeRequiredDescription
vmTypestringYesVM target string passed to the platform facade.
eventstringYesEvent name passed to the VM.
datastringNoString payload passed with the event. Non-string values are treated as an empty string by the native handler.
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:

{
  "id": 1,
  "method": "Lynx.sendVMEvent",
  "params": {
    "vmType": "main",
    "event": "DevToolRefresh",
    "data": "{\"reason\":\"manual\"}"
  }
}

Response:

{
  "id": 1,
  "result": {}
}

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:

{
  "id": 1,
  "method": "Lynx.setTraceMode"
}

Response:

{
  "id": 1,
  "error": {
    "code": -32601,
    "message": "SetTraceMode is deprecated. Use global messages."
  }
}

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
NameTypeRequiredDescription
dataTypestring (template)YesData category. The native handler only processes the value template.
datastringYesTemplate fragment data to pass to the platform facade.
eofbooleanYesWhether this fragment is the final template fragment.
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:

{
  "id": 1,
  "method": "Lynx.transferData",
  "params": {
    "dataType": "template",
    "data": "<binary-or-encoded-template-fragment>",
    "eof": false
  }
}
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.