Title: [207118] releases/WebKitGTK/webkit-2.14
- Revision
- 207118
- Author
- [email protected]
- Date
- 2016-10-11 06:23:53 -0700 (Tue, 11 Oct 2016)
Log Message
Merge r206515 - [GTK] Adjust OS X UA quirks list
https://bugs.webkit.org/show_bug.cgi?id=162616
Reviewed by Carlos Garcia Campos.
Remove the OS X quirk for yahoo.com as it's no longer needed. Add quirks for taobao.com and
whatsapp.com.
* platform/gtk/UserAgentGtk.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::standardUserAgentForURL):
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (207117 => 207118)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog 2016-10-11 13:23:44 UTC (rev 207117)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog 2016-10-11 13:23:53 UTC (rev 207118)
@@ -1,5 +1,19 @@
2016-09-28 Michael Catanzaro <[email protected]>
+ [GTK] Adjust OS X UA quirks list
+ https://bugs.webkit.org/show_bug.cgi?id=162616
+
+ Reviewed by Carlos Garcia Campos.
+
+ Remove the OS X quirk for yahoo.com as it's no longer needed. Add quirks for taobao.com and
+ whatsapp.com.
+
+ * platform/gtk/UserAgentGtk.cpp:
+ (WebCore::urlRequiresMacintoshPlatform):
+ (WebCore::standardUserAgentForURL):
+
+2016-09-28 Michael Catanzaro <[email protected]>
+
[GTK] Simplify platformForUAString
https://bugs.webkit.org/show_bug.cgi?id=162614
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/gtk/UserAgentGtk.cpp (207117 => 207118)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/gtk/UserAgentGtk.cpp 2016-10-11 13:23:44 UTC (rev 207117)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/gtk/UserAgentGtk.cpp 2016-10-11 13:23:53 UTC (rev 207118)
@@ -26,6 +26,7 @@
#include "config.h"
#include "UserAgentGtk.h"
+#include "PublicSuffix.h"
#include "URL.h"
#include <wtf/NeverDestroyed.h>
#include <wtf/text/StringBuilder.h>
@@ -171,13 +172,26 @@
return standardUserAgentStatic() + ' ' + applicationName + '/' + finalApplicationVersion;
}
+static bool urlRequiresMacintoshPlatform(const URL& url)
+{
+ String baseDomain = topPrivatelyControlledDomain(url.host());
+
+ // taobao.com displays a mobile version with our standard user agent.
+ if (baseDomain == "taobao.com")
+ return true;
+
+ // web.whatsapp.com completely blocks users with our standard user agent.
+ if (baseDomain == "whatsapp.com")
+ return true;
+
+ return false;
+}
+
String standardUserAgentForURL(const URL& url)
{
ASSERT(!url.isNull());
UserAgentQuirks quirks;
- if (url.host().endsWith(".yahoo.com")) {
- // www.yahoo.com redirects to the mobile version when Linux is present in the UA,
- // use always Macintosh as platform. See https://bugs.webkit.org/show_bug.cgi?id=125444.
+ if (urlRequiresMacintoshPlatform(url)) {
quirks.add(UserAgentQuirks::NeedsMacintoshPlatform);
}
Modified: releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp (207117 => 207118)
--- releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp 2016-10-11 13:23:44 UTC (rev 207117)
+++ releases/WebKitGTK/webkit-2.14/Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp 2016-10-11 13:23:53 UTC (rev 207118)
@@ -38,8 +38,8 @@
String uaString = standardUserAgentForURL(URL(ParsedURLString, "http://www.webkit.org/"));
EXPECT_TRUE(uaString.isNull());
- // www.yahoo.com requires MAC OS platform in the UA.
- uaString = standardUserAgentForURL(URL(ParsedURLString, "http://www.yahoo.com/"));
+ // web.whatsapp.com requires MAC OS platform in the UA.
+ uaString = standardUserAgentForURL(URL(ParsedURLString, "http://web.whatsapp.com/"));
EXPECT_TRUE(uaString.contains("Macintosh"));
EXPECT_TRUE(uaString.contains("Mac OS X"));
EXPECT_FALSE(uaString.contains("Linux"));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes