Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome mailto Status canceled

I have a very simple hyperlink in my MVC App.

<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 Status cancelled under Network tab. However it does open my Outlook with the right subject. To troubleshoot this problem I disabled all the Chrome extensions too but it had no impact on the issue.

Network tab showing request is cancelled

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

I have already gone thru Javascript location.href to mailto triggers a GET HTTP that gets canceled in Chrome question but it didn't help me.

Any insight into this error is much appreciated. Thanks.

like image 854
ndd Avatar asked Jul 30 '14 14:07

ndd


1 Answers

This behavior is trigerred by Chrome registering itself for mailto URLs as a default program.

The cancelled message in the Network window is normal and only indicates that Chrome won't open a new browser window, but it will still launch your email software.

Under Windows 10 (and probably previous versions) you can set the default program. First select 'default program by protocol' via the Start Menu, then locate the following entry into the list :

URL:MailTo Protocol

and change it to your email software.

As a Webmaster it's still problematic, because you won't be able to control this behavior on the computer of the people visting your web page. I'll recommend to use a contact form with a server side script instead of a mailto link.

like image 50
Cédric Avatar answered Sep 16 '22 20:09

Cédric