UITree
This page documents the UITree 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
UITree.disable
Disables Lynx UI tree inspection methods on the current target.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_ui_tree_agent.cc
Parameters
No parameters.
Returns
No return fields.
Notes
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- Clears the UI tree enabled flag used by UITree.getLynxUITree, UITree.getUIInfoForNode, and UITree.setUIStyle.
- Returns an empty result object.
- The native implementation does not read request params.
- If the mediator has no UI task runner, the current handler does not send an explicit CDP response.
Examples
Disable UI tree inspection
Request:
Response:
UITree.enable
Enables Lynx UI tree inspection methods on the current target.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_ui_tree_agent.cc
Parameters
Returns
No return fields.
Notes
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- Sets the UI tree enabled flag used by UITree.getLynxUITree, UITree.getUIInfoForNode, and UITree.setUIStyle.
- Returns an empty result object.
- The default compression threshold before this method changes it is 10240 bytes.
- If the mediator has no UI task runner, the current handler does not send an explicit CDP response.
Examples
Enable UI tree inspection
Request:
Response:
UITree.getLynxUITree
Returns the platform Lynx UI tree for the current page.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_ui_tree_agent.cc
Parameters
No parameters.
Returns
Notes
- Requires UITree.enable first. If UI tree inspection is not enabled, the current handler returns without sending a CDP response.
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- The platform facade returns a JSON string, and the executor parses that string into result.root.
- Android and Darwin include name, id, tagName, nodeIndex, props, label, frame, and children. Harmony includes name, id, frame, and children.
- If compression is enabled and the serialized root exceeds the stored threshold, result.compress is true and result.root is a compressed base64 string.
- 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 Lynx UI tree
Request:
Response:
UITree.getUIInfoForNode
Returns detailed platform UI information for one Lynx UI node.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_ui_tree_agent.cc
Parameters
Returns
Notes
- Requires UITree.enable first. If UI tree inspection is not enabled, the current handler returns without sending a CDP response.
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- The platform facade returns a JSON string, and the executor parses that string directly into result.
- If the platform returns an empty string or the node id cannot be resolved, the current handler returns an empty result object.
- Android, Darwin, and Harmony expose different platform-owned details. Consumers should tolerate missing optional fields.
- 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 UI information for one node
Request:
Response:
UITree.setUIStyle
Applies an editable style value to a Lynx UI node through the platform helper.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_ui_tree_agent.cc
Parameters
Returns
Notes
- Requires UITree.enable first. If UI tree inspection is not enabled, the current handler returns without sending a CDP response.
- Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
- The handler forwards params.UINodeId, params.styleName, and params.styleContent to DevToolPlatformFacade::SetUIStyle.
- The response is an empty result object when the platform return value is not -1.
- When the platform return value is -1, the response still uses result.error rather than a top-level CDP error.
- Android, Darwin, and Harmony support frame, margin, border, visible, background-color, and border-color, but unsupported or invalid inputs do not produce identical platform return values.
- 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
Update a UI frame
Request:
Response:
Failed style update
Request:
Response: