检测短信:浏览器上的浏览器支持

发布于 2024-12-24 02:44:31 字数 244 浏览 3 评论 0原文

我的移动页面和短信有问题:链接。该页面主要由基于 Android 和 iOS 的智能手机通过 QR 扫描应用程序访问。

特别是在 iPhone 上,有一些带有集成浏览器的 QR 应用程序(webkit 的实例?),它们不支持短信:链接(不好。并且不知道为什么)。默认浏览器确实支持短信:链接,没有任何问题。

如果不支持,我想禁用 sms: 链接。

如果有人知道如何检测它(通过 javascript 或 php),那就太好了!

I have a problem with a mobile page and sms: links. The page is mainly visited by android and iOS based smartphones via QR-scanning apps.

Especially on the iPhone there are a few QR-Apps with integrated Browsers (instances of webkit?), which don't support sms: Links (bad. and don't know why). Default Browsers do support sms: links without any problems.

I'd like to disable the sms: links, if there isn't support.

If anyone has an idea how to detect it (via javascript or php) that would be nice!

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

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

发布评论

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

评论(2

少跟Wǒ拽 2024-12-31 02:44:31

我认为您无法检测到它,但也许您可以尝试读取QRCode集成浏览器的用户代理? (应该是一个WebView,并且希望WebView没有适当的用户代理)。

这是禁用自动链接的代码:

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

I don't think you can detect it, but maybe you can try to read the User Agent of the QRCode integrated browser? (should be a WebView, and there is hope than WebView doesn't have a proper User Agent).

Here is the code to disable auto-linking anyway:

<meta name="format-detection" content="telephone=no">  
悲歌长辞 2024-12-31 02:44:31

最简单的方法是使用 DeviceAtlasWURFL。他们都有手机属性数据库。您可以使用服务器端检测 (PHP),或者它们具有与 JavaScript 一起使用的 API。

在 WURFL 中,属性“xhtml_send_sms_string”将告诉您是否可以使用 sms: 或 smsto: 或者是否不受支持。

在 DeviceAtlas 中,属性“uriSchemeSms”或“uriSchemeSmsTo”会告诉您同样的事情。

Easiest way is to use DeviceAtlas or WURFL. They both have databases of mobile phone properties. You can use server-side detection (PHP) or they have APIs for use with JavaScript.

In WURFL, the property "xhtml_send_sms_string" will tell you if you can use sms: or smsto: or if it isn't supported.

In DeviceAtlas, the property "uriSchemeSms" or "uriSchemeSmsTo" will tell you the same thing.

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