hide iframe before first meta event

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 6ba84ee5d0
commit 867ba85049
2 changed files with 4 additions and 0 deletions

View File

@@ -296,6 +296,8 @@ export class Replayer {
if (this.config.UNSAFE_replayCanvas) {
attributes.push('allow-scripts');
}
// hide iframe before first meta event
this.iframe.style.display = 'none';
this.iframe.setAttribute('sandbox', attributes.join(' '));
this.disableInteract();
this.wrapper.appendChild(this.iframe);
@@ -308,6 +310,7 @@ export class Replayer {
}
private handleResize(dimension: viewportResizeDimention) {
this.iframe.style.display = 'inherit';
this.iframe.setAttribute('width', String(dimension.width));
this.iframe.setAttribute('height', String(dimension.height));
}

1
typings/replay/smoothscroll.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
export declare function polyfill(w?: Window, d?: Document): void;