We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebf339f commit 70e8d7fCopy full SHA for 70e8d7f
src/dom/document-cloner.ts
@@ -489,6 +489,16 @@ export class DocumentCloner {
489
}
490
491
static destroy(container: HTMLIFrameElement): boolean {
492
+ // cleanup iframe first to prevent memory leaks, see #1609
493
+ try {
494
+ const iframe = container.contentWindow;
495
+ container.src = 'about:blank';
496
+ if (iframe) {
497
+ iframe.document.write('');
498
+ iframe.document.clear();
499
+ iframe.close();
500
+ }
501
+ } catch {}
502
if (container.parentNode) {
503
container.parentNode.removeChild(container);
504
return true;
0 commit comments