Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If you are using Google Chrome on Linux then the User-Agent request header will look like this:

Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1

From above we come to know the browser is Chrome and OS is Linux (I guess!). But when I log from the browser Midori using the same OS which is Linux (Fedora) I get to see this:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) AppleWebKit/535+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Midori/0.4

Why does it say Macintosh?

share|improve this question
    
Most browsers allow configuration of the User-Agent used. Maybe Midori is configured to use the User-Agent you provided? Checked that already? –  Shi Sep 9 '12 at 14:15

1 Answer 1

up vote 3 down vote accepted

Midori identifies as OS X Safari when set to Automatic. Choose Midori to override it.

From midori/midori-websettings.h:

typedef enum
{
    MIDORI_IDENT_MIDORI /* Automatic */,
    MIDORI_IDENT_GENUINE /* Midori */,
    MIDORI_IDENT_SAFARI,
    // etc.
} MidoriIdentity;

midori/midori-websettings.c:

switch (identify_as)
{
case MIDORI_IDENT_GENUINE:
    return g_strdup_printf ("Mozilla/5.0 (%s %s) AppleWebKit/%d.%d+ %s",
        platform, os, webcore_major, webcore_minor, appname);
case MIDORI_IDENT_MIDORI:
case MIDORI_IDENT_SAFARI:
    g_object_set (web_settings, "enable-site-specific-quirks", TRUE, NULL);
    return g_strdup_printf ("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; %s) "
        "AppleWebKit/%d+ (KHTML, like Gecko) Version/5.0 Safari/%d.%d+ %s",
        lang, webcore_major, webcore_major, webcore_minor, appname);
// etc.

While I don't know the reason the developers chose to mostly pretend to be Safari, this blog post of the history of the user agent string from two years ago is filled with earlier examples of adjusting user agent strings to trick feature detection on web sites. Just one example:

And the followers of Linux were much sorrowed, because they had built Konqueror, whose engine was KHTML, which they thought was as good as Gecko, but it was not Gecko, and so was not given the good pages, and so Konquerer began to pretend to be “like Gecko” to get the good pages, and called itself Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (KHTML, like Gecko) and there was much confusion.

Web developers often tailor web sites to specific browsers, implementing fallbacks for browsers with fewer features. Midori is too unknown and has too little market share to have web developers optimize specifically for it.

So as a workaround, your browser pretends to be a Safari as it's based on WebKit and behaves alike. Otherwise, it'd probably get the text-only basic design on some sites, instead of the modern HTML5 experience it's capable of.

Since there is no Safari for Linux, and changing from the default user agent strings brings some risk in not getting recognized as a capable browser, they had the choice between Windows and Mac OS X.

Supporting this assumption, from the Midori FAQ (data/faq.html when you download it):

Why does Google Mail/ Calendar/ Maps, Facebook not work or show mobile version?

Some websites discriminate against your browser.

If you have Midori older than 0.3.5, go to Preferences > Network > Identify As, and choose Custom. Paste this into the entry:

Mozilla/5.0 (X11; Linux) AppleWebKit/531.2+ Midori/0.3

If this doesn't do the trick, try choosing Safari or Firefox.

Many other websites use similar means of detecting the browser.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.