禁用 webOS 电话链接

发布于 2024-08-15 03:37:08 字数 989 浏览 2 评论 0原文

我曾经遇到过一个问题,iPhone 版 Safari 会将电话链接添加到我的 HTML 中。这会破坏我的代码,因为它取决于

的文本值。

之前:

<div id="DontTouchMyHTML">8211812</div>

之后:

<div id="DontTouchMyHTML"><a href="tel:8211812">8211812</a></div>

所以我为 IE iPhone Safari 添加了神奇的元修复。 Safari 开发中心:电话链接

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

这解决了问题。

但随后出现了带有 Safari 的 Palm Pre webOS。现在我遇到了一些问题,上述修复不起作用。我假设基于 Safari/AppleWebKit 它将遵循相同的规则。我想不是。

我寻找了 Palm Pre webOS 电话链接的开发人员参考,但找不到解决方案。

违规用户代理:

Mozilla/5.0 (webOS/1.3.1; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0

I once had a problem where Safari for iPhone would add phone links to my HTML. This would break my code because it depended on the text value of <div id="DontTouchMyHTML">.

Before:

<div id="DontTouchMyHTML">8211812</div>

After:

<div id="DontTouchMyHTML"><a href="tel:8211812">8211812</a></div>

So i added the magical meta fix for IE iPhone Safari.
Safari Dev Center: Phone LInks

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

And that solved the problem.

But then came along the Palm Pre webOS with Safari. Now I'm having the some problem and the above fix does not work. I assumed that being based off Safari/AppleWebKit it would follow the same rules. I guess not.

I've looked for a developer reference for Palm Pre webOS phone links but cannot find a solution.

Offending User Agent:

Mozilla/5.0 (webOS/1.3.1; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

权谋诡计 2024-08-22 03:37:08

您可以确定用户代理是否是将这些数字转换为链接的浏览器,然后使用 HTML 实体将 8211812 转换为

& & 

但老实说,我认为这是一个可怕的解决方案。

如果没有开发人员 API 来阻止您的情况,这是我能想到的唯一方法。

You could determine if the useragent is a browser that will convert these numbers to links, and then use HTML Entities to convert 8211812 to

& & 

However I honestly think it's a horrible solution.

Providing there is no developer API to prevent your situation, that's the only way I can think of.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文