Mailto link in chrome opens new tab
Asked Answered
F

2

9

Hi I have a mailto link on my page, which works fine in other broswers. In chrome, it opens a new tab with the mailto link as the URL. Is there any way to suppress the behavior from the web developer's end?

From what I've read, it seems like this is a function of chrome's settings, but I wanted to know if anyone had a work around.

EDIT: site is located here nickstestserver.com/phi-rhos-near-you It is a drupal 7 site. Here is the relevant html.

<td class="table-logo" >
<a href="mailto:[email protected]" target="_blank"><img src="/sites/default/files/email_logo.png"></img></a>          
</td>
Fletafletch answered 22/12, 2015 at 10:30 Comment(1)
it is better say something after viewing your code. Post what you have done so farStalemate
F
10

So, removing the target =_blank from the URL stopped the behavior.

Fletafletch answered 22/12, 2015 at 11:24 Comment(2)
The problem with this is that if the user has a web-based email client (such as gmail) set as their default email client, the user will be navigated away from your website to gmail.com. If the user then changes their mind about writing the email and closes the window, they're off your website.Mordancy
We are having this issue as well. Adding _blank makes it so that the users with browser based email clients don't navigate away from our site. However users with desktop clients now are left on a new blank tab.Trexler
S
3

This happens in because you have not set your default mail in that browser and so the browser is treating your link like a page Copy and paste into a new browser window for directions on how to set the default mail.

Below are the URLs for 4 most common web browsers

Internet Explorer https://support.microsoft.com/en-us/help/555566

Firefox https://support.mozilla.org/en-US/kb/change-program-used-open-email-links

Google Chrome https://support.google.com/chrome/forum/AAAAP1KN0B0oxPLcXhbt9w?hl=en

Safari https://support.apple.com/en-us/HT201607

Snare answered 11/4, 2018 at 21:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.