Merge pull request #1095 from sunalwaysknows/master
fix: ApplicationNameForUserAgent is not working in iOS
This commit is contained in:
commit
65e00b8d97
@ -407,9 +407,6 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
|
||||
if #available(iOS 9.0, *) {
|
||||
configuration.allowsAirPlayForMediaPlayback = options.allowsAirPlayForMediaPlayback
|
||||
configuration.allowsPictureInPictureMediaPlayback = options.allowsPictureInPictureMediaPlayback
|
||||
if !options.applicationNameForUserAgent.isEmpty {
|
||||
configuration.applicationNameForUserAgent = options.applicationNameForUserAgent
|
||||
}
|
||||
}
|
||||
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = options.javaScriptCanOpenWindowsAutomatically
|
||||
@ -501,6 +498,11 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
|
||||
} else if options.cacheEnabled {
|
||||
configuration.websiteDataStore = WKWebsiteDataStore.default()
|
||||
}
|
||||
if !options.applicationNameForUserAgent.isEmpty {
|
||||
if let applicationNameForUserAgent = configuration.applicationNameForUserAgent {
|
||||
configuration.applicationNameForUserAgent = applicationNameForUserAgent + " " + options.applicationNameForUserAgent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if #available(iOS 10.0, *) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user