Changeset 206517 in webkit


Ignore:
Timestamp:
Sep 28, 2016 7:49:14 AM (8 years ago)
Author:
Michael Catanzaro
Message:

[GTK] User agent should always claim to be Intel
https://bugs.webkit.org/show_bug.cgi?id=162610

Reviewed by Carlos Garcia Campos.

We should always claim to be running on Intel regardless of actual CPU type. See discussion
in bug #162548 for details. In particular, we can never advertise ARM because it causes dumb
websites to send mobile pages.

  • platform/gtk/UserAgentGtk.cpp:

(WebCore::platformVersionForUAString):
(WebCore::buildUserAgentString):
(WebCore::cpuDescriptionForUAString): Deleted.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206515 r206517  
     12016-09-28  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        [GTK] User agent should always claim to be Intel
     4        https://bugs.webkit.org/show_bug.cgi?id=162610
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        We should always claim to be running on Intel regardless of actual CPU type. See discussion
     9        in bug #162548 for details. In particular, we can never advertise ARM because it causes dumb
     10        websites to send mobile pages.
     11
     12        * platform/gtk/UserAgentGtk.cpp:
     13        (WebCore::platformVersionForUAString):
     14        (WebCore::buildUserAgentString):
     15        (WebCore::cpuDescriptionForUAString): Deleted.
     16
    1172016-09-28  Michael Catanzaro  <mcatanzaro@igalia.com>
    218
  • trunk/Source/WebCore/platform/gtk/UserAgentGtk.cpp

    r206515 r206517  
    7777};
    7878
    79 static const char* cpuDescriptionForUAString()
    80 {
    81 #if CPU(PPC) || CPU(PPC64)
    82     return "PPC";
    83 #elif CPU(X86) || CPU(X86_64)
    84     return "Intel";
    85 #elif CPU(ARM) || CPU(ARM64)
    86     return "ARM";
    87 #else
    88     return "Unknown";
    89 #endif
    90 }
    91 
    9279static const char* platformForUAString()
    9380{
     
    10895#else
    10996    // We will always claim to be Safari in Mac OS X, since Safari in Linux triggers the iOS path on some websites.
    110     static NeverDestroyed<const String> uaOSVersion(String::format("%s Mac OS X", cpuDescriptionForUAString()));
     97    // And we always claim to be Intel since ARM triggers mobile versions of some websites.
     98    static NeverDestroyed<const String> uaOSVersion(ASCIILiteral("Intel Mac OS X"));
    11199    return uaOSVersion;
    112100#endif
     
    131119    uaString.appendLiteral("; ");
    132120
    133     if (quirks.contains(UserAgentQuirks::NeedsMacintoshPlatform)) {
    134         uaString.append(cpuDescriptionForUAString());
    135         uaString.appendLiteral(" Mac OS X");
    136     } else
     121    if (quirks.contains(UserAgentQuirks::NeedsMacintoshPlatform))
     122        uaString.appendLiteral("Intel Mac OS X");
     123    else
    137124        uaString.append(platformVersionForUAString());
    138125
Note: See TracChangeset for help on using the changeset viewer.