Safari 15.4 window.open freezes both parent and child tabs

Hello

Safari 15.4 window.open freezes both parent and child tabs

Made a github page where you can reproduce the bug:
https://swanty.github.io/pdfjs-safari/broken.html

It happens only when special conditions are met:

  1. The broken.html page loads Stripe v3 js file (important for the freeze)

  2. Upon clicking CLICK ME the code executes window.open().location = '...';, thus both parent and child tabs are linked together in the same process

  3. The second page opens the latest release of mozilla pdf.js that loads .pdf that contains only 1 image (the image is important for the freeze)

    Image is simply 3000x3000 PNG, 1 color, 1.2 kB file created with photopea, nothing special, except the resolution.
    PDF I created by dragging the .png into Chrome and clicking Print -> Save as pdf, also nothing special, just a regular pdf.

On our production web if I navigate pages in same tab and at any point that stripe JS is loaded and then I navigate to a different page where window.open().location = '...' opens that pdf.js + .pdf file with special image then both tabs freeze.
It doesn't matter how many times I navigate the pages (in same tab), it seems that once the stripe js is loaded, it lingers in the tab memory somewhere and causes the freeze.

I would really appreciate it if someone from the Safari developer team could take a look at this and help find a solution :)

Thank you

Answered by BartCorremans in 713871022

Hi, our team is running into the same issue in our web application.

There are a number of instances where we spawn a new window with window.open.

For a certain feature, we have a canvas in both the parent and child window. For the child, we open an empty window initially and later append the canvas element to the new window from the parent script. This is where the freezing seems to occur, albeit not 100% of the time.

For another feature that does not require parent-child communication, the issue is not always reproducible - it only occurs sometimes while opening or closing the newly opened tabs. These tabs are displaying pdf files, using the native pdf viewer. In these situations, we can work around the problem by using the noopener windowFeature parameter.

These issues occur on both Intel and M1 machines.


Edit: This appears to be resolved in Technology Preview, however there are also other issues related to canvas rendering in this version.

Probably related bug: https://bugs.webkit.org/show_bug.cgi?id=238865

Thanks, @Swanty.

I found the same exact problem. This is very critical!!! and just happen in Safari 15.4!! both in MacOS and iOS!!!

Things used to work, now whole pages frozen without errors. It freezes the whole Safari both the parent and child tabs. I tried to find which JS triggering it but can't find it because no error at all.

!!! Please someone from Safari team help fix it ASAP !!! Please.... This problem fails the whole of our web application, and if no patch from Safari team for it, we will need to tell all our customers that they can't use Safari at all.

Please someone from Safari team, please help!!! please

Accepted Answer

Hi, our team is running into the same issue in our web application.

There are a number of instances where we spawn a new window with window.open.

For a certain feature, we have a canvas in both the parent and child window. For the child, we open an empty window initially and later append the canvas element to the new window from the parent script. This is where the freezing seems to occur, albeit not 100% of the time.

For another feature that does not require parent-child communication, the issue is not always reproducible - it only occurs sometimes while opening or closing the newly opened tabs. These tabs are displaying pdf files, using the native pdf viewer. In these situations, we can work around the problem by using the noopener windowFeature parameter.

These issues occur on both Intel and M1 machines.


Edit: This appears to be resolved in Technology Preview, however there are also other issues related to canvas rendering in this version.

Probably related bug: https://bugs.webkit.org/show_bug.cgi?id=238865

Safari 15.4 window.open freezes both parent and child tabs
 
 
Q