From 380819ca706aa2041d053511569dac46eade3bd0 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Sun, 29 Mar 2020 21:18:39 +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 + */ + } }); }