Set userAgent on detail view webview. Fix #236.
This commit is contained in:
parent
0c176eccd0
commit
4e05f35f6d
|
@ -10,6 +10,7 @@ import Foundation
|
||||||
import WebKit
|
import WebKit
|
||||||
import RSCore
|
import RSCore
|
||||||
import Data
|
import Data
|
||||||
|
import RSWeb
|
||||||
|
|
||||||
class DetailViewController: NSViewController, WKNavigationDelegate, WKUIDelegate {
|
class DetailViewController: NSViewController, WKNavigationDelegate, WKUIDelegate {
|
||||||
|
|
||||||
|
@ -49,6 +50,10 @@ class DetailViewController: NSViewController, WKNavigationDelegate, WKUIDelegate
|
||||||
webview.uiDelegate = self
|
webview.uiDelegate = self
|
||||||
webview.navigationDelegate = self
|
webview.navigationDelegate = self
|
||||||
webview.translatesAutoresizingMaskIntoConstraints = false
|
webview.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
if let userAgent = UserAgent.fromInfoPlist() {
|
||||||
|
webview.customUserAgent = userAgent
|
||||||
|
}
|
||||||
|
|
||||||
let boxView = self.view as! DetailBox
|
let boxView = self.view as! DetailBox
|
||||||
boxView.contentView = webview
|
boxView.contentView = webview
|
||||||
boxView.rs_addFullSizeConstraints(forSubview: webview)
|
boxView.rs_addFullSizeConstraints(forSubview: webview)
|
||||||
|
|
Loading…
Reference in New Issue