Skip to content

Harden live HTML attachment previews (and add auto-sizing) - #3400

Merged
baev merged 2 commits into
mainfrom
http-attachment-previews
Jun 19, 2026
Merged

Harden live HTML attachment previews (and add auto-sizing)#3400
baev merged 2 commits into
mainfrom
http-attachment-previews

Conversation

@baev

@baev baev commented Jun 19, 2026

Copy link
Copy Markdown
Member

Context

HTML attachments can now keep useful interactive previews while running in an isolated srcdoc iframe instead of a same-origin attachment frame. The preview uses sandbox="allow-scripts" without allow-same-origin, referrerpolicy="no-referrer", and an injected CSP with default-src 'none'; base, forms, object/embed, nested frames, workers, navigation, and connect-src are blocked, while HTTPS-only scripts, styles, images, media, and fonts remain available for interactive reports.

Previews are loaded only when opened and are disabled for unsafe cases: metadata over 10 MiB prevents fetching, fetched HTML over 10 MiB is rejected before rendering, and invalid HTML falls back to source plus download when the source is at most 2 MiB. Inline preview height now follows the attachment content through a sandbox-to-parent resize message with frame/source validation, per-preview tokens, and a visible height clamp from 320px to 1600px with a 480px initial height.

fixes #706

Checklist

@github-actions

Copy link
Copy Markdown

Allure Report Summary

Name Duration Stats New Flaky Retry Report
Allure 2 – Pull request #3400 10m 18s Passed tests 397   Skipped tests 1 4 0 0 View

@baev baev added the pr:improvement Change that improves some user experience but can't be considered as a new feature label Jun 19, 2026
@baev
baev merged commit 745b215 into main Jun 19, 2026
29 of 30 checks passed
@baev
baev deleted the http-attachment-previews branch June 19, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Change that improves some user experience but can't be considered as a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand html attachments to iframe content height

3 participants