Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
629 views
in Technique[技术] by (71.8m points)

html - Disable telephone number detection on iPad desktop web links?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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" />


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...