Changeset 247361 in webkit


Ignore:
Timestamp:
Jul 11, 2019 1:52:06 PM (5 years ago)
Author:
Chris Dumez
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247358 r247361  
     12019-07-11  Chris Dumez  <cdumez@apple.com>
     2
     3        Pages using Google Tag Manager Google's anti-flicker optimization may take ~5 seconds to do initial paint
     4        https://bugs.webkit.org/show_bug.cgi?id=199704
     5        <rdar://problem/52966461>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Apply the same fix as r246764 for when "https://www.googletagmanager.com/gtm.js" load is blocked by a content
     10        extension to avoid delaying initial paint by ~5 seconds. This was tested on https://www.formula1.com/en.html.
     11
     12        * contentextensions/ContentExtensionsBackend.cpp:
     13        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
     14
    1152019-07-11  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp

    r247186 r247361  
    238238            // Quirk for content-blocker interference with Google's anti-flicker optimization (rdar://problem/45968770).
    239239            // https://developers.google.com/optimize/
    240             if (currentDocument->settings().googleAntiFlickerOptimizationQuirkEnabled() && url == "https://www.google-analytics.com/analytics.js"_str) {
     240            if (currentDocument->settings().googleAntiFlickerOptimizationQuirkEnabled()
     241                && ((equalLettersIgnoringASCIICase(url.host(), "www.google-analytics.com") && equalLettersIgnoringASCIICase(url.path(), "/analytics.js"))
     242                    || (equalLettersIgnoringASCIICase(url.host(), "www.googletagmanager.com") && equalLettersIgnoringASCIICase(url.path(), "/gtm.js")))) {
    241243                if (auto* frame = currentDocument->frame())
    242244                    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 });
Note: See TracChangeset for help on using the changeset viewer.