Skip to content

fix(cli): correct WebP MIME type check in handleResponse ('webp' → 'image/webp')#1899

Merged
OrKoN merged 1 commit intoChromeDevTools:mainfrom
kuishou68:fix/issue-1898-webp-mime-type
Apr 20, 2026
Merged

fix(cli): correct WebP MIME type check in handleResponse ('webp' → 'image/webp')#1899
OrKoN merged 1 commit intoChromeDevTools:mainfrom
kuishou68:fix/issue-1898-webp-mime-type

Conversation

@kuishou68
Copy link
Copy Markdown
Contributor

Summary

Fixes a bug in src/daemon/client.ts where the MIME type case for WebP images was 'webp' instead of the correct 'image/webp'.

Problem

In handleResponse, the switch statement for determining file extension used the incorrect string 'webp' as the MIME type. Since browsers and servers send image/webp as the MIME type, the case never matched, and all WebP images were saved with a .png extension instead of .webp.

// Before (buggy)
case 'webp':
  extension = '.webp';
  break;

// After (fixed)
case 'image/webp':
  extension = '.webp';
  break;

Testing

WebP screenshots/images returned by the tool will now correctly receive the .webp extension.

Closes #1898

Signed-off-by: cocoon 54054995+kuishou68@users.noreply.github.com

Copy link
Copy Markdown
Collaborator

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

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

Thanks!

@OrKoN OrKoN changed the title fix: correct WebP MIME type check in handleResponse ('webp' → 'image/webp') fix(cli): correct WebP MIME type check in handleResponse ('webp' → 'image/webp') Apr 20, 2026
@OrKoN OrKoN enabled auto-merge April 20, 2026 07:05
…onse (Closes ChromeDevTools#1898)

Signed-off-by: cocoon <54054995+kuishou68@users.noreply.github.com>
@OrKoN OrKoN force-pushed the fix/issue-1898-webp-mime-type branch from 41d1ea7 to c53deaf Compare April 20, 2026 11:40
@OrKoN OrKoN added this pull request to the merge queue Apr 20, 2026
Merged via the queue into ChromeDevTools:main with commit e3a5f6b Apr 20, 2026
17 checks passed
OrKoN pushed a commit that referenced this pull request Apr 21, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.22.0](chrome-devtools-mcp-v0.21.0...chrome-devtools-mcp-v0.22.0)
(2026-04-21)


### 🎉 Features

* add update notification to both binaries
([#1783](#1783))
([e01e333](e01e333))
* auto handle dialogs during script evaluation
([#1839](#1839))
([da33cb5](da33cb5))
* ensure extensions for file outputs
([#1867](#1867))
([e7a0d50](e7a0d50))
* experimental click_at(x,y) tool
([#1788](#1788))
([c4f5471](c4f5471))
* support Chrome extensions debugging
([#1922](#1922))
([3ff21cf](3ff21cf))
* support DevTools header redactions as an option
([#1848](#1848))
([5c398c4](5c398c4))
* **webmcp:** Add experimental tool to execute WebMCP tool
([#1873](#1873))
([0aff266](0aff266))
* **webmcp:** Add experimental tool to list WebMCP tools page exposes
([#1845](#1845))
([f97b573](f97b573))


### 🛠️ Fixes

* avoid showing update notification for local builds
([#1889](#1889))
([3f0cf10](3f0cf10)),
closes
[#1886](#1886)
* **cli:** correct WebP MIME type check in handleResponse ('webp' →
'image/webp')
([#1899](#1899))
([e3a5f6b](e3a5f6b)),
closes
[#1898](#1898)
* ignore unmapped PerformanceIssue events
([#1852](#1852))
([ea57e86](ea57e86))
* **network:** trailing data in Network redirect chain
([#1880](#1880))
([2f458c1](2f458c1))
* remove double space in navigate error message
([#1847](#1847))
([429e0ca](429e0ca))


### 📄 Documentation

* clarify tools included into CLI
([#1925](#1925))
([76ab9fa](76ab9fa))
* document network response and request extensions
([#1887](#1887))
([796d6f2](796d6f2))
* fix skill and reference documentation issues
([#1249](#1249))
([9236834](9236834))
* Include Mistral Vibe setup in README
([#1801](#1801))
([582c9e0](582c9e0))
* Rename project and enhance README content
([#1856](#1856))
([c066488](c066488))
* update the README on installing as a VS code agent plugin
([#1796](#1796))
([1b5dcae](1b5dcae))


### 🏗️ Refactor

* move waitForEventsAfterAction to McpPage
([#1780](#1780))
([c7c8f50](c7c8f50))
* use puppeteer Extension API
([#1911](#1911))
([ec895f1](ec895f1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Bug: WebP image MIME type check uses 'webp' instead of 'image/webp' in handleResponse

2 participants