Resolves "New Tab" bug after web content process jettison

This commit is contained in:
2024-08-05 17:36:59 -07:00
parent 29057c8024
commit 69aa02e303
4 changed files with 32 additions and 9 deletions

View File

@@ -10,7 +10,11 @@ import WebKit
extension BrowserViewController: WKNavigationDelegate, WKUIDelegate
{
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
currentTab.loadError = nil
if let tab = tabController.tab(forWebView: webView) {
// We're alive!
tab.contentProcessTerminated = false
tab.loadError = nil
}
// Check to make sure we have connected to the web content process
if !currentTab.bridge.webContentProcessConnected {
@@ -120,6 +124,10 @@ extension BrowserViewController: WKNavigationDelegate, WKUIDelegate
}
}
func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
tabController.tab(forWebView: webView)?.contentProcessTerminated = true
}
// MARK: WKUIDelegate
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView?