fix(trace-viewer): play videos inline and download real attachment - #30
Merged
Conversation
joris-gallot
force-pushed
the
fix/trace-viewer-attachments
branch
from
August 11, 2026 12:31
7a6c94f to
8f48d7f
Compare
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.
Fixes the two symptoms from the last comment on #18: a video attachment stuck on
No preview, and a download that saved a ~1 kB.htmfile.Chromium never routes an
<a download>request through the service worker, so the sha1 url reached the static server and saved its SPA fallback (try_files ... /trace/index.html) instead of the attachment. Downloads now fetch in-page, where the service worker does answer, and save a blob typed from the attachment'scontentType. Measured on a real trace:video.webm, 8121 bytes, EBML magic, where the old link gave 482 bytes starting with<!DOCTYPE. It affected every attachment type, not just video. Videos also render inline with<video controls>.Attachment badges on the run page now open the viewer's attachments tab, via a new
?tab=param. Nothing extra is uploaded for that: Playwright already embeds screenshots and videos in the trace zip (resources/<sha1>,worker/testTracing.ts), so those bytes are stored today whenever tracing is on.Refs #18