Recover from WebKit content-process termination — refresh the preloaded web view pool on foreground, and never render into a web view whose process died. Fixes #5310.

This commit is contained in:
Brent Simmons committed 2026-07-26 11:29:04 -07:00
1 parent 7e5e630a4b
commit e99f23d07e
2 files changed
+18 -1

No files matched your search

+8 -1
View File
@@ -37,6 +37,8 @@ final class WebViewController: UIViewController {
return view.subviews[0] as? PreloadedWebView
}
private var webViewProcessDidTerminate = false
private lazy var contextMenuInteraction = UIContextMenuInteraction(delegate: self)
private var isFullScreenAvailable: Bool {
return AppDefaults.shared.articleFullscreenAvailable && traitCollection.userInterfaceIdiom == .phone
@@ -454,6 +456,7 @@ extension WebViewController: WKNavigationDelegate {
}
func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
webViewProcessDidTerminate = true
fullReload()
}
@@ -554,11 +557,15 @@ private extension WebViewController {
func loadWebView(replaceExistingWebView: Bool = false) {
guard isViewLoaded else { return }
if !replaceExistingWebView, let webView = webView {
// Never render into a web view whose content process died — the load
// can fail silently, leaving the article view blank.
if !replaceExistingWebView, !webViewProcessDidTerminate, let webView = webView {
self.renderPage(webView)
return
}
webViewProcessDidTerminate = false
coordinator.webViewProvider.dequeueWebView { webView in
webView.ready {