Changeset 160354 in webkit


Ignore:
Timestamp:
Dec 10, 2013 2:19:06 AM (10 years ago)
Author:
Gustavo Noronha Silva
Message:

[GTK] REGRESSION: www.yahoo.com redirects to the mobile version after UA change
https://bugs.webkit.org/show_bug.cgi?id=125444

Reviewed by Martin Robinson.

  • platform/gtk/UserAgentGtk.cpp:

(WebCore::platformVersionForUAString): more correctly pretend we're Mac OS X.
(WebCore::standardUserAgent): ditto.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r160352 r160354  
     12013-12-10  Gustavo Noronha Silva  <gns@gnome.org>
     2
     3        [GTK] REGRESSION: www.yahoo.com redirects to the mobile version after UA change
     4        https://bugs.webkit.org/show_bug.cgi?id=125444
     5
     6        Reviewed by Martin Robinson.
     7
     8        * platform/gtk/UserAgentGtk.cpp:
     9        (WebCore::platformVersionForUAString): more correctly pretend we're Mac OS X.
     10        (WebCore::standardUserAgent): ditto.
     11
    1122013-12-09  Gustavo Noronha Silva  <gns@gnome.org>
    213
  • trunk/Source/WebCore/platform/gtk/UserAgentGtk.cpp

    r159572 r160354  
    3131#if OS(UNIX)
    3232#include <sys/utsname.h>
    33 #elif OS(WINDOWS)
    34 #include "SystemInfo.h"
    3533#endif
    3634
    3735namespace WebCore {
    3836
    39 #if OS(DARWIN) || OS(UNIX)
    4037static const char* cpuDescriptionForUAString()
    4138{
     
    5047#endif
    5148}
    52 #endif
    53 
    54 static const char* platformForUAString()
    55 {
    56 #if PLATFORM(X11)
    57     return "X11";
    58 #elif OS(WINDOWS)
    59     return "";
    60 #elif PLATFORM(MAC)
    61     return "Macintosh";
    62 #elif defined(GDK_WINDOWING_DIRECTFB)
    63     return "DirectFB";
    64 #else
    65     return "Unknown";
    66 #endif
    67 }
    6849
    6950static String platformVersionForUAString()
     
    7354        return uaOSVersion;
    7455
    75 #if OS(WINDOWS)
    76     uaOSVersion = windowsVersionForUAString();
    77 #elif OS(DARWIN) || OS(UNIX)
    7856    // We will always claim to be Safari in Mac OS X, since Safari in Linux triggers the iOS path on
    7957    // some websites.
    8058    uaOSVersion = String::format("%s Mac OS X", cpuDescriptionForUAString());
    81 #else
    82     uaOSVersion = String("Unknown");
    83 #endif
    8459    return uaOSVersion;
    8560}
     
    9671    // sites won't load resources at all.
    9772    DEFINE_STATIC_LOCAL(const CString, uaVersion, (String::format("%i.%i", USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION).utf8()));
    98     DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (%s; %s) AppleWebKit/%s (KHTML, like Gecko) Safari/%s",
    99                                                                 platformForUAString(), platformVersionForUAString().utf8().data(),
    100                                                                 uaVersion.data(), uaVersion.data())));
     73    DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (Macintosh; %s) AppleWebKit/%s (KHTML, like Gecko) Safari/%s",
     74        platformVersionForUAString().utf8().data(), uaVersion.data(), uaVersion.data())));
     75
    10176    if (applicationName.isEmpty())
    10277        return staticUA;
Note: See TracChangeset for help on using the changeset viewer.