add keepIframeSrcFn option (#592)

* rename allowIframe to keepIframeSrcFn

* update rrweb-snapshot to 1.1.5
This commit is contained in:
bachmanity1
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 35a5a4ff34
commit 059d492bea
4 changed files with 8 additions and 1 deletions

View File

@@ -59,6 +59,7 @@ function record<T = eventWithTime>(
recordCanvas = false,
collectFonts = false,
plugins,
keepIframeSrcFn = () => false,
} = options;
// runtime checks for user options
if (!emit) {
@@ -236,6 +237,7 @@ function record<T = eventWithTime>(
onIframeLoad: (iframe, childSn) => {
iframeManager.attachIframe(iframe, childSn);
},
keepIframeSrcFn,
});
if (!node) {

View File

@@ -220,6 +220,7 @@ export type recordOptions<T> = {
plugins?: RecordPlugin[];
// departed, please use sampling options
mousemoveWait?: number;
keepIframeSrcFn?: KeepIframeSrcFn;
};
export type observerParam = {
@@ -552,3 +553,5 @@ export type ElementState = {
// [scrollLeft,scrollTop]
scroll?: [number, number];
};
export type KeepIframeSrcFn = (src: string) => boolean;