From 337dba4e9f5d1398d4047b87aa0935f15ac39a58 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 14 Mar 2024 12:45:56 +0100 Subject: [PATCH] MOBILE-4521 iframe: Destroy iframe if setting an empty src In iOS, setting an empty src in an iframe sometimes causes the iframe to get 'stuck' in the empty page --- src/core/components/iframe/iframe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/components/iframe/iframe.ts b/src/core/components/iframe/iframe.ts index d1b1c08ea..58fd3f82a 100644 --- a/src/core/components/iframe/iframe.ts +++ b/src/core/components/iframe/iframe.ts @@ -216,7 +216,7 @@ export class CoreIframeComponent implements OnChanges, OnDestroy { await CoreIframeUtils.fixIframeCookies(url); } - this.safeUrl = DomSanitizer.bypassSecurityTrustResourceUrl(url ? CoreFile.convertFileSrc(url) : ''); + this.safeUrl = url ? DomSanitizer.bypassSecurityTrustResourceUrl(CoreFile.convertFileSrc(url)) : undefined; // Now that the URL has been set, initialize the iframe. Wait for the iframe to the added to the DOM. setTimeout(() => {