Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -950,20 +950,9 @@ export class Replayer {
const styleSheet: CSSStyleSheet = styleEl.sheet!;

if (d.adds) {
d.adds.forEach(({ rule, index }) => {
d.adds.forEach(({ rule }) => {
try {
const _index =
index === undefined
? undefined
: Math.min(index, styleSheet.rules.length);
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
*/
}
styleEl.textContent = styleEl.textContent?.concat("\n" + rule) ?? null;
} catch (e) {
/**
* accessing styleSheet rules may cause SecurityError
Expand Down