LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   User Agent string (http://www.linuxquestions.org/questions/linux-general-1/user-agent-string-944722/)

EliasAlucard 05-13-2012 07:59 AM

User Agent string
 
I'm currently working on a vBulletin plugin for postbit, so that the user agent string is identified and properly displayed in the postbit. That way, the browser and operating system is shown as two small icons. This plugin has been around for years, but the original author stopped working on it, so I'm updating it now with new icons and so on.

Anyway, Linux Mint shows up as Ubuntu when posting from Mint, and this is not the fault of the plugin, but because how Linux Mint is configured not to display its own UA string, which is problematic because the user agent string is about giving credit where it's due, and this gives us incorrect statistics of how common this and that distribution is on our websites/forums when the developers of said distribution (or browser) don't care enough about setting their own UA string and removing the UA string the OS/browser was forked from.

The following UA strings are used in Linux Mint 12:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/11.10 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0
Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.10.229 Version/11.64

It's completely illogical that Chrome/Chromium still shows the Safari UA string in version 18. Aside from the fact that it still identifies as Ubuntu, it also identifies as Linux and not GNU/Linux. A few years ago, this may not have been a problem because pretty much everyone who was using "Linux" was using GNU/Linux, but now, when we have Android, we have Linux without GNU, and we also have Debian/kFreeBSD (which is basically GNU/BSD), Nexenta OS (which was GNU/OpenSolaris), Arch Hurd and GNU Hurd (both of which are GNU variants as opposed to GNU/Linux), I think it's time to distinguish between generic "Linux" and the many variants of GNU and Linux. Linux is and always has been strictly a kernel anyway; not a complete operating system. Moreover, many Android UA strings identify as "Linux" only, which also adds more to the confusion, because it implies that Android is GNU/Linux too since most of the actual GNU/Linux distributions identify their UA string as "Linux" only.

In any case, why are developers so ignorant of the user agent string in their projects? If anything, it gives recognition to their projects.

I would like to encourage debate upon this issue and encourage developers to stop neglecting the user agent string and set them as correctly as possible, such as, "Linux; Android" when it's Android (obviously, because Android doesn't use GNU), "GNU/Linux; Ubuntu" when it's Ubuntu, and Mint when it's Mint, and so on. And no Safari when it's Chromium, and no Chrome when it's Chromium, and no Safari/Chrome when it's Comodo Dragon / SRWare Iron and so on. Please, how difficult can it be?

Doc CPU 05-13-2012 09:08 AM

Hi there,

I can't help thinking that you give the User Agent string a meaning it doesn't deserve.

Basically, it should be a string that tells the server a bit about the HTTP client (aka browser). But fact is, for most browsers it can be set to arbitrary values by the user, it can be modified by proxies between server and client, and it can be changed or supplemented by certain libraries and other software components on the client side. Plus, it's an information not even required by the HTTP specification - that is, it could be missing entirely.

Years ago, some web services examined the User Agent to identify the client and try to circumvent known bugs of certain browsers. However, the proliferation of different browsers (including variants of the same "chassis") renders even that intention useless.

Considering all that, it's okay to look at the User Agent string in the server logs to identify requests that might originate from the same client. But other than that, it's not worth more than a fancy badge of one's favorite football club.

Almost the same applies to the HTTP Referrer, by the way.

[X] Doc CPU

John VV 05-14-2012 12:37 AM

as above
today it is not an issue
IE5 and IE6 WERE the issue

the odd css use and lack of png with alpha support
And the Microsoft Visual Java VS. the official Sun JAVA

this required odd "hacks" for different browsers

Quote:


In any case, why are developers so ignorant of the user agent string in their projects? If anything, it gives recognition to their projects.
they are not

they don't give a bleep any more, and for the most part it is not needed .

Quote:

I would like to encourage debate upon this issue and encourage developers
if you want you can , but a lot of folk use "user agent switcher" in Firefox
I like to be a "google-bot " as seen in logs .

EliasAlucard 05-15-2012 03:22 AM

Quote:

Originally Posted by Doc CPU (Post 4677281)
Hi there,

I can't help thinking that you give the User Agent string a meaning it doesn't deserve.

That's not the case at all. The user agent string is important.

Quote:

Originally Posted by Doc CPU (Post 4677281)
Basically, it should be a string that tells the server a bit about the HTTP client (aka browser). But fact is, for most browsers it can be set to arbitrary values by the user, it can be modified by proxies between server and client, and it can be changed or supplemented by certain libraries and other software components on the client side. Plus, it's an information not even required by the HTTP specification - that is, it could be missing entirely.

Yes, but most users don't actually tamper with the UA string, proxies and whatnot. Most people just run the browser as is, and most browsers (certainly the big ones) have their own UA strings.

Quote:

Originally Posted by John VV (Post 4677694)
they are not

they don't give a bleep any more, and for the most part it is not needed .

It's needed for statistics. It's thanks to the UA string we know how much market share Windows, GNU/Linux, Firefox, Safari etc. have. Be that as it may, the statistics isn't 100% accurate because of the aforementioned issues in Doc's post, but

Quote:

Originally Posted by John VV (Post 4677694)
if you want you can , but a lot of folk use "user agent switcher" in Firefox

Out of all Firefox users (we're talking millions of people here), how many do you think actually use the UA switcher? According to Mozilla, this extension has an average of 651,963 daily users. How many average Firefox users are there today? It's certainly in the millions, and if not billion, it's close to a billion.


All times are GMT -5. The time now is 09:17 AM.