diff --git a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift index b0bd9f43b5d8..1afead0187a1 100644 --- a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift +++ b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift @@ -3243,6 +3243,7 @@ extension BrowserViewController: TabManagerDelegate { updateFindInPageVisibility(isVisible: false, tab: previous) setupMiddleButtonStatus(isLoading: selected?.loading ?? false) + // [FXIOS-9785 Note #2] Back button can't be enabled unless the webView is already initialized if isToolbarRefactorEnabled { dispatchBackForwardToolbarAction(selected?.canGoBack, windowUUID, .backButtonStateChanged) dispatchBackForwardToolbarAction(selected?.canGoForward, windowUUID, .forwardButtonStateChanged) diff --git a/firefox-ios/Client/Frontend/Browser/TabScrollController.swift b/firefox-ios/Client/Frontend/Browser/TabScrollController.swift index 7fc9e4a9d251..4950c7d08efc 100644 --- a/firefox-ios/Client/Frontend/Browser/TabScrollController.swift +++ b/firefox-ios/Client/Frontend/Browser/TabScrollController.swift @@ -32,6 +32,7 @@ class TabScrollingController: NSObject, FeatureFlaggable, SearchBarLocationProvi didSet { self.scrollView?.addGestureRecognizer(panGesture) + // [FXIOS-9785 Note #3] Toolbar delegate can't be set unless the webView is already initialized scrollView?.delegate = self scrollView?.keyboardDismissMode = .onDrag configureRefreshControl(isEnabled: true) diff --git a/firefox-ios/Client/TabManagement/TabManagerImplementation.swift b/firefox-ios/Client/TabManagement/TabManagerImplementation.swift index a2d2cafc010f..2473996904fc 100644 --- a/firefox-ios/Client/TabManagement/TabManagerImplementation.swift +++ b/firefox-ios/Client/TabManagement/TabManagerImplementation.swift @@ -440,6 +440,22 @@ class TabManagerImplementation: LegacyTabManager, Notifiable, WindowSimpleTabsPr private func selectTabWithSession(tab: Tab, previous: Tab?, sessionData: Data?) { selectedTab?.createWebview(with: sessionData) selectedTab?.lastExecutedTime = Date.now() + + // [FXIOS-9785 Note 1] Workaround to resolve Aug 7, 2024 incident (PR #21486) + // NOTE: This needs more work because the change from PR #21328 fixed another issue, + // and thus couldn't be completely rolled back. + // However, now we are repeating this delegate notification which is less than ideal and may have unexpected + // consequences. + // See ticket for more information. + // Broadcast updates for any listeners + delegates.forEach { + $0.get()?.tabManager( + self, + didSelectedTabChange: tab, + previous: previous, + isRestoring: !tabRestoreHasFinished + ) + } } // MARK: - Screenshots