From 87ec1a160e2c1c04876899367d46665fc3389a50 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 13 Mar 2026 20:52:56 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20change=20for=20internal=20link=20navig?= =?UTF-8?q?ation,=20since=20it=20causes=20problems=20=E2=80=94=C2=A0the=20?= =?UTF-8?q?#fragment-linked=20section=20is=20frequently=20not=20included?= =?UTF-8?q?=20in=20the=20article=20in=20the=20feed,=20and=20the=20page=20r?= =?UTF-8?q?eally=20does=20need=20to=20open=20in=20browser.=20Reverts=20htt?= =?UTF-8?q?ps://github.com/Ranchero-Software/NetNewsWire/pull/5080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Detail/DetailWebViewController.swift | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Mac/MainWindow/Detail/DetailWebViewController.swift b/Mac/MainWindow/Detail/DetailWebViewController.swift index 2a68a7978..b002d48b6 100644 --- a/Mac/MainWindow/Detail/DetailWebViewController.swift +++ b/Mac/MainWindow/Detail/DetailWebViewController.swift @@ -200,23 +200,8 @@ extension DetailWebViewController: WKNavigationDelegate, WKUIDelegate { // WKNavigationDelegate - // Prevent user navigations within a page (for example, to elements with ids) from being dispatched to the browser - func isInternalPageNavigationAction(_ navigationAction: WKNavigationAction) -> Bool { - // If the origin and destination of the navigation have the same host and path, then - // the presence of a fragment should be considered "internal" to an article. - if let targetURL = navigationAction.request.url, - let fragment = targetURL.fragment, fragment.isEmpty == false, - let sourceURL = self.webView.url, - sourceURL.host == targetURL.host, - sourceURL.path == targetURL.path { - return true - } else { - return false - } - } - func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping @MainActor @Sendable (WKNavigationActionPolicy) -> Void) { - if navigationAction.navigationType == .linkActivated, !isInternalPageNavigationAction(navigationAction) { + if navigationAction.navigationType == .linkActivated { if let url = navigationAction.request.url { self.openInBrowser(url, flags: navigationAction.modifierFlags) }