diff --git a/packages/rrweb/src/replay/index.ts b/packages/rrweb/src/replay/index.ts index 89aa66d933..03696f385b 100644 --- a/packages/rrweb/src/replay/index.ts +++ b/packages/rrweb/src/replay/index.ts @@ -869,6 +869,9 @@ export class Replayer { 'html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }', ); } + if (!injectStylesRules.length) { + return; + } if (this.usingVirtualDom) { const styleEl = this.virtualDom.createElement('style'); this.virtualDom.mirror.add(