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

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

问题描述

我尝试为我的Web应用程序禁用Safari浏览器中的电话号码检测功能,但它仍然显示7个由数字组成的字符串作为电话号码.我使用了苹果提供的meta标签,但没有任何乐趣.

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?

谢谢.

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

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 =#"的标签中,苹果似乎就不理它了.

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

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

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