From 4e05f35f6d9330fb541366118f39578f5615ff60 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 3 Dec 2017 12:13:44 -0800 Subject: [PATCH] Set userAgent on detail view webview. Fix #236. --- Evergreen/MainWindow/Detail/DetailViewController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Evergreen/MainWindow/Detail/DetailViewController.swift b/Evergreen/MainWindow/Detail/DetailViewController.swift index 8cd070f39..157320e54 100644 --- a/Evergreen/MainWindow/Detail/DetailViewController.swift +++ b/Evergreen/MainWindow/Detail/DetailViewController.swift @@ -10,6 +10,7 @@ import Foundation import WebKit import RSCore import Data +import RSWeb class DetailViewController: NSViewController, WKNavigationDelegate, WKUIDelegate { @@ -49,6 +50,10 @@ class DetailViewController: NSViewController, WKNavigationDelegate, WKUIDelegate webview.uiDelegate = self webview.navigationDelegate = self webview.translatesAutoresizingMaskIntoConstraints = false + if let userAgent = UserAgent.fromInfoPlist() { + webview.customUserAgent = userAgent + } + let boxView = self.view as! DetailBox boxView.contentView = webview boxView.rs_addFullSizeConstraints(forSubview: webview)