大网数据广告活动
Web 标准与前端开发

`browsingContext.stopScreencast` command

· 52CE 我爱测

The `browsingContext.stopScreencast` command of the `browsingContext` module stops the specified screencast recording and returns the path to the recording file.

The browsingContext.stopScreencast command of the browsingContext module stops the specified screencast recording and returns the path to the recording file.

Syntax

{
  "method": "browsingContext.stopScreencast",
  "params": {
    "screencast": "d746584f-4744-4cb5-aabd-f059ab65144d"
  }
}

Parameters

The params field contains:

Return value

The result object in the response contains the following fields:

  • error
    • : A string that describes the error when writing the recorded data to a file. The wording of the error message is browser-dependent. This field is included only when a write failure occurs.
  • path

Errors

  • invalid argument
    • : Thrown if a required parameter is missing or has an invalid type.
  • no such screencast
    • : Thrown if no recording with the specified screencast ID is found. Using the ID of a recording previously stopped with this command throws this same error.

Description

When the client sends browsingContext.stopScreencast for an active recording, the browser stops capturing and writes any remaining encoded data to the file identified by path before sending the command response.

If the browser fails to write data to the file while the recording is in progress, it stops recording automatically. When the client subsequently sends browsingContext.stopScreencast, the browser returns a success response containing both the file path and an error description in the result object.

The browser does not delete the recording file. The client is responsible for removing the file when it is no longer needed, provided it has the necessary filesystem access.

Examples

Stopping a recording

Assume you have a WebDriver BiDi connection and an active session.

Suppose you started a recording using the browsingContext.startScreencast command. The browser returned a recording ID in the screencast field. When you are ready to stop recording, send the following message using the returned recording ID:

{
  "id": 6,
  "method": "browsingContext.stopScreencast",
  "params": {
    "screencast": "d746584f-4744-4cb5-aabd-f059ab65144d"
  }
}

The browser responds with the recording's file path as follows:

{
  "id": 6,
  "type": "success",
  "result": {
    "path": "/home/example/Downloads/screencast-d746584f-4744-4cb5-aabd-f059ab65144d.webm"
  }
}

Specifications

Browser compatibility

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。