Skip to content

fix(screenshot): derive the screenshot type from the path extension like the Node.js client - #2021

Merged
Yury Semikhatsky (yury-s) merged 3 commits into
microsoft:mainfrom
yury-s:fix-screenshot-type
Oct 26, 2026
Merged

Yury Semikhatsky (yury-s) merged 3 commits into
microsoft:mainfrom
yury-s:fix-screenshot-type

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

  • An unsupported extension of the path option silently produced a PNG; it now throws path: unsupported mime type "..." like the Node.js client.
  • The type is only derived from the path when no type option is given.
  • Tests in TestPageScreenshot.

https://claude.ai/code/session_018p7xPf3r5VjAM7V46nzFTM

… Node.js client

A screenshot path with an extension other than png, jpg, jpeg or webp was
silently written as a PNG; the Node.js client throws 'path: unsupported mime
type'. The path now also overrides the type option, as in the Node.js client.
The porting guide notes that headed tests run under xvfb-run.

Claude-Session: https://claude.ai/code/session_018p7xPf3r5VjAM7V46nzFTM
…on is given

Like the Node.js client, an explicit type option wins over the extension of
the path. SS-032 passes now, its @fixme is gone.

Claude-Session: https://claude.ai/code/session_018p7xPf3r5VjAM7V46nzFTM
@yury-s
Yury Semikhatsky (yury-s) merged commit 1e592bb into microsoft:main Oct 26, 2026
35 of 36 checks passed
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