Title: [266584] trunk
Revision
266584
Author
[email protected]
Date
2020-09-04 04:14:48 -0700 (Fri, 04 Sep 2020)

Log Message

[GLIB] Stop using firefox user agent quirk for google docs
https://bugs.webkit.org/show_bug.cgi?id=215845

Reviewed by Adrian Perez de Castro.

Source/WebCore:

It causes problems with the CSP headers when accounts.youtube.com is used by google login and it no longer works
for google docs in any case.

* platform/UserAgentQuirks.cpp:
(WebCore::isGoogle):
(WebCore::urlRequiresFirefoxBrowser):

Tools:

Update API tests. Bring back UserAgentQuirks.cpp to the build that was removed in r244857.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (266583 => 266584)


--- trunk/Source/WebCore/ChangeLog	2020-09-04 08:31:28 UTC (rev 266583)
+++ trunk/Source/WebCore/ChangeLog	2020-09-04 11:14:48 UTC (rev 266584)
@@ -1,3 +1,17 @@
+2020-09-04  Carlos Garcia Campos  <[email protected]>
+
+        [GLIB] Stop using firefox user agent quirk for google docs
+        https://bugs.webkit.org/show_bug.cgi?id=215845
+
+        Reviewed by Adrian Perez de Castro.
+
+        It causes problems with the CSP headers when accounts.youtube.com is used by google login and it no longer works
+        for google docs in any case.
+
+        * platform/UserAgentQuirks.cpp:
+        (WebCore::isGoogle):
+        (WebCore::urlRequiresFirefoxBrowser):
+
 2020-09-03  Ryosuke Niwa  <[email protected]>
 
         Store all styling flags in m_rendererWithStyleFlags

Modified: trunk/Source/WebCore/platform/UserAgentQuirks.cpp (266583 => 266584)


