cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject cordova-plugin-inappbrowser git commit: CB-10040 - re-fix: backwards compatible with cordova-ios < 4.0
Date Fri, 20 Nov 2015 18:53:43 GMT
Repository: cordova-plugin-inappbrowser
Updated Branches:
  refs/heads/master 9b576f303 -> 542536f79


CB-10040 - re-fix: backwards compatible with cordova-ios < 4.0


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/542536f7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/542536f7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/542536f7

Branch: refs/heads/master
Commit: 542536f7908a776ec49becb0bf40969ee4a48a82
Parents: 9b576f3
Author: Shazron Abdullah <shazron@apache.org>
Authored: Fri Nov 20 10:53:36 2015 -0800
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Fri Nov 20 10:53:36 2015 -0800

----------------------------------------------------------------------
 src/ios/CDVInAppBrowser.m | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/542536f7/src/ios/CDVInAppBrowser.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m
index 28b1bd9..72effaa 100644
--- a/src/ios/CDVInAppBrowser.m
+++ b/src/ios/CDVInAppBrowser.m
@@ -231,11 +231,18 @@
 
 - (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options
 {
-        NSURLRequest* request = [NSURLRequest requestWithURL:url];
+    NSURLRequest* request = [NSURLRequest requestWithURL:url];
+
 #ifdef __CORDOVA_4_0_0
-        [self.webViewEngine loadRequest:request];
+    // the webview engine itself will filter for this according to <allow-navigation>
policy
+    // in config.xml for cordova-ios-4.0
+    [self.webViewEngine loadRequest:request];
 #else
+    if ([self.commandDelegate URLIsWhitelisted:url]) {
         [self.webView loadRequest:request];
+    } else { // this assumes the InAppBrowser can be excepted from the white-list
+        [self openInInAppBrowser:url withOptions:options];
+    }
 #endif
 }
 


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


Mime
View raw message