Skip to content

Commit

Permalink
Handle errors when observing iframes (rrweb-io#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea authored and billyvg committed Jan 10, 2023
1 parent e110660 commit 5c71024
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 @@ -454,7 +454,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 5c71024

Please sign in to comment.