Don't throw away information about the iframe src (#733)

* Don't throw away information about the iframe src

* contentDocument is the important one as to whether we are recording an iframe directly
This commit is contained in:
Eoghan Murray
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 9d9c9629e3
commit f482109db3

View File

@@ -509,7 +509,12 @@ function serializeNode(
} }
// iframe // iframe
if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src as string)) { if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src as string)) {
delete attributes.src; if (!(n as HTMLIFrameElement).contentDocument) {
// we can't record it directly as we can't see into it
// preserve the src attribute so a decision can be taken at replay time
attributes.rr_src = attributes.src;
}
delete attributes.src; // prevent auto loading
} }
return { return {
type: NodeType.Element, type: NodeType.Element,