What Does Your User Agent Say About You?


A user agent is a computer program representing a person, for example, a browser in a Web context.

Besides a browser, a user agent could be a bot scraping webpages, a download manager, or another app accessing the Web. Along with each request they make to the server, browsers include a self-identifying User-Agent HTTP header called a user agent (UA) string. This string often identifies the browser, its version number, and its host operating system.

Spam bots, download managers, and some browsers often send a fake UA string to announce themselves as a different client. This is known as user agent spoofing.

The user agent string can be accessed with JavaScript on the client side using the navigator.userAgent property.

A typical user agent string looks like this: "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0".


User Agent String

Browser Data

Facebook User Agent String

Bob Roberts
• Tuesday, 05 July, 2022
• 10 min read

Small, yet important, correction Facebook external hit uses 2 different user agents: Setting you Hitler to 1.1 only may cause filtering issues with 1.0 version.

agent user string change chrome webview browser google khtml techbeasts remark browse check


When you share a link to your site on Facebook, Facebook crawls it and parses it to get some data to display the thumbnail, title and some content from your page, but it would link back to your site. Also, I think this would lead to cloaking of the site, i.e. displaying different data to user and the crawlers.

And if you want to block Facebook bot from accessing your website (assuming you're using Apache) add this to your.htaccess file: It also blocks googles feed fetcher that also can be used for cheap Dosing.

Firstly you should not use in_array as you will need to have the full user agent and not just a subset, thus will quickly break with changes (i.e. version 1.2 from Facebook will not work if you follow the current preferred answer). It is also slower to iterate through an array rather than use a regex pattern.

Also, you should not use $_SERVER; but you should filter it first Incas someone has been a little nasty things exist in there. You already have the answer for Facebook above, but one way to get any user agent is to place a script on your site that will mail you when there is a visit to it.

Cedrhr I understand that the caching works for the URL when you just bring it up in a browser window. My problem is specifically that the Facebook crawler is being excluded from being served the cached version of the page.

strings difference agent rat unpacking

The screenshot you just sent me shows that the URL is able to be crawled normally by Facebook if there is no query string present. Facebook does not see the cached version of the page if there is a query string present.

The crawler gathers, caches, and displays information about the app or website such as its title, description, and thumbnail image. Any Open Graph properties need to be listed before the first 1 MB of your website or app, or it will be cutoff.

Your app or website should either generate and return a response with all required properties according to the bytes specified in the Range header of the crawler request or it should ignore the Range header altogether. Add to your allow list either the user agent strings or the IP addresses (more secure) used by the crawler.

To get a current list of IP addresses the crawler uses, run the following command. An often overlooked part of the discussion is that when engaged with a native app some portion of this time is spent actually on the web, via a web view.

A web view is pretty much a browser wrapped inside an app. What’s happening is that Facebook is making use of the phone’s web view component to open the link.

agent user string support keycdn

Now take a look at the second pair of images, this time showing the respective menus of the web view and native browser. In the native browser you have access to your bookmarks, browsing history, text search and more.

The first is that the web view, in the Android case anyway, is essentially a different or older browser, and as such the set of features supported is not the same. That the browser versions used are different has been noted on the Chrome developers site.

For example, device ids, IMEI, usernames, phone numbers, even preferred language should not be included. In particular, the inclusion of operator information Vodafone increases fingerprinting susceptibility.

WebKit (18,642,786) Blink (9,913,314) Trident (1,737,329) Presto (368,303) Gecko (299,203) Edge HTML (25,016) Gonna (3,639) HTML (3,483) Seafront (3,419) If you need to integrate the user agent parser directly into your website or system then it's very simple to use the API.

This will let you do things like advanced filtering and searching, identify trends in user agents, perform statistical analysis and other interesting applications. It is possible to change or “fake” what your web browser sends as its user agent.

browser string agent user know need dev

Platform identifiers change based on the operating system being used, and version numbers also increment as time passes. Mapping UA string tokens to a more human-readable browser name for use in code is a common pattern on the web today.

When mapping the new Edge token to a browser name, Microsoft recommends using a different name than the one developer used for the legacy version of Microsoft Edge to avoid accidentally applying any legacy workarounds that are not applicable to Chromium-based browsers. When Microsoft is notified about these types of issues, website owners are contacted and informed about the updated UA.

In these cases, Microsoft uses a list of UA overrides in our Beta and Stable channels to maximize compatibility for users who access these sites.

Other Articles You Might Be Interested In

01: Useragentapplication Config
02: Useragentapplication Logout
03: Useragentapplication React
04: Useragent Android Mobile Phone
05: Useragent Iphone X
06: Useragent Phone Model
07: User Agent Allow
08: User Agent Apple
09: User Agent Application
10: User Agent Attacks
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10 -