Lynx

Template

This page documents the Template 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

Template.getTemplateJs

Returns a base64-encoded slice of saved template binary bytes.

  • Origin: lynx-extension
  • Source: devtool/lynx_devtool/agent/domain_agent/inspector_template_agent.cc
Parameters
NameTypeRequiredDescription
offsetintegerYesByte offset into the saved template binary. Constraints: minimum 0.
sizeintegerYesMaximum number of bytes to read. Platform implementations may clamp this value to the available template length. Constraints: minimum 0.
Returns
NameTypeDescription
datastringBase64-encoded template bytes for the requested range. Empty when no template bytes are available, offset is outside the saved template, or the platform delegate is unavailable.
Notes
  • Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
  • params.offset and params.size are required. If either field is missing, the method returns a CDP error with message Params must have offset and size properties.
  • The native executor reads offset and size as unsigned integers; callers should pass non-negative integers.
  • Android returns a base64 slice from the saved binary template data or the bytes captured after a URL template load. The slice length is clamped to the remaining template bytes.
  • The generic embedder implementation returns an empty data string.
Examples

Read a template byte range

Request:

{
  "id": 1,
  "method": "Template.getTemplateJs",
  "params": {
    "offset": 0,
    "size": 4096
  }
}

Response:

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

Template.templateApi

Reports template data processor API information for the current template.

  • Origin: lynx-extension
  • Source: devtool/lynx_devtool/agent/domain_agent/inspector_template_agent.cc
Parameters

No parameters.

Returns
NameTypeDescription
useDefaultbooleanWhether the current template has a default data processor closure.
processMapKeysarrayNames of registered data processor entries. This field is omitted when the processor map is empty.
Notes
  • Dispatches through LynxDevToolMediator to InspectorTasmExecutor on the TASM thread.
  • When TASM is unavailable, the result reports useDefault as false.
Examples

Get template processor API info

Request:

{
  "id": 1,
  "method": "Template.templateApi"
}

Response:

{
  "id": 1,
  "result": {
    "useDefault": true,
    "processMapKeys": ["main"]
  }
}

Template.templateConfigInfo

Compatibility method for removed template config info support.

  • Origin: lynx-extension
  • Source: devtool/lynx_devtool/agent/domain_agent/inspector_template_agent.cc
Parameters

No parameters.

Returns
NameTypeDescription
resultstringAlways an empty string.
Notes
  • This method does not call the mediator or platform facade.
  • The response result is an empty string, not an object, because config info support was removed.
Examples

Get removed template config info

Request:

{
  "id": 1,
  "method": "Template.templateConfigInfo"
}

Response:

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

Template.templateData

Returns the current initial template data exposed by the platform facade.

  • Origin: lynx-extension
  • Source: devtool/lynx_devtool/agent/domain_agent/inspector_template_agent.cc
Parameters

No parameters.

Returns
NameTypeDescription
contentstringSerialized template data produced from the platform Lepus value. This field is present only when the platform facade returns a non-null template data value.
Notes
  • Dispatches through LynxDevToolMediator to InspectorUIExecutor on the UI thread.
  • Android reads the saved initial TemplateData pointer from the platform reload helper; Darwin delegates to the platform implementation.
  • If the platform facade has no template data value, the result object is returned without content.
Examples

Get current template data

Request:

{
  "id": 1,
  "method": "Template.templateData"
}

Response:

{
  "id": 1,
  "result": {
    "content": "{\"title\":\"hello\"}"
  }
}
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.