cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject cordova-plugin-wkwebview-engine git commit: CB-10269: Replace cordova exec only when present in wkwebview
Date Tue, 02 Feb 2016 23:54:17 GMT
Repository: cordova-plugin-wkwebview-engine
Updated Branches:
  refs/heads/master 1bc5766b4 -> faa9d8770


CB-10269: Replace cordova exec only when present in 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/faa9d877
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/tree/faa9d877
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/diff/faa9d877

Branch: refs/heads/master
Commit: faa9d877045d8baf8afdfd0d8689389ec240e2e4
Parents: 1bc5766
Author: James Andersen <james.andersen@universalmind.com>
Authored: Thu Jan 14 21:02:42 2016 -0500
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Tue Feb 2 15:53:56 2016 -0800

----------------------------------------------------------------------
 src/www/ios/ios-wkwebview-exec.js | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/blob/faa9d877/src/www/ios/ios-wkwebview-exec.js
----------------------------------------------------------------------
diff --git a/src/www/ios/ios-wkwebview-exec.js b/src/www/ios/ios-wkwebview-exec.js
index cdefaf0..01b5929 100644
--- a/src/www/ios/ios-wkwebview-exec.js
+++ b/src/www/ios/ios-wkwebview-exec.js
@@ -171,10 +171,11 @@ execProxy.nativeCallback = function() {
 
 module.exports = execProxy;
 
-
-// unregister the old bridge
-cordova.define.remove('cordova/exec');
-// redefine bridge to our new bridge
-cordova.define("cordova/exec", function(require, exports, module) {
-    module.exports = execProxy;
-});
+if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova
&& window.webkit.messageHandlers.cordova.postMessage) {
+   // unregister the old bridge
+   cordova.define.remove('cordova/exec');
+   // redefine bridge to our new bridge
+   cordova.define("cordova/exec", function(require, exports, module) {
+      module.exports = execProxy;
+   });
+}
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message