Skip to content

Commit 44e92cb

Browse files
authored
Handle errors when observing iframes (#1058)
1 parent 36b44e1 commit 44e92cb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/rrweb/src/record/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,12 @@ function record<T = eventWithTime>(
565565
};
566566

567567
iframeManager.addLoadListener((iframeEl) => {
568-
handlers.push(observe(iframeEl.contentDocument!));
568+
try {
569+
handlers.push(observe(iframeEl.contentDocument!));
570+
} catch (error) {
571+
// TODO: handle internal error
572+
console.warn(error);
573+
}
569574
});
570575

571576
const init = () => {

0 commit comments

Comments
 (0)