One of the challenges I'm facing is with a modal that contains an Iframe utilizing Three.js to load a 3D Door. While this setup works smoothly on desktop, it encounters issues on mobile devices. When interacting with the Iframe on mobile, it either crashes or unexpectedly reloads the page upon closing the modal. In the case of Safari, the page reloads initially, but on the second reload, it crashes entirely.
Page Loading the Iframe
<iframe loading="lazy" id="door-viewer" src="<?= "{$site_url}/3d-spinner.php?sku={$unique_skus[0]}"; ?>" sandbox></iframe>
File that generates the iframe
... (Code for generating iframe)Main.js File
... (Code in main.js for initializing the 3D spinner)Despite thorough investigation, I haven't been able to identify any memory leaks causing these issues.