Revert fragile content loading monitoring.

This commit is contained in:
Brent Simmons committed 2026-07-06 10:19:35 -07:00
1 parent f24989235b
commit 1665d2a055
1 file changed
+1 -19
+1 -19
View File
@@ -45,12 +45,6 @@ final class WebViewController: UIViewController {
private lazy var transition = ImageTransition(controller: self)
private var clickedImageCompletion: (() -> Void)?
// True from just before we load our own article HTML until that load's navigation is
// decided. Any other main-frame navigation is a page script trying to replace the
// article (e.g. `<script>location.href=…</script>`) and is cancelled.
// <https://github.com/Ranchero-Software/NetNewsWire/issues/4150>
private var contentLoadPending = false
private var articleExtractor: ArticleExtractor?
var extractedArticle: ExtractedArticle? {
didSet {
@@ -455,17 +449,6 @@ extension WebViewController: WKNavigationDelegate {
decisionHandler(.allow)
}
} else {
// Allow our own content load and subframe (iframe) content, but don't let a page
// script navigate the main frame away from the article.
// <https://github.com/Ranchero-Software/NetNewsWire/issues/4150>
if navigationAction.targetFrame?.isMainFrame == true {
if contentLoadPending {
contentLoadPending = false
} else {
decisionHandler(.cancel)
return
}
}
decisionHandler(.allow)
}
}
@@ -662,8 +645,7 @@ private extension WebViewController {
// print("article.html written to \(fileURL.path)")
WebViewConfiguration.addContentBlockingRules(to: webView)
contentLoadPending = true
webView.loadHTMLString(html, baseURL: ArticleRenderer.page.baseURL)
webView.loadHTMLString(html, baseURL: URL(string: rendering.baseURL))
}
func finalScrollPosition(scrollingUp: Bool) -> CGFloat {