Commit b7819d0
committed
fix(emailPreview): open in-body links in a new tab via injected <base>
Clicking the "Download your files" link (or the link-text link) inside
the preview iframe tried to navigate the iframe itself. The sandbox
deliberately omits `allow-top-navigation`, so the navigation was
blocked and the iframe blanked out — leaving the modal open with an
empty body.
Splice `<base target="_blank" rel="noopener">` into the rendered
email's `<head>` (or prepend it if the template ever stops having
one) before handing the HTML to `srcdoc`. Anchors then open in a new
top-level tab, which the existing `allow-popups` /
`allow-popups-to-escape-sandbox` flags already permit. No cryptify
change needed — the real email never needed `target="_blank"`, only
the preview surface does.1 parent d2cba06 commit b7819d0
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
86 | 104 | | |
87 | 105 | | |
88 | 106 | | |
| |||
185 | 203 | | |
186 | 204 | | |
187 | 205 | | |
188 | | - | |
| 206 | + | |
189 | 207 | | |
190 | 208 | | |
191 | 209 | | |
| |||
0 commit comments