Detect Facebook Mobile Browser

时间:2015-07-08 15:48:33

标签: javascript php 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?

1 个答案:

答案 0 :(得分:1)

这在JavaScript中适用于我:

if (navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/FBAV/i)) {
    //iOS Facebook App Browser detected
}

有关用户代理的更多信息:Is this a Facebook for iOS WebView User Agent?

Afaik无法强制网站在任何外部浏览器中打开,只有用户可以这样做。