Use custom user agent for web views
This commit is contained in:
parent
8656bffe18
commit
855907404e
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import WebKit
|
import WebKit
|
||||||
|
import RSWeb
|
||||||
|
|
||||||
class PreloadedWebView: WKWebView {
|
class PreloadedWebView: WKWebView {
|
||||||
|
|
||||||
@ -28,6 +29,10 @@ class PreloadedWebView: WKWebView {
|
|||||||
configuration.setURLSchemeHandler(articleIconSchemeHandler, forURLScheme: ArticleRenderer.imageIconScheme)
|
configuration.setURLSchemeHandler(articleIconSchemeHandler, forURLScheme: ArticleRenderer.imageIconScheme)
|
||||||
|
|
||||||
super.init(frame: .zero, configuration: configuration)
|
super.init(frame: .zero, configuration: configuration)
|
||||||
|
|
||||||
|
if let userAgent = UserAgent.fromInfoPlist() {
|
||||||
|
customUserAgent = userAgent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user