Lynx

Recording

本页面介绍 Lynx DevTool 支持的 Recording CDP domain。

实验性参考

此生成的参考文档仍在完善中。

  • CDP events 尚未包含。
  • 部分 Lynx 扩展已列出,但尚未提供详细文档。
  • 方法说明尚未根据实现自动校验,可能不完整或不准确。

在依赖本参考前,请根据实现及所链接的 upstream CDP reference 验证实际行为。

概览

  • 作用域:global-and-instance
  • CDP domain:Lynx 专有

Lynx 扩展

Recording.end

Stops TestBench recording and emits stream handles for generated recording files.

  • Origin: lynx-extension
  • Source: devtool/lynx_devtool/agent/domain_agent/inspector_testbench_recorder_agent.cc
参数

无参数。

返回字段

无返回字段。

事件
  • Recording.recordingComplete
备注
  • Recorder support must be enabled in the current runtime. If RecorderController::Enable() is false, the agent returns method not implemented.
  • Dispatches through LynxGlobalDevToolMediator and calls RecorderController::EndRecord() on the UI task runner.
  • Returns an empty result object after the end-record request is accepted.
  • Sends Recording.recordingComplete asynchronously after the recorder writes the output files.
  • Recording.recordingComplete.params.stream is an array of FileStream handles. Read each handle with IO.read and close it with IO.close.
  • Recording.recordingComplete.params.filenames contains the generated file paths. Recording.recordingComplete.params.sessionIDs contains matching session ids or -1 when the recorder has no mapped session id.
  • Recording.recordingComplete.params.recordFormat is json.
  • The TestBench recorder writes compressed and base64-encoded JSON content to each generated file.
示例

Stop recording

Request:

{
  "id": 2,
  "method": "Recording.end"
}

Response:

{
  "id": 2,
  "result": {}
}

Recording complete notification

Response:

{
  "method": "Recording.recordingComplete",
  "params": {
    "stream": [1],
    "filenames": ["/tmp/1001.json"],
    "sessionIDs": [1001],
    "recordFormat": "json"
  }
}

Recording.start

Starts TestBench recording for Lynx page interactions.

  • Origin: lynx-extension
  • Source: devtool/lynx_devtool/agent/domain_agent/inspector_testbench_recorder_agent.cc
参数

无参数。

返回字段

无返回字段。

备注
  • Recorder support must be enabled in the current runtime. If RecorderController::Enable() is false, the agent returns method not implemented.
  • Dispatches through LynxGlobalDevToolMediator and starts RecorderController::StartRecord() on the UI task runner.
  • Returns an empty result object on success.
  • Returns a CDP error with message Cannot find ui task runner when no UI task runner is available.
示例

Start recording

Request:

{
  "id": 1,
  "method": "Recording.start"
}

Response:

{
  "id": 1,
  "result": {}
}
除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。