File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
packages/rrweb/src/record Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " rrweb " : patch
3+ ---
4+
5+ fix potential mem leaks by deleting unloaded iframes from crossOriginIframeMap
Original file line number Diff line number Diff line change @@ -77,12 +77,16 @@ export class IframeManager {
7777 } ) ;
7878
7979 // Receive messages (events) coming from cross-origin iframes that are nested in this same-origin iframe.
80- if ( this . recordCrossOriginIframes )
80+ if ( this . recordCrossOriginIframes ) {
8181 iframeEl . contentWindow ?. addEventListener (
8282 'message' ,
8383 this . handleMessage . bind ( this ) ,
8484 ) ;
8585
86+ iframeEl . contentWindow ?. addEventListener ( 'pagehide' , ( ) => {
87+ this . crossOriginIframeMap . delete ( iframeEl . contentWindow ! ) ;
88+ } ) ;
89+ }
8690 this . loadListener ?.( iframeEl ) ;
8791
8892 if (
You can’t perform that action at this time.
0 commit comments