tolerate insertRule error since browser may throw Error on wrong prefix

This commit is contained in:
Yanzhen Yu
2020-03-29 21:18:39 +08:00
parent 6e38ae4735
commit 380819ca70

View File

@@ -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
*/
}
});
}