Skip to content

Commit

Permalink
sfusd.edu: Trying to load SFUSD School Finder sometimes fails
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267741
rdar://116292738

Reviewed by Brent Fulgham.

Trying to load the following link often fails in Safari (and Firefox), works fine in Chrome:
https://www.sfusd.edu/schools/enroll/discover/school-finder

We see the following error in the JS console:
```
[Error] ReferenceError: Can't find variable: google
	(anonymous function) (js_h2tB6IRXjTJGY_6Kj6g8zvcS1bzOjvsppQOjs7XaUWs.js:12:176)
```

This is caused by the google maps script being marked as async while one of the sync script
tries to access `window.google.maps`.

Add a quirk to ignore 'async' on scripts on sfusd.edu as a workaround while we reach out
to the site owners.

* Source/WebCore/page/Quirks.cpp:
(WebCore::Quirks::shouldBypassAsyncScriptDeferring const):

Canonical link: https://commits.webkit.org/273225@main
  • Loading branch information
cdumez committed Jan 19, 2024
1 parent 91061b4 commit 9c0f02f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/WebCore/page/Quirks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,8 @@ bool Quirks::shouldBypassBackForwardCache() const
return false;
}

// bungalow.com rdar://61658940
// bungalow.com: rdar://61658940
// sfusd.edu: rdar://116292738
bool Quirks::shouldBypassAsyncScriptDeferring() const
{
if (!needsQuirks())
Expand All @@ -966,7 +967,8 @@ bool Quirks::shouldBypassAsyncScriptDeferring() const
if (!m_shouldBypassAsyncScriptDeferring) {
auto domain = RegistrableDomain { m_document->topDocument().url() };
// Deferring 'mapbox-gl.js' script on bungalow.com causes the script to get in a bad state (rdar://problem/61658940).
m_shouldBypassAsyncScriptDeferring = (domain == "bungalow.com"_s);
// Deferring the google maps script on sfusd.edu may get the page in a bad state (rdar://116292738).
m_shouldBypassAsyncScriptDeferring = domain == "bungalow.com"_s || domain == "sfusd.edu"_s;
}
return *m_shouldBypassAsyncScriptDeferring;
}
Expand Down

0 comments on commit 9c0f02f

Please sign in to comment.