Update: Append optional applicationNameForUserAgent to configrational applicationNameForUserAgent

This commit is contained in:
sunalwaysknows 2022-02-26 11:06:25 +08:00
parent f06bcdf695
commit d8d84053bc
1 changed files with 5 additions and 0 deletions

View File

@ -499,6 +499,11 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
} else if options.cacheEnabled { } else if options.cacheEnabled {
configuration.websiteDataStore = WKWebsiteDataStore.default() configuration.websiteDataStore = WKWebsiteDataStore.default()
} }
if !options.applicationNameForUserAgent.isEmpty {
if let applicationNameForUserAgent = configuration.applicationNameForUserAgent {
configuration.applicationNameForUserAgent = applicationNameForUserAgent + " " + options.applicationNameForUserAgent
}
}
} }
if #available(iOS 10.0, *) { if #available(iOS 10.0, *) {