Currently, I'm utilizing webgl to load a 3D model and running some code to manipulate it before displaying it.
The issue is that this process takes several seconds and completely restricts the user from performing any other tasks during that time. It's frustrating that even scrolling isn't possible while the operation is in progress. Although multithreading doesn't exist in JavaScript, I need to find a way to prevent the main thread from being blocked.
I attempted a technique where I loaded the model in an iframe and utilized window.postMessage along with a message event listener. However, it seems like the frame's domain operates on the same thread for its JavaScript, rendering that approach useless. Are there any alternative strategies for handling CPU-intensive code without halting the user's ability to interact?