禁用iPad桌面Web链接上的电话号码检测? [英] Disable telephone number detection on iPad desktop web links?

查看:102
本文介绍了禁用iPad桌面Web链接上的电话号码检测?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Web应用程序,该应用程序将作为全屏应用程序从iPad上的桌面图标启动。 手机链接上的Apple文档建议使用此功能元标记:

 < meta name =format-detectioncontent =telephone = no> 

但是,这似乎不起作用。是否有任何其他的HTML / CSS / JavaScript机制来控制这种行为?



随机注入锚标签会导致很多CSS错误。 b
$ b

解决方法



我发现的一个方法是注入特殊的空格字符,想到将所有的数据转化为输出并不能让我满意。这些角色带来了他们自己的问题。这样做会因AJAX和JavaScript转换而进一步复杂。



复制

步骤来重现:


  1. 打开iPad Safari上的页面

  2. 使用主屏幕书签功能
  3. 启动主屏幕图标



  4. 示例页面:

     <!DOCTYPE html> 
    < html>
    < head>
    < meta name =apple-mobile-web-app-capablecontent =yes>
    < meta name =format-detectioncontent =telephone = no>
    < title>电话检测< / title>
    < / head>
    < body>
    预期:
    < a href =tel:1555555> 1555555< / a>
    < br />
    bad:1555555
    < br />
    bad:&#x31;&#x35;&#x35;&#x35;&#x35;&#x35;&#x35;
    < br />
    不方便:1&#xFEFF; 555555
    < / body>
    < / html>

    笔记

    这个问题似乎是相关的,但它缺乏细节,我不确定iPhone上的行为是否相同。这是一个Web应用程序,没有本地组件。 iPad版本3.2.2。

    解决方案

    meta标签适用于asp.net。我的猜测是,它不适用于OP,因为HTML格式不正确。非IE浏览器,Mozilla浏览器存在格式错误的XML / Html问题。 Change



    < meta name =format-detectioncontent =telephone = no> p>



    < meta name =format-detectioncontent =telephone = no/>


    I'm developing a web application that will be launched from a desktop icon on an iPad as a full-screen application. The Apple documentation on phone links recommends using this meta tag:

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

    However, this does not appear to work. Is there any other HTML/CSS/JavaScript mechanism to control this behaviour?

    The random injection of anchor tags is causing me a lot of CSS bugs.

    Workaround

    One hack I've found to work is to inject special space characters, but the thought of transforming all my data on output does not fill me with joy. Such characters bring their own issues to the table. Doing this will be further complicated by AJAX and JavaScript transformations.

    Reproducing

    Steps to reproduce:

    1. Open the page on iPad Safari
    2. Use the Add to Home Screen bookmark function
    3. Launch the Home Screen icon

    Sample page:

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name = "format-detection" content = "telephone=no">
    <title>Telephone detect</title>
    </head>
    <body>
    expected:
    <a href="tel:1555555">1555555</a>
    <br />
    bad: 1555555
    <br />
    bad: &#x31;&#x35;&#x35;&#x35;&#x35;&#x35;&#x35;
    <br />
    inconvenient: 1&#xFEFF;555555
    </body>
    </html>
    

    Notes

    This question seems to be related, but it lacks detail and I'm not sure if the behaviour is identical on the iPhone. This is a web application and has no native component. iPad version 3.2.2.

    解决方案

    The meta tag works for me in asp.net. My guess is that it did not work for the OP because the HTML is not well formed. Non-IE, Mozilla browsers have issues with malformed XML/Html. Change

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

    to

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

    这篇关于禁用iPad桌面Web链接上的电话号码检测?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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