diff --git a/DuckDuckGo/Tab/Model/Tab.swift b/DuckDuckGo/Tab/Model/Tab.swift index 5c1c11d1db..684540e635 100644 --- a/DuckDuckGo/Tab/Model/Tab.swift +++ b/DuckDuckGo/Tab/Model/Tab.swift @@ -984,9 +984,13 @@ protocol NewWindowPolicyDecisionMaker { @MainActor private func shouldReload(_ url: URL, shouldLoadInBackground: Bool) -> Bool { + var isNativeUI: Bool { + let content = TabContent.contentFromURL(url, source: .ui) + return !content.isUrl && content.urlForWebView != nil + } // don‘t reload in background unless shouldLoadInBackground guard url.isValid, - webView.superview != nil || shouldLoadInBackground, + webView.superview != nil || shouldLoadInBackground || isNativeUI, // don‘t reload when already loaded webView.url != url || error != nil else { return false } diff --git a/DuckDuckGo/Tab/View/BrowserTabViewController.swift b/DuckDuckGo/Tab/View/BrowserTabViewController.swift index 69a680f172..6e88867376 100644 --- a/DuckDuckGo/Tab/View/BrowserTabViewController.swift +++ b/DuckDuckGo/Tab/View/BrowserTabViewController.swift @@ -507,13 +507,16 @@ final class BrowserTabViewController: NSViewController { addAndLayoutChild(bookmarksViewControllerCreatingIfNeeded()) case let .settings(pane): - removeAllTabContent() let preferencesViewController = preferencesViewControllerCreatingIfNeeded() + if preferencesViewController.parent !== self { + removeAllTabContent() + } if let pane = pane, preferencesViewController.model.selectedPane != pane { preferencesViewController.model.selectPane(pane) } - addAndLayoutChild(preferencesViewController) - + if preferencesViewController.parent !== self { + addAndLayoutChild(preferencesViewController) + } case .onboarding: removeAllTabContent() if !OnboardingViewModel.isOnboardingFinished {