Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private rebuildFullSnapshot(
event: fullSnapshotEvent & { timestamp: number },
) {
if (Object.keys(this.missingNodeRetryMap).length) {
console.warn(
'Found unresolved missing node map',
this.missingNodeRetryMap,
);
}
this.missingNodeRetryMap = {};
mirror.map = rebuild(event.data.node, this.iframe.contentDocument!)[1];
const styleEl = document.createElement('style');
const { documentElement, head } = this.iframe.contentDocument!;
documentElement!.insertBefore(styleEl, head);
const injectStylesRules = getInjectStyleRules(
this.config.blockClass,
).concat(this.config.insertStyleRules);
for (let idx = 0; idx < injectStylesRules.length; idx++) {
(styleEl.sheet! as CSSStyleSheet).insertRule(injectStylesRules[idx], idx);
}
this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded);
this.waitForStylesheetLoad();
}