Use custom user agent for web views

This commit is contained in:
Maurice Parker 2020-07-27 19:25:39 -05:00
parent 8656bffe18
commit 855907404e
1 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,7 @@
import Foundation
import WebKit
import RSWeb
class PreloadedWebView: WKWebView {
@ -28,6 +29,10 @@ class PreloadedWebView: WKWebView {
configuration.setURLSchemeHandler(articleIconSchemeHandler, forURLScheme: ArticleRenderer.imageIconScheme)
super.init(frame: .zero, configuration: configuration)
if let userAgent = UserAgent.fromInfoPlist() {
customUserAgent = userAgent
}
}
required init?(coder: NSCoder) {