test-preview-emails-cross-browsers-ios-simulator-nodejs-javascript icon indicating copy to clipboard operation
test-preview-emails-cross-browsers-ios-simulator-nodejs-javascript copied to clipboard

[fix] Links in previews don't open on click

Open wiese opened this issue 1 year ago • 0 comments

Describe the bug

Node.js version: v16.18.1

OS version: Fedora release 38 (Thirty Eight)

Description: Links in previews don't open on click. Is this an intentional security feature?

Actual behavior

Click on links in the email preview do not open after update from 3.0.10 to 3.0.17 (I assume due to ce6d4439ab79784b68d3fee2823f3c135d8c04da – sandbox attribute).

Console error message, e.g. in chrome:

Blocked opening '<redacted>' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.

I can still work around this via "Open link in new tab" in the context menu (proving the link works in principle).

Expected behavior

Click on links in the email preview opens in new tab.

If no general safe solution can be found, maybe make the attribute value configurable by the (library) user.

Code to reproduce

file:///tmp/3aa0abe6-c509-4f8d-a359-a110c2facf8e.html opened in browser, rendering HTML preview of message incl.

…
<a href="http://localhost:3000/<redacted>" target="">Sign In</a>

Checklist

  • [x] I have searched through GitHub issues for similar issues.
  • [x] I have completely read through the README and documentation.
  • [ ] I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

wiese avatar Jun 22 '23 12:06 wiese