WebGL context reset when rendering 3D canvas inside iframe on external web portal

Hey everyone,
I am currently facing a weird WebGL context drop and cross-origin iframe rendering issue in a web project. I am attempting to embed a lightweight 3D canvas viewer inside an iframe wrapper hosted on an external billing portal page. However, whenever the wrapper frame initializes and attempts to request dynamic assets from this website, the Three.js renderer suddenly drops the WebGL context, throwing a WebGL: INVALID_OPERATION or cross-origin frame access error in the console. I initially suspected misconfigured CORS headers on the parent frame or memory leaks within my animation loop, so I tried disposing of geometries and materials explicitly, setting crossOrigin to anonymous on textures, and relaxing frame security policies, but the canvas still crashes or turns completely black upon dynamic content loads. Has anyone experienced similar canvas context losses or frame-sync issues when embedding interactive Three.js scenes across cross-domain web portals, and is there a recommended lifecycle pattern to gracefully handle WebGL context restoration inside dynamic DOM containers? Any suggestions or technical guidance would be greatly appreciated.