add keepIframeSrcFn option (#592)

* rename allowIframe to keepIframeSrcFn

* update rrweb-snapshot to 1.1.5
This commit is contained in:
bachmanity1
2021-06-30 12:51:27 +09:00
committed by GitHub
parent b96e9e3632
commit dee0457ffe
4 changed files with 8 additions and 1 deletions

View File

@@ -66,6 +66,6 @@
"@xstate/fsm": "^1.4.0",
"fflate": "^0.4.4",
"mitt": "^1.1.3",
"rrweb-snapshot": "^1.1.4"
"rrweb-snapshot": "^1.1.5"
}
}

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;

2
typings/types.d.ts vendored
View File

@@ -147,6 +147,7 @@ export declare type recordOptions<T> = {
collectFonts?: boolean;
plugins?: RecordPlugin[];
mousemoveWait?: number;
keepIframeSrcFn?: KeepIframeSrcFn;
};
export declare type observerParam = {
mutationCb: mutationCallBack;
@@ -417,4 +418,5 @@ export declare type MaskTextFn = (text: string) => string;
export declare type ElementState = {
scroll?: [number, number];
};
export declare type KeepIframeSrcFn = (src: string) => boolean;
export {};