Skip to content

Commit

Permalink
Don't throw away information about the iframe src (#733)
Browse files Browse the repository at this point in the history
* Don't throw away information about the iframe src

* contentDocument is the important one as to whether we are recording an iframe directly
  • Loading branch information
eoghanmurray authored Oct 25, 2021
1 parent c021134 commit ad2ca9e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/rrweb-snapshot/src/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ad2ca9e

Please sign in to comment.