Template
本页面介绍 Lynx DevTool 支持的 Template CDP domain。
实验性参考
此生成的参考文档仍在完善中。
- CDP events 尚未包含。
- 部分 Lynx 扩展已列出,但尚未提供详细文档。
- 方法说明尚未根据实现自动校验,可能不完整或不准确。
在依赖本参考前,请根据实现及所链接的 upstream CDP reference 验证实际行为。
概览
- 作用域:
instance - CDP domain:Lynx 专有
Lynx 扩展
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
参数
返回字段
备注
- 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.
示例
Read a template byte range
Request:
Response:
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
参数
无参数。
返回字段
备注
- Dispatches through LynxDevToolMediator to InspectorTasmExecutor on the TASM thread.
- When TASM is unavailable, the result reports useDefault as false.
示例
Get template processor API info
Request:
Response:
Template.templateConfigInfo
Compatibility method for removed template config info support.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_template_agent.cc
参数
无参数。
返回字段
备注
- 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.
示例
Get removed template config info
Request:
Response:
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
参数
无参数。
返回字段
备注
- 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.
示例
Get current template data
Request:
Response: