Skip to content

fix(api): migrate Screencast from events to onFrame callback#39714

Merged
pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman:screencast-onframe-callback
Mar 18, 2026
Merged

fix(api): migrate Screencast from events to onFrame callback#39714
pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman:screencast-onframe-callback

Conversation

@pavelfeldman
Copy link
Member

@pavelfeldman pavelfeldman commented Mar 17, 2026

No description provided.

@pavelfeldman pavelfeldman force-pushed the screencast-onframe-callback branch from 144777d to 59eae36 Compare March 18, 2026 21:58
@microsoft microsoft deleted a comment from github-actions bot Mar 18, 2026
@microsoft microsoft deleted a comment from github-actions bot Mar 18, 2026

Maximum screencast frame dimensions. The output frame may be smaller to preserve the page aspect ratio. Defaults to 800×800.

### option: Screencast.start.onFrame
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this an option, and not a first argument?

### option: Screencast.start.onFrame
* since: v1.59
* langs: js
- `onFrame` ?<[function]\([Buffer]\)>
Copy link
Contributor

Choose a reason for hiding this comment

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

To show that it can be async:

Suggested change
- `onFrame` ?<[function]\([Buffer]\)>
- `onFrame` <[function]\([Buffer]\): [Promise<any>|any]>

}

export interface Screencast {
start(options?: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since page.route() does not need an override, I hope this one doesn't need one either.

@pavelfeldman pavelfeldman force-pushed the screencast-onframe-callback branch from 59eae36 to 2bdc7ea Compare March 18, 2026 23:05
@github-actions
Copy link
Contributor

Test results for "MCP"

3810 passed, 240 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "tests 1"

5 flaky ⚠️ [chromium-library] › library/popup.spec.ts:261 › should not throw when click closes popup `@ubuntu-22.04-chromium-tip-of-tree`
⚠️ [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-node22`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [webkit-library] › library/trace-viewer.spec.ts:1223 › should display language-specific locators `@webkit-ubuntu-22.04-node20`

36968 passed, 835 skipped


Merge workflow run.


async start(options: { maxSize?: { width: number, height: number } } = {}) {
async start(onFrame: (buffer: Buffer) => any, options: { maxSize?: { width: number, height: number } } = {}): Promise<DisposableStub> {
this._onFrame = onFrame;
Copy link
Member

Choose a reason for hiding this comment

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

throw if non-null?

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.

3 participants