微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html – Safari mailto:“此网站已被阻止自动撰写电子邮件.”

使用Safari(iOS 10.2)并单击mailto链接时,将显示确认提示,并显示以下消息:

“This website has been blocked from automatically composing an email.”
Ignore / Allow

我想在我自己的网站上摆脱这个,不知道该怎么做.它可以通过Safari重现,例如在点击邮件图标的任何BBC文章中.

Screenshot of dialogue on iPad

我的网络研究带我到这些链接

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

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

Issues with Safari and “This website has been blocked from
automatically composing an email.”

My research on Google suggests that this Error-type Message started
happening in about November with an update to Safari,which likely
occurred concurrently with Apple’s update to iOS 10.2. As of today
(1/11/17) that is the latest version of iOS for iPads and perhaps
iPhones,too.

[…]

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

Release 15
URL Handling

Navigations to tel: and mailto: links Now require a user gesture;
navigations without a user gesture will show a confirmation prompt

所以它似乎是Safari的“功能”.有谁知道如何防止这个提示

解决方法

各种第三方JavaScript库将拦截属性上的点击,以防止在向服务器发送数据时短暂导航.通常,它们以编程方式通过window.location.replace触发导航.

当以这种方式触发mailto / tel链接时,Safari中的更改会弹出警告.

一个交互,但通常使用preventDefault停止,Safari不关心.

如果您正在使用导致此问题的库,请与创建者联系,看看他们是否可以更新它以跳过在mailto / tel链接上的preventDefault.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。