--- trunk/Source/WebCore/platform/UserAgentQuirks.cpp	2020-09-04 08:31:28 UTC (rev 266583)
+++ trunk/Source/WebCore/platform/UserAgentQuirks.cpp	2020-09-04 11:14:48 UTC (rev 266584)
@@ -38,6 +38,11 @@
 static bool isGoogle(const URL& url)
 {
     String domain = url.host().toString();
+
+    // Google uses accounts.youtube.com for its login service.
+    if (domain == "accounts.youtube.com")
+        return true;
+
     String baseDomain = topPrivatelyControlledDomain(domain);
 
     // Our Google UA is *very* complicated to get right. Read
@@ -93,14 +98,6 @@
 {
     String domain = url.host().toString();
 
-    // This quirk actually has nothing to do with YouTube. It's needed to avoid
-    // unsupported browser warnings on Google Docs. After removing this quirk,
-    // to reproduce the warnings you will need to sign out of Google, then click
-    // on a link to a non-public document that requires signing in. The
-    // unsupported browser warning will be displayed after signing in.
-    if (domain == "accounts.youtube.com" || domain == "docs.google.com")
-        return true;
-
     // Google Drive shows an unsupported browser warning with WebKitGTK's
     // standard user agent.
     if (domain == "drive.google.com")

Modified: trunk/Tools/ChangeLog (266583 => 266584)


--- trunk/Tools/ChangeLog	2020-09-04 08:31:28 UTC (rev 266583)
+++ trunk/Tools/ChangeLog	2020-09-04 11:14:48 UTC (rev 266584)
@@ -1,3 +1,17 @@
+2020-09-04  Carlos Garcia Campos  <[email protected]>
+
+        [GLIB] Stop using firefox user agent quirk for google docs
+        https://bugs.webkit.org/show_bug.cgi?id=215845
+
+        Reviewed by Adrian Perez de Castro.
+
+        Update API tests. Bring back UserAgentQuirks.cpp to the build that was removed in r244857.
+
+        * TestWebKitAPI/PlatformGTK.cmake:
+        * TestWebKitAPI/PlatformWPE.cmake:
+        * TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
+        (TestWebKitAPI::TEST):
+
 2020-09-03  James Darpinian  <[email protected]>
 
         Update James Darpinian's status to committer

Modified: trunk/Tools/TestWebKitAPI/PlatformGTK.cmake (266583 => 266584)


--- trunk/Tools/TestWebKitAPI/PlatformGTK.cmake	2020-09-04 08:31:28 UTC (rev 266583)
+++ trunk/Tools/TestWebKitAPI/PlatformGTK.cmake	2020-09-04 11:14:48 UTC (rev 266584)
@@ -32,6 +32,7 @@
 list(APPEND TestWebCore_SOURCES
     ${test_main_SOURCES}
 
+    Tests/WebCore/UserAgentQuirks.cpp
     Tests/WebCore/gstreamer/GStreamerTest.cpp
     Tests/WebCore/gstreamer/GstMappedBuffer.cpp
 

Modified: trunk/Tools/TestWebKitAPI/PlatformWPE.cmake (266583 => 266584)


--- trunk/Tools/TestWebKitAPI/PlatformWPE.cmake	2020-09-04 08:31:28 UTC (rev 266583)
+++ trunk/Tools/TestWebKitAPI/PlatformWPE.cmake	2020-09-04 11:14:48 UTC (rev 266584)
@@ -28,6 +28,7 @@
 list(APPEND TestWebCore_SOURCES
     ${test_main_SOURCES}
 
+    Tests/WebCore/UserAgentQuirks.cpp
     Tests/WebCore/gstreamer/GStreamerTest.cpp
     Tests/WebCore/gstreamer/GstMappedBuffer.cpp
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp (266583 => 266584)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp	2020-09-04 08:31:28 UTC (rev 266583)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp	2020-09-04 11:14:48 UTC (rev 266584)
@@ -95,8 +95,6 @@
     assertUserAgentForURLHasChromeBrowserQuirk("http://auth.mayohr.com/");
     assertUserAgentForURLHasChromeBrowserQuirk("http://bankofamerica.com/");
 
-    assertUserAgentForURLHasFirefoxBrowserQuirk("http://accounts.youtube.com/");
-    assertUserAgentForURLHasFirefoxBrowserQuirk("http://docs.google.com/");
     assertUserAgentForURLHasFirefoxBrowserQuirk("http://drive.google.com/");
     assertUserAgentForURLHasFirefoxBrowserQuirk("http://bugzilla.redhat.com/");
 
@@ -106,6 +104,8 @@
     assertUserAgentForURLHasLinuxPlatformQuirk("http://plus.google.com/");
     assertUserAgentForURLHasLinuxPlatformQuirk("http://drive.google.com/");
     assertUserAgentForURLHasLinuxPlatformQuirk("http://fonts.googleapis.com/");
+    assertUserAgentForURLHasLinuxPlatformQuirk("http://accounts.youtube.com/");
+    assertUserAgentForURLHasLinuxPlatformQuirk("http://docs.google.com/");
 
     assertUserAgentForURLHasMacPlatformQuirk("http://www.yahoo.com/");
     assertUserAgentForURLHasMacPlatformQuirk("http://finance.yahoo.com/");
@@ -113,7 +113,6 @@
     assertUserAgentForURLHasMacPlatformQuirk("http://www.whatsapp.com/");
     assertUserAgentForURLHasMacPlatformQuirk("http://web.whatsapp.com/");
     assertUserAgentForURLHasMacPlatformQuirk("http://www.chase.com/");
-    assertUserAgentForURLHasMacPlatformQuirk("http://drive.google.com/");
     assertUserAgentForURLHasMacPlatformQuirk("http://paypal.com/");
     assertUserAgentForURLHasMacPlatformQuirk("http://outlook.live.com/");
     assertUserAgentForURLHasMacPlatformQuirk("http://mail.ntu.edu.tw/");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to