From 18b8c0c95ddad598240878ee3e1908414bbd5f9a Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 18 Jan 2023 10:37:17 +0100 Subject: [PATCH] fix: Ignore errors in style observers --- packages/rrweb/src/record/observer.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/rrweb/src/record/observer.ts b/packages/rrweb/src/record/observer.ts index ad2e0b24e2..f740ebebf3 100644 --- a/packages/rrweb/src/record/observer.ts +++ b/packages/rrweb/src/record/observer.ts @@ -866,8 +866,12 @@ export function initObservers( viewportResizeHandler(); inputHandler(); mediaInteractionHandler(); - styleSheetObserver(); - styleDeclarationObserver(); + try { + styleSheetObserver(); + styleDeclarationObserver(); + } catch(e) { + // ignore errors in style observers + } fontObserver(); pluginHandlers.forEach((h) => h()); };