简体   繁体   中英

Detect Webpage in Facebook Messenger In-app Browser

I'm using npm package like Bowser to detect the Browser that I'm using when I'm opening a link. but When I try to open the link in my messenger. It still says that I'm using Chrome, but I'm on Facebook In-app Browser.

Is there any package to detect if using Facebook In-app Browser

you can just create a helper function to do so:


const isFacebookInAppBrowser = () => /FB_IAB/.test(navigator.userAgent) ||
  /FBAN/.test(navigator.userAgent) ||
  /FBAV/.test(navigator.userAgent);

This works for facebook in app but I am not sure for messenger. I didn't even know that it had a browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM