You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2016/12/05 22:52:46 UTC
[2/2] cordova-plugin-wkwebview-engine git commit: CB-10228:(iOS)
AppendUserAgent not working with WKWebView
CB-10228:(iOS) AppendUserAgent not working with WKWebView
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/commit/bf24bb63
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/tree/bf24bb63
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/diff/bf24bb63
Branch: refs/heads/master
Commit: bf24bb63416a7961196a1ba70023c5ebdad5c955
Parents: d5591de
Author: kelvinho <ke...@igloohome.co>
Authored: Tue Nov 29 17:20:02 2016 +0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Dec 5 14:52:33 2016 -0800
----------------------------------------------------------------------
src/ios/CDVWKWebViewEngine.m | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/blob/bf24bb63/src/ios/CDVWKWebViewEngine.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVWKWebViewEngine.m b/src/ios/CDVWKWebViewEngine.m
index e43c7ba..5d361c5 100644
--- a/src/ios/CDVWKWebViewEngine.m
+++ b/src/ios/CDVWKWebViewEngine.m
@@ -99,6 +99,10 @@
wkWebView.UIDelegate = self.uiDelegate;
self.engineWebView = wkWebView;
+ if ([self.viewController isKindOfClass:[CDVViewController class]]) {
+ wkWebView.customUserAgent = ((CDVViewController*) self.viewController).userAgent;
+ }
+
if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
wkWebView.UIDelegate = (id <WKUIDelegate>)self.viewController;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org