检测短信:浏览器上的浏览器支持
我的移动页面和短信有问题:链接。该页面主要由基于 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您无法检测到它,但也许您可以尝试读取QRCode集成浏览器的用户代理? (应该是一个WebView,并且希望WebView没有适当的用户代理)。
这是禁用自动链接的代码:
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:
最简单的方法是使用 DeviceAtlas 或 WURFL。他们都有手机属性数据库。您可以使用服务器端检测 (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.