Skip to content

feat(api): update Screencast.start API#39756

Merged
yury-s merged 3 commits intomainfrom
feat-screencast-api
Mar 19, 2026
Merged

feat(api): update Screencast.start API#39756
yury-s merged 3 commits intomainfrom
feat-screencast-api

Conversation

@yury-s
Copy link
Member

@yury-s yury-s commented Mar 19, 2026

  • Rename onFrame callback argument from buffer: Buffer to frame: { data: Buffer }
  • Rename maxSize option to preferredSize with updated description noting the size may not match if screencast is already running (e.g. for tracing or video)
  • reuse existing screencast when already running instead of throwing
  • remove stop method
  • support multiple listeners

- Rename onFrame callback argument from `buffer: Buffer` to `frame: { data: Buffer }`
- Rename `maxSize` option to `preferredSize` with updated description noting the size may not match if screencast is already running (e.g. for tracing or video)

fix(utils): add dir name to 'No packages found' error in generate_third_party_notice

fix(api): reuse existing screencast when already running instead of throwing

remove stop method

multiple listeners
onClose(handler: (code: number | undefined, reason: string | undefined) => any): void;
}

export interface Screencast {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why override?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we don't have better means to specify callback types, see other examples.

* langs: js
- `onFrame` <[function]\([Buffer]\): [Promise<any>|any]>
- `onFrame` <[function]\([Object]\): [Promise<any>|any]>
- `data` <[Buffer]> JPEG-encoded frame data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect more fields here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we already had width/height but then hid them. There is a chance we add such metadata in the future.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Test results for "tests 1"

6 flaky ⚠️ [chromium-library] › library/trace-viewer.spec.ts:1223 › should display language-specific locators `@ubuntu-22.04-chromium-tip-of-tree`
⚠️ [chromium-library] › library/trace-viewer.spec.ts:1223 › should display language-specific locators `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/trace-viewer.spec.ts:1223 › should display language-specific locators `@chromium-ubuntu-22.04-node22`
⚠️ [webkit-library] › library/trace-viewer.spec.ts:1223 › should display language-specific locators `@webkit-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-test-output.spec.ts:118 › should collapse repeated console messages for test `@windows-latest-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:384 › should reveal errors in the sourcetab `@windows-latest-node20`

38815 passed, 845 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/autowait.spec.ts:19 › racy navigation destroys context @mcp-windows-latest

5506 passed, 343 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants