From 542536f7908a776ec49becb0bf40969ee4a48a82 Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Fri, 20 Nov 2015 10:53:36 -0800 Subject: [PATCH] CB-10040 - re-fix: backwards compatible with cordova-ios < 4.0 --- src/ios/CDVInAppBrowser.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 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 }