加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

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

发布时间:2020-12-14 16:43:57 所属栏目:资源 来源:网络整理
导读:使用Safari(iOS 10.2)并单击mailto链接时,将显示确认提示,并显示以下消息: “This website has been blocked from automatically composing an email.” Ignore / Allow 我想在我自己的网站上摆脱这个,不知道该怎么做.它可以通过Safari重现,例如在点击邮件
使用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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读