You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/12/21 04:44:49 UTC

js commit: CB-4970 CB-5457 Switch default bridge mode to IFRAME_NAV for iOS != 5

Updated Branches:
  refs/heads/master cdb7c050e -> 7ed9e7186


CB-4970 CB-5457 Switch default bridge mode to IFRAME_NAV for iOS != 5

Suspect XHR bridge is sometimes shakey, so hopefully switching will
solidify things.


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/7ed9e718
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/7ed9e718
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/7ed9e718

Branch: refs/heads/master
Commit: 7ed9e7186dbb3a6aa7d45d4dbbe079a0727f1983
Parents: cdb7c05
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Dec 20 22:36:29 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Dec 20 22:44:16 2013 -0500

----------------------------------------------------------------------
 src/ios/exec.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/7ed9e718/src/ios/exec.js
----------------------------------------------------------------------
diff --git a/src/ios/exec.js b/src/ios/exec.js
index a52eddf..58ca079 100644
--- a/src/ios/exec.js
+++ b/src/ios/exec.js
@@ -130,12 +130,11 @@ function convertMessageToArgsNativeToJs(message) {
 }
 
 function iOSExec() {
-    // XHR mode does not work on iOS 4.2, so default to IFRAME_NAV for such devices.
-    // XHR mode's main advantage is working around a bug in -webkit-scroll, which
-    // doesn't exist in 4.X devices anyways.
+    // Use XHR for iOS 5 to work around a bug in -webkit-scroll.
+    // Use IFRAME_NAV elsewhere since it's faster and XHR bridge
+    // seems to have bugs in newer OS's (CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134)
     if (bridgeMode === undefined) {
-        bridgeMode = navigator.userAgent.indexOf(' 4_') == -1 ? jsToNativeModes.XHR_NO_PAYLOAD : jsToNativeModes.IFRAME_NAV;
-        bridgeMode = jsToNativeModes.XHR_NO_PAYLOAD;
+        bridgeMode = navigator.userAgent.indexOf(' 5_') == -1 ? jsToNativeModes.IFRAME_NAV: jsToNativeModes.XHR_NO_PAYLOAD;
     }
 
     var successCallback, failCallback, service, action, actionArgs, splitCommand;