Webview converting numerics to phone numbers
Let's say I programmatically set the innerHTML of a div called test to 96840664702 and then write javascript…
alert(document.getElementById('test').innerHTML
In Mobile Safari on the iPhone, Firefox, etc., the alert will read "96840664702". If I point webview (using the iPhone emulator or loading a test app onto the iPhone) to the same page, the alert will read:
<a href ="tel:96840664702" x-apple-data=detectors="true">96840664702</a>
How can I globally disable the data-detectors? I tried a couple meta-tags…
<meta name=”format-detection” content=”telephone=no”>
<meta name="x-" http-equiv="x-rim-auto-match" forua="true" content="none">
… but they didn't work. I couldn't find a reference for a meta tag that specifically mentioned Apple's detectors.
Since it works on the iPhone when I use Safari (vs. as a Titanium app), I assume there's a webview property I don't know about, but there's nothing listed in the API documentation under Titanium.UI.Webview.
6 Answers
-
Turns out in web views do this to turn off auto detection, at least on the iPhone side: mywebview.autoDetect = [];
-
Have you found a solution to the problem? I tried the meta-tags as well but it keeps doing it as well. A work around is to change the html and make it an
<a href=javascript:void(0)>96840664702</a>
and to change the css so that a are rendered the same that way the user won't notice the difference. However, if you have found a solution share please. -
I'm also interested on an solution of this problem. Any new ideas?
-
I've just hit this as well.. raising with Pro Support….
-
I've masked what webkit considers as phone numbers with a bit of CSS (<style type="text/css">a:link {text-decoration: none; color:white;}</style>) in my WebView and I've disabled touch on it (touchEnabled:false)
-
Sorry double post