From 3f04f64e43735ec361e39a735e6e0b88bcf4a02c Mon Sep 17 00:00:00 2001 From: brave-builds <45370463+brave-builds@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:26:10 +0100 Subject: [PATCH] fix(privacy): Shred intermittently not clearing all data (uplift to 1.72.x) (#26278) Uplift of #26246 (squashed) to beta --- ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift b/ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift index 6051d420c9ef..62902a5108e3 100644 --- a/ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift +++ b/ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift @@ -843,6 +843,10 @@ class TabManager: NSObject { // Remove all unwanted tabs for tab in allTabs { guard tab.url?.baseDomain == etldP1 else { continue } + // The Tab's WebView is not deinitialized immediately, so it's possible the + // WebView still stores data after we shred but before the WebView is deinitialized. + // Delete the web view to prevent data being stored after data is Shred. + tab.deleteWebView() removeTab(tab) }