feat(screenshot): add JPEG quality parameter support#184
Merged
OrKoN merged 1 commit intoChromeDevTools:mainfrom Sep 29, 2025
Merged
feat(screenshot): add JPEG quality parameter support#184OrKoN merged 1 commit intoChromeDevTools:mainfrom
OrKoN merged 1 commit intoChromeDevTools:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
baf0b58 to
5dc7b5a
Compare
OrKoN
approved these changes
Sep 29, 2025
5dc7b5a to
ba1e3ba
Compare
- Add optional quality parameter (0-100) to screenshot schema - Pass quality parameter to Puppeteer screenshot method - Add optimizeForSpeed flag for improved performance - Update documentation with new parameter details This allows users to control JPEG compression quality, significantly reducing file sizes for screenshots. For example, quality=50 can reduce file size by ~35% compared to PNG format. Fixes potential issues with large screenshot sizes exceeding API limits when using Chrome DevTools MCP with AI assistants.
ba1e3ba to
f7ef840
Compare
OrKoN
pushed a commit
that referenced
this pull request
Sep 29, 2025
🤖 I have created a release *beep* *boop* --- ## [0.5.0](chrome-devtools-mcp-v0.4.0...chrome-devtools-mcp-v0.5.0) (2025-09-29) ### Features * **screenshot:** add JPEG quality parameter support ([#184](#184)) ([139cfd1](139cfd1)) ### Bug Fixes * do not error if the dialog was already handled ([#208](#208)) ([d9f77f8](d9f77f8)) * reference to handle_dialog tool ([#209](#209)) ([205eef5](205eef5)) * support node20 ([#52](#52)) ([13613b4](13613b4)) * update tool reference in an error ([#205](#205)) ([7765bb3](7765bb3)) --- 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 support for the
qualityparameter when taking JPEG screenshots, allowing users to control compression levels and significantly reduce file sizes.Problem
Currently, the Chrome DevTools MCP doesn't expose the
qualityparameter that Puppeteer natively supports. This leads to:Solution
Added the
qualityparameter (0-100) to the screenshot tool schema and passed it through to Puppeteer's screenshot method.Changes
qualityparameter to screenshot schema with proper validation (0-100 range)screenshot()methodoptimizeForSpeedflag for improved encoding performancenpm run docsTesting
Tested locally with various quality settings:
Impact
This change is backward compatible - the quality parameter is optional and doesn't affect existing usage. It particularly helps with:
Example Usage
Checklist
npm run docsFixes #[issue-number] (if applicable)