Changeset 206515 in webkit
- Timestamp:
- Sep 28, 2016 7:40:31 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206514 r206515 1 2016-09-28 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [GTK] Adjust OS X UA quirks list 4 https://bugs.webkit.org/show_bug.cgi?id=162616 5 6 Reviewed by Carlos Garcia Campos. 7 8 Remove the OS X quirk for yahoo.com as it's no longer needed. Add quirks for taobao.com and 9 whatsapp.com. 10 11 * platform/gtk/UserAgentGtk.cpp: 12 (WebCore::urlRequiresMacintoshPlatform): 13 (WebCore::standardUserAgentForURL): 14 1 15 2016-09-28 Alejandro G. Castro <alex@igalia.com> 2 16 -
trunk/Source/WebCore/platform/gtk/UserAgentGtk.cpp
r206513 r206515 27 27 #include "UserAgentGtk.h" 28 28 29 #include "PublicSuffix.h" 29 30 #include "URL.h" 30 31 #include <wtf/NeverDestroyed.h> … … 172 173 } 173 174 175 static bool urlRequiresMacintoshPlatform(const URL& url) 176 { 177 String baseDomain = topPrivatelyControlledDomain(url.host()); 178 179 // taobao.com displays a mobile version with our standard user agent. 180 if (baseDomain == "taobao.com") 181 return true; 182 183 // web.whatsapp.com completely blocks users with our standard user agent. 184 if (baseDomain == "whatsapp.com") 185 return true; 186 187 return false; 188 } 189 174 190 String standardUserAgentForURL(const URL& url) 175 191 { 176 192 ASSERT(!url.isNull()); 177 193 UserAgentQuirks quirks; 178 if (url.host().endsWith(".yahoo.com")) { 179 // www.yahoo.com redirects to the mobile version when Linux is present in the UA, 180 // use always Macintosh as platform. See https://bugs.webkit.org/show_bug.cgi?id=125444. 194 if (urlRequiresMacintoshPlatform(url)) { 181 195 quirks.add(UserAgentQuirks::NeedsMacintoshPlatform); 182 196 } -
trunk/Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp
r169887 r206515 39 39 EXPECT_TRUE(uaString.isNull()); 40 40 41 // w ww.yahoo.com requires MAC OS platform in the UA.42 uaString = standardUserAgentForURL(URL(ParsedURLString, "http://w ww.yahoo.com/"));41 // web.whatsapp.com requires MAC OS platform in the UA. 42 uaString = standardUserAgentForURL(URL(ParsedURLString, "http://web.whatsapp.com/")); 43 43 EXPECT_TRUE(uaString.contains("Macintosh")); 44 44 EXPECT_TRUE(uaString.contains("Mac OS X"));
Note: See TracChangeset
for help on using the changeset viewer.