In my application I would like to save user's last used browser to avoid spending lot of time on the phone with users trying to find out whether they are using an IE7 or and IE8. Storing user agent string would probably be just fine for me, however, if possible, I would like to store and show only the brand name and version, i.e. something readable for "normals" humans like "Mozilla Firefox 3.6".
So my question is: is there a database of some kind which collects user agent strings and maps them to brand names and provides the data as something I could use in development? If not, do you know of any mature software which parses the user agent string and returns a brand name?
The brand name and version could quite easy be parsed out from the user agent string using regex or simple string search.
Here's a regex example for catching Browser & version. You might want to map "MSIE" to "Internet Explorer" or something.
(MSIE|Firefox|Chrome)(\s|\/)(\d{1,3}\.\d)
But otherwise you can find list like this used for the "user agent switcher plugin" in FireFox or this list with only mobile browsers. The first link gives a description matched for almost all user agents/browses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With