Cancel

I have a very simple hyperlink in my MVC application.

<a href="mailto:&subject=somesubject" class="anchoroffset nounderline shareusingemail" title="Share using Email"><div class="sprite icon-email-gray "></div></a> 

Now when I click on this link in Google Chrome (v36.0.1985.125), I always notice the status is canceled on the "Network" tab. However, it opens my Outlook with a suitable subject. To fix this problem, I also disabled all Chrome extensions, but this did not affect the problem.

Network tab showing request is canceled

This is not a deal breaker, but I'm curious to know why this is happening, and can I prevent it? I also tested the same link in IE (v11), FF (v30.0) and Safari (v5.1.7), and I did not notice any problems there.

I already went through the Javascript location.href to mailto launches GET HTTP, which is canceled in Chrome , but that did not help me.

Any understanding of this error is greatly appreciated. Thanks.

+6
source share
1 answer

This is the trigger behavior registered by Chrome for mailto URLs as the default program.

A canceled message in the Network window is normal and only indicates that Chrome will not open a new browser window, but it will still launch your email software.

In Windows 10 (and possibly previous versions), you can install the program by default. First select “default program by protocol” from the “Start” menu, then find the following entry in the list:

URL: MailTo Protocol

and change it to your email software.

As a webmaster, this is still problematic because you cannot control this behavior on the computer of people viewing your web page. I recommend using the server side script contact form instead of the mailto link.

+3
source

Source: https://habr.com/ru/post/973112/


All Articles