如何在移动 Safari 中禁用电话号码检测 [英] How do you disable phone number detection in mobile safari

查看:39
本文介绍了如何在移动 Safari 中禁用电话号码检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 safari 中为我的网络应用禁用电话号码检测,但它仍然显示由数字组成的 7 个字符串作为电话号码.我使用了苹果提供的元标记,但没有任何乐趣.

I have tried to disable phone number detection in safari for my web app but it still shows 7 character strings comprised of numbers as phone numbers. I used the apple provided meta tag but no joy.

<meta name="format-detection" content="telephone=no">

还有其他人遇到这个问题并解决它吗?

Anyone else run into this problem and work around it?

谢谢.

更新:看起来它没有在 safari 中检测电话号码,而是当我将页面另存为图标并从主屏幕运行它时.

Update: It looks like it does not detect phone numbers in safari but rather when I save the page as an icon and run it from the home screen.

推荐答案

好的.经过一番折腾,我想我找到了一个奇怪的解决方法.使用 dataDetectorTypes 的问题在于它会禁用整个 uiwebveiw 的电话号码检测.

OK. After quite a bit of futzing I think I found a strange work around. The problem with using dataDetectorTypes is that it will disable phone number detection for the whole uiwebveiw.

在 span 和标签上尝试 datadetectors="off" 和 x-apple-data-detectors="false" 属性后,我终于偶然发现了一些似乎阻止电话号码检测的东西.

After trying datadetectors="off" and x-apple-data-detectors="false" attribute on span and a tags I finally stumbled on something that seems to prevent phone number detection.

如果我将文本包裹在带有 href="#" 的 a 标签中,苹果似乎不理会它.

If I wrap my text in an a tag with an href="#" apple seems to leave it alone.

这篇关于如何在移动 Safari 中禁用电话号码检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