Skip to content

Commit

Permalink
Handle errors when observing iframes (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea authored Jan 9, 2023
1 parent 36b44e1 commit 44e92cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/rrweb/src/record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,12 @@ function record<T = eventWithTime>(
};

iframeManager.addLoadListener((iframeEl) => {
handlers.push(observe(iframeEl.contentDocument!));
try {
handlers.push(observe(iframeEl.contentDocument!));
} catch (error) {
// TODO: handle internal error
console.warn(error);
}
});

const init = () => {
Expand Down

0 comments on commit 44e92cb

Please sign in to comment.