You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
screencast_start silently changes format and path for uppercase/unsupported file extensions #2206
screencast_start validates the requested file extension with a case-sensitiveendsWith() against ['.webm', '.mp4'] and silently falls back to .mp4 when nothing matches, instead of erroring. Combined with ensureExtension() (which replaces the existing extension), the recording can be written in a different format and to a different path than requested, with no warning.
(Reported originally by @ch-bas while testing; filing upstream with a reproduction and a fix.)
Affected code
src/tools/screencast.ts — the supportedExtensions loop uses filePath.endsWith(supportedExtension) (case-sensitive) with a silent .mp4 default.
src/utils/files.ts — ensureExtension() strips the existing extension via path.extname and appends the enforced one.
Present in v1.2.0 and on current main (the two files are unchanged between them).
Steps to reproduce
Start the server with --experimentalScreencast=true (and --experimentalFfmpegPath <ffmpeg>).
screencast_start with filePath: "demo.WEBM".
screencast_stop.
Actual
Records MP4 to demo.mp4 — neither the requested format nor the requested path. The same happens for any unsupported extension, e.g. recording.avi silently becomes recording.mp4.
Reproduced with the exact endsWith loop + ensureExtension run through node:path:
requested
resolved path
format
demo.webm
demo.webm
webm
ok
demo.WEBM
demo.mp4
mp4
wrong
demo.Webm
demo.mp4
mp4
wrong
recording.avi
recording.mp4
mp4
wrong
clip.MP4
clip.mp4
mp4
silently renamed
Expected
.WEBM / .Webm etc. treated as WebM (case-insensitive match).
An explicitly requested but unsupported extension rejected with an explicit error listing the supported formats, rather than silently switching format and path.
Minor related issue
When screencast_start is called without a filePath, it creates a temp directory via mkdtemp(). If page.screencast() then throws (e.g. ffmpeg missing), that directory is never cleaned up, leaking an empty temp dir per failed attempt.
Fix
PR incoming that (1) matches the extension case-insensitively, (2) rejects unsupported explicit extensions with a clear error, and (3) removes the generated temp directory when recording fails to start. Includes regression tests using the existing screencast test harness.
Activity
fix: handle screencast file extensions case-insensitively and clean u…
chore: sync upstream chrome-devtools-mcp v1.3.0 (#20)
fix: handle screencast file extensions case-insensitively and clean u…
chore: sync upstream chrome-devtools-mcp v1.3.0 (#20)