What is the user-agent string added when we open facebook app from an android mobile. I want to detect facebook app from android OS using user-agent string, is that achievable. Are there unique user-agent strings for different devices for facebook app
Obligatory disclaimer: user-agent strings are usually the wrong answer. They change, they're inconsistent, it's a brittle way to detect anything.
That said, testing on a Samsung Galaxy S5, with a freshly installed FB app as of today, I got:
Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/35.0.0.48.273;]
The parts with 'FB' specifially seem to be Facebook information. I'd guess that:
FB_IAB: Facebook In-App Browser (followed by a version)
FBAV: Facebook App Version (followed by a version)
The FBAV is shared with the iOS user-agent string as found here: http://mpulp.mobi/2012/01/funky-user-agent-on-facebook-iphone-app/
Mozilla/5.0 (Linux; Android 7.1.1; Build/LMY47O.H18; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/127.0.0.22.69;]
Mozilla/5.0 (Linux; Android 7.0; SM-G930F Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/127.0.0.22.69;]
Mozilla/5.0 (Linux; Android 7.0; MHA-L29 Build/HUAWEIMHA-L29; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/127.0.0.22.69;]
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Mobile/14F89 [FBAN/FBIOS;FBAV/96.0.0.45.70;FBBV/60548545;FBDV/iPhone7,2;FBMD/iPhone;FBSN/iOS;FBSV/10.3.2;FBSS/2;FBCR/E-Plus;FBID/phone;FBLC/de_DE;FBOP/5;FBRV/0]
Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.3.12 (KHTML, like Gecko) Mobile/14C92 [FBAN/FBIOS;FBAV/90.0.0.51.69;FBBV/56254015;FBDV/iPhone6,2;FBMD/iPhone;FBSN/iOS;FBSV/10.2;FBSS/2;FBCR/1&1;FBID/phone;FBLC/de_DE;FBOP/5;FBRV/0]
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/603.2.4 (KHTML, like Gecko) Mobile/14F89 [FBAN/FBIOS;FBAV/96.0.0.45.70;FBBV/60548545;FBDV/iPhone8,1;FBMD/iPhone;FBSN/iOS;FBSV/10.3.2;FBSS/2;FBCR/o2-de;FBID/phone;FBLC/de_DE;FBOP/5;FBRV/0]
Mozilla/5.0 (Linux; Android 4.4.4; G7-L01 Build/HuaweiG7-L01) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36 [FB_IAB/MESSENGER;FBAV/121.0.0.15.70;]
Reference
Related
We have a native app for Windows 64 bit. It embeds WebView (the original, not WebView2).
We set compatibility mode to IE11 with the BROWSER_FEATURE_EMULATION registry setting to 11000.
On some PCs, it identifies as IE11 with this user agent:
Mozilla/5.0 (Windows NT 6.2; Win64; x64; Trident/7.0; rv:11.0) like Gecko
On others, it identies as Edge with this agent:
Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.9200
These are all Windows 10 PCs, either 20H2 or 21H2.
How does this happen?
This is important because some things do not work in the "IE11" whereas they do work in the "Edge" mode. (Google maps)
From what I read, WebView on Windows 10 should always be "Edge IE11 mode".
Anyone know the name of user agent used by Microsoft Teams to parsing website ?
A customer put a link of my website on his microsoft teams but link is not rendering correctly because is not redirect to my prerender.
On 13 January 2022, the User-Agent strings of the browser used to render Teams Tab content were as follows (running in a small sample of various contexts):
Microsoft Teams (work or school) desktop app my x64 Windows 11 machine:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Teams/1.4.00.32771 Chrome/85.0.4183.121 Electron/10.4.7 Safari/537.36
Teams Android App:
Mozilla/5.0 (Linux; Android 11; M2102J20SG Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/97.0.4692.70 Mobile Safari/537.36 TeamsMobile-Android
Teams Web App running in Chrome 97 on Windows:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
I got these by creating a simple tab app that loaded the content URL https://www.httpbin.org/headers, which is a public service that just echoes the request headers in the response, then navigating to that Tab in Teams in the various contexts above.
Long story short: As is often the case with user-agent sniffing, it doesn't seem sensible here to depend on the user agent string in your application in any way, because it varies quite a lot depending on the Teams context from which the request is made. Even if you were to try to match "Teams" or "TeamsMobile" for the "app" cases, it doesn't seem documented anywhere and Microsoft could well change it in future. So, my suggestion is to forget about the Microsoft Teams user agent.
I also had this question because I wanted to block link unfurling from MS Teams for an app I was developing.
I used the following line from in a Flask app
request.user_agent.string
To get this user agent
Mozilla/5.0 (Windows NT 6.1; WOW64) SkypeUriPreview Preview/0.5
This was January 2020 so it may change over time, FYI
I suggest you can find it easily. Develop a tiny website to record user-agent of all requests. Post the url of your website in teams. Then you can find it in the recorded user-agents.
I've seen in the logs of my site the following user agent:
Mozilla/5.0 (iPhone; U; CPU iPhone OS 12.4.1; en_US; ) AppleWebKit/0.0 (KHTML, like Gecko) Version/0.0; GmmClient:google_ios/com.google.Maps/5.27.8/Mobile/ios:iPhone10,3/iOS-AppStore
What app can be generating this traffic?
The part GmmClient:google_ios/com.google.Maps/5.27.8/Mobile/ios probably indicates that traffic is generated from Google Maps for iOS, when THe website is opened in a webview inside this app.
But I can't find any documentation referencing GmmClient so I can't confirm it.
I've been trying to get hostClientType from Teams context. I get context with the code below, but hostClientType is not populated / available. I need to distinguish between running in teams webapp or teams desktop app and think the property is therefore. Any help is appreciated.
microsoftTeams.getContext(function (context) {
alert(context.hostClientType) // undefined
})
It's not in the object that .getContext returns.
Try navigator.userAgent - it will return something like: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Teams/1.1.00.22163 Chrome/61.0.3163.100 Electron/2.0.4 Safari/537.36".
I want to make a small application that shows a website (so I can just open te app and use the website). The website only allows connections from Safari/Chrome that's why the user agent
I use these lines to change te user agent of my webview
let userAgent = " Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.52 Safari/537.36"
NSUserDefaults.standardUserDefaults().registerDefaults(["UserAgent" : userAgent])
print(NSUserDefaults.standardUserDefaults().stringForKey("UserAgent"))
print(wapView.stringByEvaluatingJavaScriptFromString("navigator.userAgent"))
The console then prints:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.52 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11) AppleWebKit/601.1.56 (KHTML, like Gecko)
And the website doesn't open. I don't know why it won't change. Any suggestions?
I use these lines to create the request:
let uUrl = NSURL(string: "https://www.websiteUrl.com")
let reqq = NSMutableURLRequest(URL: uUrl!)
self.webView.mainFrame.loadRequest(reqq)
Changing user agent for custom webview using swift
// Remember to import proper library for webview
import WebKit
// create url string for webview
let url = NSURL(string: "https://messenger.yahoo.com") //url of your choice
let request = NSURLRequest(URL: url!)
// the user agent of your choice, in this case safari 7.0.3
let customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A"
// this will set the user agent for your webview
webView.applicationNameForUserAgent = customUserAgent
webView.mainFrame.loadRequest(request)
for a list of complete user agents see this website http://www.useragentstring.com/pages/useragentstring.php