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
2021-10-25 17:04:44 +01:00
committed by GitHub
parent c021134ae0
commit ad2ca9ee55

View File

@@ -509,7 +509,12 @@ function serializeNode(
}
// iframe
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 {
type: NodeType.Element,