Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect Facebook in-app browser?

Have you had any experience in Facebook in-app browser detection? What's the core difference in user agent?

I don't want to know if it is a only mobile/ios/chrome. I need to know whether user agent is specific from Facebook in-app browser

like image 593
milosz0010 Avatar asked Jul 22 '15 16:07

milosz0010


People also ask

How do I disable Facebook app in the browser?

Hit your profile picture in the top left corner, then tap Settings and privacy > Display and sound. In the “Web browser” section, you will see the option “Use in-app browser.” Please disable it. That's it.

What browser does the Facebook app use?

If you're thinking, “Wow, I had no idea Facebook made its own browser,” you're not crazy. Facebook doesn't make a standalone browser: It just runs an in-app browser for users to access the web via Facebook's app.

Is Facebook a browsing app?

While Facebook's use as a mobile browser was still far outweighed by Safari in most cases, due to the dominance of Apple's iOS in the U.S., the social networking app has achieved mobile browser market share of around 10 percent in many states, Mixpanel found.


2 Answers

You can check for FBAN / FBAV in the user agent.

Check this link: Facebook user agent

like image 171
Jan Swart Avatar answered Sep 17 '22 11:09

Jan Swart


To complete worker11811's answer on using the user agent, here's a code snippet to make it work:

function isFacebookApp() {     var ua = navigator.userAgent || navigator.vendor || window.opera;     return (ua.indexOf("FBAN") > -1) || (ua.indexOf("FBAV") > -1); } 
like image 43
Sascha Klatt Avatar answered Sep 17 '22 11:09

Sascha Klatt