From 24e6a1feeb521b53a2f773b8ebff61bed1ecc6ce Mon Sep 17 00:00:00 2001 From: Sidney Bofah Date: Mon, 27 Jan 2014 00:11:21 +0100 Subject: [PATCH 1/7] Removed some iOS6 Deprecations --- src/ios/CDVInAppBrowser.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m index a660ac2..213cb73 100644 --- a/src/ios/CDVInAppBrowser.m +++ b/src/ios/CDVInAppBrowser.m @@ -510,14 +510,14 @@ self.addressLabel.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}"); self.addressLabel.enabled = YES; self.addressLabel.hidden = NO; - self.addressLabel.lineBreakMode = UILineBreakModeTailTruncation; - self.addressLabel.minimumFontSize = 10.000; + self.addressLabel.lineBreakMode = NSLineBreakByTruncatingTail; + self.addressLabel.minimumScaleFactor = 10.000; self.addressLabel.multipleTouchEnabled = NO; self.addressLabel.numberOfLines = 1; self.addressLabel.opaque = NO; self.addressLabel.shadowOffset = CGSizeMake(0.0, -1.0); self.addressLabel.text = NSLocalizedString(@"Loading...", nil); - self.addressLabel.textAlignment = UITextAlignmentLeft; + self.addressLabel.textAlignment = NSTextAlignmentLeft; self.addressLabel.textColor = [UIColor colorWithWhite:1.000 alpha:1.000]; self.addressLabel.userInteractionEnabled = NO; From 4c07917c0acd8220870ed3686ec3956657d638c9 Mon Sep 17 00:00:00 2001 From: Steven Gill Date: Wed, 5 Feb 2014 17:53:59 -0800 Subject: [PATCH 2/7] CB-5980 Updated version and RELEASENOTES.md for release 0.3.1 --- RELEASENOTES.md | 9 +++++++++ plugin.xml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ac7b46d..2b95181 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -64,3 +64,12 @@ * Apply CB-5193 to InAppBrowser (Fix DB quota exception) * CB-5593 iOS: Make InAppBrowser localizable * CB-5591 Change window.escape to encodeURIComponent + +### 0.3.1 (Feb 05, 2014) +* CB-5756: Android: Use WebView.evaluateJavascript for script injection on Android 4.4+ +* Didn't test on ICS or lower, getDrawable isn't supported until Jellybean +* add ubuntu platform +* Adding drawables to the inAppBrowser. This doesn't look quite right, but it's a HUGE improvement over the previous settings +* CB-5756: Android: Use WebView.evaluateJavascript for script injection on Android 4.4+ +* Remove alive from InAppBrowser.js since it didn't catch the case where the browser is closed by the user. +* CB-5733 Fix IAB.close() not working if called before show() animation is done diff --git a/plugin.xml b/plugin.xml index 9736604..0878073 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="0.3.1"> InAppBrowser Cordova InAppBrowser Plugin From cd31b3a64dcfe3aa629a56539d5e162dad5251fc Mon Sep 17 00:00:00 2001 From: Steven Gill Date: Wed, 5 Feb 2014 18:13:30 -0800 Subject: [PATCH 3/7] CB-5980 Incremented plugin version on dev branch. --- plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index 0878073..9ff4add 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="0.3.2-dev"> InAppBrowser Cordova InAppBrowser Plugin From 39e64c988afb38a081fae7e3d71d18424a3cfbf4 Mon Sep 17 00:00:00 2001 From: Bryan Higgins Date: Thu, 13 Feb 2014 15:00:18 -0500 Subject: [PATCH 4/7] CB-6035 - Move js-module so it is not loaded on unsupported platforms BlackBerry 10 has a native implementation which does not require the plugin. --- plugin.xml | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/plugin.xml b/plugin.xml index 9ff4add..57396a7 100644 --- a/plugin.xml +++ b/plugin.xml @@ -14,13 +14,12 @@ - - - - - + + + + @@ -50,6 +49,9 @@ + + + @@ -62,6 +64,9 @@ + + + @@ -69,7 +74,10 @@ - + + + + @@ -82,15 +90,11 @@ - - + + + @@ -102,6 +106,9 @@ + + + @@ -113,6 +120,9 @@ + + + From 26702cb0720c5c394b407c23570136c53171fa55 Mon Sep 17 00:00:00 2001 From: Ian Clelland Date: Wed, 19 Feb 2014 00:26:19 -0500 Subject: [PATCH 5/7] Validate that callbackId is correctly formed --- src/ios/CDVInAppBrowser.h | 1 + src/ios/CDVInAppBrowser.m | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/ios/CDVInAppBrowser.h b/src/ios/CDVInAppBrowser.h index 581bcd0..8e2ab12 100644 --- a/src/ios/CDVInAppBrowser.h +++ b/src/ios/CDVInAppBrowser.h @@ -30,6 +30,7 @@ @property (nonatomic, retain) CDVInAppBrowserViewController* inAppBrowserViewController; @property (nonatomic, copy) NSString* callbackId; +@property (nonatomic, copy) NSRegularExpression *callbackIdPattern; - (void)open:(CDVInvokedUrlCommand*)command; - (void)close:(CDVInvokedUrlCommand*)command; diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m index 213cb73..88b737c 100644 --- a/src/ios/CDVInAppBrowser.m +++ b/src/ios/CDVInAppBrowser.m @@ -47,6 +47,7 @@ self = [super initWithWebView:theWebView]; if (self != nil) { _previousStatusBarStyle = -1; + _callbackIdPattern = nil; } return self; @@ -297,6 +298,23 @@ [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper]; } +- (BOOL)isValidCallbackId:(NSString *)callbackId +{ + NSError *err = nil; + // Initialize on first use + if (self.callbackIdPattern == nil) { + self.callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"^InAppBrowser[0-9]{1,10}$" options:0 error:&err]; + if (err != nil) { + // Couldn't initialize Regex; No is safer than Yes. + return NO; + } + } + if ([self.callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) { + return YES; + } + return NO; +} + /** * The iframe bridge provided for the InAppBrowser is capable of executing any oustanding callback belonging * to the InAppBrowser plugin. Care has been taken that other callbacks cannot be triggered, and that no @@ -323,7 +341,7 @@ NSString* scriptCallbackId = [url host]; CDVPluginResult* pluginResult = nil; - if ([scriptCallbackId hasPrefix:@"InAppBrowser"]) { + if ([self isValidCallbackId:scriptCallbackId]) { NSString* scriptResult = [url path]; NSError* __autoreleasing error = nil; From 77085aa5477fd91d89a8c92ffedddc04463ba0e2 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Thu, 27 Feb 2014 11:56:29 -0500 Subject: [PATCH 6/7] CB-6114 Updated version and RELEASENOTES.md for release 0.3.2 --- RELEASENOTES.md | 5 +++++ plugin.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 2b95181..293e125 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -73,3 +73,8 @@ * CB-5756: Android: Use WebView.evaluateJavascript for script injection on Android 4.4+ * Remove alive from InAppBrowser.js since it didn't catch the case where the browser is closed by the user. * CB-5733 Fix IAB.close() not working if called before show() animation is done + +### 0.3.2 (Feb 26, 2014) +* Validate that callbackId is correctly formed +* CB-6035 Move js-module so it is not loaded on unsupported platforms +* Removed some iOS6 Deprecations diff --git a/plugin.xml b/plugin.xml index 57396a7..77adc5c 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="0.3.2"> InAppBrowser Cordova InAppBrowser Plugin From 4d3c7b17d27144aab650abd0f17981d5a2ca8a71 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Thu, 27 Feb 2014 15:45:10 -0500 Subject: [PATCH 7/7] Add NOTICE file --- NOTICE | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index 4d37500..8ec56a5 100644 --- a/NOTICE +++ b/NOTICE @@ -1 +1,5 @@ -Icons used in ths plugin are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. +Apache Cordova +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/).