From 67ef897454242633d4c40d153ae64ba78bda1e8e Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] tolerate insertRule error since browser may throw Error on wrong prefix --- src/replay/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/replay/index.ts b/src/replay/index.ts index bf25b535..078df866 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -630,7 +630,14 @@ export class Replayer { index === undefined ? undefined : Math.min(index, styleSheet.rules.length); - styleSheet.insertRule(rule, _index); + try { + styleSheet.insertRule(rule, _index); + } catch (e) { + /** + * sometimes we may capture rules with browser prefix + * insert rule with prefixs in other browsers may cause Error + */ + } }); }