Skip to content

Commit

Permalink
Handle errors when observing iframes
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Nov 25, 2022
1 parent a220835 commit 71972e7
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 71972e7

Please sign in to comment.