feat(screenshot): add WebP format support with quality parameter#220
Merged
OrKoN merged 3 commits intoChromeDevTools:mainfrom Oct 1, 2025
Merged
Conversation
9b0e51e to
13538ac
Compare
Add WebP format to screenshot tool, providing superior compression compared to JPEG. Also fixes bug where saveTemporaryFile always saved files with .png extension regardless of format.
eb09254 to
e71f820
Compare
OrKoN
approved these changes
Oct 1, 2025
OrKoN
pushed a commit
that referenced
this pull request
Oct 1, 2025
🤖 I have created a release *beep* *boop* --- ## [0.6.0](chrome-devtools-mcp-v0.5.1...chrome-devtools-mcp-v0.6.0) (2025-10-01) ### Features * **screenshot:** add WebP format support with quality parameter ([#220](#220)) ([03e02a2](03e02a2)) * **screenshot:** adds ability to output screenshot to a specific pat… ([#172](#172)) ([f030726](f030726)) * support --accept-insecure-certs CLI ([#231](#231)) ([efb106d](efb106d)) * support --proxy-server CLI ([#230](#230)) ([dfacc75](dfacc75)) * support initial viewport in the CLI ([#229](#229)) ([ef61a08](ef61a08)) * support timeouts in wait_for and navigations ([#228](#228)) ([36e64d5](36e64d5)) ### Bug Fixes * **network:** show only selected request ([#236](#236)) ([73f0aec](73f0aec)) * PageCollector subscribing multiple times ([#241](#241)) ([0412878](0412878)) * snapshot does not capture Iframe content ([#217](#217)) ([ce356f2](ce356f2)), closes [#186](#186) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds WebP format support to the screenshot tool, providing superior compression compared to JPEG while maintaining image quality.
Problem
Currently, the Chrome DevTools MCP only supports PNG and JPEG formats for screenshots. This leads to:
saveTemporaryFilealways saved files with.pngextension regardless of the specified formatSolution
Added WebP as a supported format in the screenshot tool schema and extended the quality parameter to work with WebP (0-100 range, same as JPEG). Also fixed the file extension bug in
saveTemporaryFile.Changes
webpto screenshot format enum alongsidepngandjpegsaveTemporaryFileto properly handle WebP MIME type and file extension.pngregardless of formatToolDefinition.tsfor WebP supportnpm run docsTesting
Puppeteer 24.22.3 (used by this project) has full WebP support including quality parameter. Expected compression improvements based on WebP benchmarks:
All existing tests pass (131/131).
Impact
This change is backward compatible - WebP is an optional format that doesn't affect existing PNG/JPEG usage. It particularly helps with:
Example Usage
Checklist
npm run docsFixes #[issue-number] (if applicable)