diff --git a/src/snapshot.ts b/src/snapshot.ts index 77544656..2c0f67e4 100644 --- a/src/snapshot.ts +++ b/src/snapshot.ts @@ -208,7 +208,14 @@ function onceIframeLoaded( } // document is loading let fired = false; - if (win.document.readyState !== 'complete') { + + let readyState: DocumentReadyState; + try { + readyState = win.document.readyState; + } catch (error) { + return; + } + if (readyState !== 'complete') { const timer = setTimeout(() => { if (!fired) { listener();