Changeset 210168 in webkit


Ignore:
Timestamp:
Dec 27, 2016 7:26:52 AM (7 years ago)
Author:
Michael Catanzaro
Message:

[GTK] Improve user agent construction
https://bugs.webkit.org/show_bug.cgi?id=142074

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Use the macOS rather than the Chrome quirk for Google domains, to avoid problems with
Google Calendar and Google Maps.

  • platform/UserAgentQuirks.cpp:

(WebCore::urlRequiresChromeBrowser):
(WebCore::urlRequiresMacintoshPlatform):

Tools:

  • TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r210152 r210168  
     12016-12-27  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        [GTK] Improve user agent construction
     4        https://bugs.webkit.org/show_bug.cgi?id=142074
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Use the macOS rather than the Chrome quirk for Google domains, to avoid problems with
     9        Google Calendar and Google Maps.
     10
     11        * platform/UserAgentQuirks.cpp:
     12        (WebCore::urlRequiresChromeBrowser):
     13        (WebCore::urlRequiresMacintoshPlatform):
     14
    1152016-12-26  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/platform/UserAgentQuirks.cpp

    r207406 r210168  
    4646        return true;
    4747
    48     // Shut off Chrome ads. Avoid missing features on maps.google.com. Avoid
    49     // receiving a terrible fallback version of calendar.google.com. Receive a
    50     // fancier plus.google.com.
    51     if (baseDomain.startsWith("google."))
    52         return true;
    53 
    5448    // Needed for YouTube 360 with WebKitGTK+ and WPE (requires ENABLE_MEDIA_SOURCE).
    5549    if (baseDomain == "youtube.com")
     
    6660{
    6761    String baseDomain = topPrivatelyControlledDomain(url.host());
     62
     63    // Avoid receiving terrible fallbacks version of calendar.google.com and
     64    // maps.google.com on certain platforms. https://webkit.org/b/142074
     65    if (baseDomain.startsWith("google."))
     66        return true;
    6867
    6968    // At least finance.yahoo.com displays a mobile version with WebKitGTK+'s standard user agent.
  • trunk/Tools/ChangeLog

    r210147 r210168  
     12016-12-27  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        [GTK] Improve user agent construction
     4        https://bugs.webkit.org/show_bug.cgi?id=142074
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
     9        (TestWebKitAPI::TEST):
     10
    1112016-12-23  Simon Fraser  <simon.fraser@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp

    r207406 r210168  
    7070    EXPECT_TRUE(uaString.isNull());
    7171
     72#if !OS(MAC_OS_X)
    7273    // Google quirk should not affect sites with similar domains.
    7374    uaString = standardUserAgentForURL(URL(ParsedURLString, "http://www.googleblog.com/"));
    74     EXPECT_FALSE(uaString.contains("Chrome"));
     75    EXPECT_FALSE(uaString.contains("Macintosh"));
     76    EXPECT_FALSE(uaString.contains("Mac OS X"));
     77#endif
    7578
    7679    assertUserAgentForURLHasChromeBrowserQuirk("http://typekit.com/");
    7780    assertUserAgentForURLHasChromeBrowserQuirk("http://typekit.net/");
    78     assertUserAgentForURLHasChromeBrowserQuirk("http://www.google.com/");
    79     assertUserAgentForURLHasChromeBrowserQuirk("http://www.google.es/");
    80     assertUserAgentForURLHasChromeBrowserQuirk("http://calendar.google.com/");
    81     assertUserAgentForURLHasChromeBrowserQuirk("http://maps.google.com/");
    82     assertUserAgentForURLHasChromeBrowserQuirk("http://plus.google.com/");
    8381    assertUserAgentForURLHasChromeBrowserQuirk("http://www.youtube.com/");
    8482    assertUserAgentForURLHasChromeBrowserQuirk("http://www.slack.com/");
     
    8987    assertUserAgentForURLHasMacPlatformQuirk("http://www.whatsapp.com/");
    9088    assertUserAgentForURLHasMacPlatformQuirk("http://web.whatsapp.com/");
     89
     90    assertUserAgentForURLHasMacPlatformQuirk("http://www.google.com/");
     91    assertUserAgentForURLHasMacPlatformQuirk("http://www.google.es/");
     92    assertUserAgentForURLHasMacPlatformQuirk("http://calendar.google.com/");
     93    assertUserAgentForURLHasMacPlatformQuirk("http://maps.google.com/");
     94    assertUserAgentForURLHasMacPlatformQuirk("http://plus.google.com/");
    9195}
    9296
Note: See TracChangeset for help on using the changeset viewer.