From f8df32529b8134ba7283bbd97f7feff52ea95c26 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 7 Jul 2026 21:34:11 -0700 Subject: [PATCH] Use a WebKit user-agent string for web content (content displayed in web views) with NetNewsWire as the app name. --- Mac/MainWindow/Detail/DetailWebViewController.swift | 4 ---- Shared/Article Rendering/WebViewConfiguration.swift | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mac/MainWindow/Detail/DetailWebViewController.swift b/Mac/MainWindow/Detail/DetailWebViewController.swift index a0834c03f..9ca8a5a7c 100644 --- a/Mac/MainWindow/Detail/DetailWebViewController.swift +++ b/Mac/MainWindow/Detail/DetailWebViewController.swift @@ -9,7 +9,6 @@ import AppKit @preconcurrency import WebKit import RSCore -import RSWeb import Articles import Images @@ -96,9 +95,6 @@ final class DetailWebViewController: NSViewController { webView.navigationDelegate = self webView.keyboardDelegate = keyboardDelegate webView.translatesAutoresizingMaskIntoConstraints = false - if let userAgent = UserAgent.fromInfoPlist() { - webView.customUserAgent = userAgent - } view = webView diff --git a/Shared/Article Rendering/WebViewConfiguration.swift b/Shared/Article Rendering/WebViewConfiguration.swift index 36eef79e0..b2288652e 100644 --- a/Shared/Article Rendering/WebViewConfiguration.swift +++ b/Shared/Article Rendering/WebViewConfiguration.swift @@ -28,6 +28,10 @@ import WebKit configuration.setURLSchemeHandler(urlSchemeHandler, forURLScheme: ArticleRenderer.imageIconScheme) configuration.userContentController = userContentController + // Present article content as NetNewsWire on top of WebKit's default browser UA, rather than a non-browser string. + // + configuration.applicationNameForUserAgent = "NetNewsWire" + #if os(iOS) configuration.allowsInlineMediaPlayback = true #endif