Title: [247361] trunk/Source/WebCore
Revision
247361
Author
[email protected]
Date
2019-07-11 13:52:06 -0700 (Thu, 11 Jul 2019)

Log Message

Pages using Google Tag Manager Google's anti-flicker optimization may take ~5 seconds to do initial paint
https://bugs.webkit.org/show_bug.cgi?id=199704
<rdar://problem/52966461>

Reviewed by Geoffrey Garen.

Apply the same fix as r246764 for when "https://www.googletagmanager.com/gtm.js" load is blocked by a content
extension to avoid delaying initial paint by ~5 seconds. This was tested on https://www.formula1.com/en.html.

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (247360 => 247361)


--- trunk/Source/WebCore/ChangeLog	2019-07-11 20:11:47 UTC (rev 247360)
+++ trunk/Source/WebCore/ChangeLog	2019-07-11 20:52:06 UTC (rev 247361)
@@ -1,5 +1,19 @@
 2019-07-11  Chris Dumez  <[email protected]>
 
+        Pages using Google Tag Manager Google's anti-flicker optimization may take ~5 seconds to do initial paint
+        https://bugs.webkit.org/show_bug.cgi?id=199704
+        <rdar://problem/52966461>
+
+        Reviewed by Geoffrey Garen.
+
+        Apply the same fix as r246764 for when "https://www.googletagmanager.com/gtm.js" load is blocked by a content
+        extension to avoid delaying initial paint by ~5 seconds. This was tested on https://www.formula1.com/en.html.
+
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
+
+2019-07-11  Chris Dumez  <[email protected]>
+
         Disable RGB10 IOSurface pixel format for Mac Catalyst
         https://bugs.webkit.org/show_bug.cgi?id=199712
         <rdar://problem/52793584>

Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (247360 => 247361)


--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp	2019-07-11 20:11:47 UTC (rev 247360)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp	2019-07-11 20:52:06 UTC (rev 247361)
@@ -237,7 +237,9 @@
         
             // Quirk for content-blocker interference with Google's anti-flicker optimization (rdar://problem/45968770).
             // https://developers.google.com/optimize/
-            if (currentDocument->settings().googleAntiFlickerOptimizationQuirkEnabled() && url == "https://www.google-analytics.com/analytics.js"_str) {
+            if (currentDocument->settings().googleAntiFlickerOptimizationQuirkEnabled()
+                && ((equalLettersIgnoringASCIICase(url.host(), "www.google-analytics.com") && equalLettersIgnoringASCIICase(url.path(), "/analytics.js"))
+                    || (equalLettersIgnoringASCIICase(url.host(), "www.googletagmanager.com") && equalLettersIgnoringASCIICase(url.path(), "/gtm.js")))) {
                 if (auto* frame = currentDocument->frame())
                     frame->script().evaluate(ScriptSourceCode { "try { window.dataLayer.hide.end(); console.log('Called window.dataLayer.hide.end() in frame ' + document.URL + ' because the content blocker blocked the load of the https://www.google-analytics.com/analytics.js script'); } catch (e) { }"_s });
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to