Bug 249329

Summary: Safari cannot load a website
Product: WebKit Reporter: Safwen <safwen.baroudi>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Blocker CC: ap, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
URL: https://disneycruise.disney.go.com
Attachments:
Description Flags
Screenshot of the network tab that shows that the browser is stuck loading a css file none

Description Safwen 2022-12-14 11:50:44 PST
Created attachment 464048 [details]
Screenshot of the network tab that shows that the browser is stuck loading a css file

Hello,

Here are the steps to reproduce:


1. Go to https://disneycruise.disney.go.com
2. Execute the following code in the console
window.addEventListener('pagehide', async () => {
    const r = await fetch(location.href);
    console.log(r);
});
3. Click on "Sign in or Create an Account", this is in the header close to the search bar on the top right.
This should open a new page "https://disneycruise.disney.go.com/en/login?appRedirect=%2F
but here the browser will start requesting the document of the page and few other resources but stays stuck
while requesting "https://cdn3.parksmedia.wdprapps.disney.com/media/profile-spa/1.6.0-184/styles.7e26e406cfcd02d2aa32.css".
After this, the browser refuses to load this URL "https://cdn3.parksmedia.wdprapps.disney.com/media/profile-spa/1.6.0-184/styles.7e26e406cfcd02d2aa32.css"
even in new tabs, even in new windows, accessing this URL makes the browser stuck loading it. And the only solution
is to close the browser and re-open to be able to access "https://cdn3.parksmedia.wdprapps.disney.com/media/profile-spa/1.6.0-184/styles.7e26e406cfcd02d2aa32.css" again.
Comment 1 Safwen 2022-12-14 12:01:35 PST
I suspect that this is caused by zonejs, Promise is overridden by zonejs and the following code fixes the issue:

var iframe = document.createElement('iframe');
document.body.prepend(iframe);
window.addEventListener('pagehide', async () => {
    const purePromise = iframe.contentWindow!.Promise;
    const overriddenPromise = window.Promise;
    window.Promise = purePromise; // this makes the promise returned by fetch pure in the sense it is not touched by zonejs
    const r = await fetch(location.href);
    console.log(r);
    window.Promise = overriddenPromise;
});
Comment 2 Alexey Proskuryakov 2022-12-18 14:51:01 PST
Thank you for the report! Could you please elaborate on what the user impact is, and why yo believe this to be a WebKit bug?
Comment 3 Radar WebKit Bug Importer 2022-12-21 11:51:27 PST
<rdar://problem/103608219>