本文介绍了检测Facebook移动浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以某种方式可以通过PHP或JS检测Facebook的移动应用程序浏览器吗?
我的应用程序在浏览器中都有问题(在原生浏览器中没有!)我想显示警告通知。
Is it somehow possible to detect Facebook's mobiles apps' browser via PHP or JS?My apps all have problems inside their browser (in native browser not!) and I want to show a warning notice.
或者,是否有可能在外部浏览器中直接打开网站?
Alternatively, is there a possibility to directly open the website in a external browser?
推荐答案
这在JavaScript中适用于我:
This works fine for me in JavaScript:
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/FBAV/i)) {
//iOS Facebook App Browser detected
}
有关用户代理:
Afaik无法强制网站在任何外部浏览器中打开,只有用户可以这样做。
Afaik it´s not possible to force the website to open in any external browser, only the user can do that.
这篇关于检测Facebook移动浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!