Skip to content

fix: sidebar email link#2642

Merged
cotes2020 merged 3 commits intocotes2020:masterfrom
lynkos:email-fix
Apr 9, 2026
Merged

fix: sidebar email link#2642
cotes2020 merged 3 commits intocotes2020:masterfrom
lynkos:email-fix

Conversation

@lynkos
Copy link
Copy Markdown
Contributor

@lynkos lynkos commented Jan 13, 2026

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Description

Clicking the Mail icon in Firefox redirects the user to a new blank page that displays the mailto address. See the Additional context section for screenshots. Note: This bug doesn't appear in Chrome or Safari.

This change doesn't require any additional dependencies since it's a one-line change in _includes/sidebar.html.

It also doesn't break the behavior in Chrome or Safari (i.e. no new bug(s) introduced) since this bug only affects Firefox, to my knowledge.

Please refer to my fork and click the Mail icon for a working example of my fix (i.e. prevent site from redirecting to a blank page after clicking the Mail icon).

Additional context

Clicking the Mail icon in Firefox
Screenshot of bug

Firefox user is redirected to this page after clicking the icon
Screenshot of bug

@lynkos lynkos changed the title fix: Sidebar email link fix: sidebar email link Jan 13, 2026
Copy link
Copy Markdown
Owner

@cotes2020 cotes2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firefox handles javascript: URLs such that if the expression does not return undefined, it treats the return value as page content and displays it, which causes navigation to a blank page showing the mailto address. Chrome and Safari do not handle it this way, so they are not affected.

The fix is to wrap the expression in void(), ensuring it returns undefined:

javascript:void(location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@'))

Add @cotes2020's requested change

Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
Signed-off-by: lynkos <kiwi2mii@gmail.com>
@cotes2020 cotes2020 merged commit 2685b91 into cotes2020:master Apr 9, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants