fix(trap-smtp): allow HTML email links to open in new tab#2
Merged
lambdalisue merged 1 commit intomainfrom Feb 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the trap-smtp web UI HTML email preview so links in rendered HTML emails can be clicked and open in a new tab.
Changes:
- Injects a
<base target="_blank">tag into the HTML email body before rendering in an iframe. - Relaxes the preview iframe sandbox policy to allow opening popups/tabs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Inject <base target="_blank"> into HTML previews and relax the iframe sandbox to allow-popups so that links inside rendered emails are clickable and open in a new browser tab.
50af3a8 to
bc2bba8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
<base target="_blank">into HTML email previews to make all links open in new tabsallow-popups allow-popups-to-escape-sandboxto permit link navigationWhy
The HTML email preview iframe had a fully sandboxed environment (
sandbox=""), which prevented any links in rendered emails from being clickable. This made it impossible to test or interact with links in received emails.By injecting a base target and relaxing the sandbox security policy to allow popups, links become functional while still maintaining security by opening them in a separate browsing context (new tab) rather than within the iframe.
Test Plan
<a href="https://example.com">Click here</a>)