Safari mailto: "This site is blocked from automatically creating email."

When using Safari (iOS 10.2) and clicking on the mailto link, a confirmation message is displayed with the following message:

"This website is blocked from automatically generating email." Ignore / Allow

I would like to get rid of this on my own website and do not know what to do. You can play it using Safari, for example, in any BBC article, by clicking the mail icon.

Dialog screenshot on iPad

My web research led me to these links:

https://discussions.apple.com/thread/7763735

WillieFromColo Jan 11, 2017 8:25 AM in response to Russ G

Issues with Safari and β€œThis website is blocked from automatically creating email.”

My research on Google shows that this error message appeared around November with the Safari update, which probably happened at the same time as Apple upgraded to iOS 10.2. Today (01/11/17) this is the latest version of iOS for the iPad and, possibly, the iPhone too.

[...]

as well as

https://developer.apple.com/safari/technology-preview/release-notes/#r15

Issue 15 URL Processing

Navigating tel: and mailto: links now requires a user gesture; Navigation without a user gesture will display a confirmation request.

So it looks like a Safari β€œfeature”. Does anyone know how to prevent this hint?

+10
source share
5 answers

Various third-party JavaScript libraries will intercept clicks on a tags to prevent navigation for a short time when sending data to the server. Typically, they programmatically launch navigation through window.location.replace .

Changes in Safari give a warning when mail / telegrams start this way.

There was an interaction, but usually it stopped with preventDefault , and Safari doesn't care.

If you are using a library that causes this problem, contact the creator and see if they can update it to skip preventDefault via mailto / tel links.

+7
source

At the beginning, I did not mention that we called mailto from the JavaScript part of the page. Now we again tried to solve the problem by switching to an HTML tag based on mailto (with and on the subject), and now it somehow works without this set. Therefore, I assume that this problem is solved for me, but I am open to any tips explaining the reasons. Therefore, I do not mark this answer as a solution.

+2
source

It happens to be used because we used window.open(...) to open this link in a new window.

Replaced by window.location.href = ... only for Safari: facepalm :.

0
source

We ran into a similar problem - and determined that this problem was being triggered through Google Tag Manager.

In particular, we triggered an event (in Tag Manager) for all href elements containing the mailto: prefix. We changed the event that will be triggered by clicking on the nested <span> element inside the anchor tag.

This allowed both to track the event in the Tag Manager and to delete a user message that caused discontent. eg.

 <a href="mailto: person@example.com "><span>link text</span></a> 
0
source

This issue occurred while tracking email links using Google Tag Manager .

I found a solution without modifying the DOM.

We activated the trigger type "Click - Just Links" with the option " Wait for tags " with a " Max. Timeout " of 2000 milliseconds.

After disabling this option, the message no longer appeared. Another solution is to use "Click - All Elements" (this always works).

0
source

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


All Articles