You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/11/16 13:46:47 UTC
cordova-plugin-whitelist git commit: CB-9972 - Remove iOS whitelist
Repository: cordova-plugin-whitelist
Updated Branches:
refs/heads/master 3582b2cab -> ae544c574
CB-9972 - Remove iOS whitelist
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/commit/ae544c57
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/tree/ae544c57
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/diff/ae544c57
Branch: refs/heads/master
Commit: ae544c574e43ea63b1006a31e7bbee22b910d13c
Parents: 3582b2c
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Nov 11 16:08:19 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Nov 11 16:08:19 2015 -0800
----------------------------------------------------------------------
README.md | 1 -
package.json | 10 +---
plugin.xml | 17 +-----
src/ios/CDVWhitelistPlugin.h | 30 -----------
src/ios/CDVWhitelistPlugin.m | 110 --------------------------------------
5 files changed, 3 insertions(+), 165 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/blob/ae544c57/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 86a9e62..e846991 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,6 @@ This plugin implements a whitelist policy for navigating the application webview
## Supported Cordova Platforms
* Android 4.0.0 or above
-* iOS 4.0.0 or above
## Navigation Whitelist
Controls which URLs the WebView itself can be navigated to. Applies to
http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/blob/ae544c57/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2c20ea2..2bc7e70 100644
--- a/package.json
+++ b/package.json
@@ -4,8 +4,7 @@
"description": "Cordova Whitelist Plugin",
"cordova": {
"platforms": [
- "android",
- "ios"
+ "android"
]
},
"repository": {
@@ -16,17 +15,12 @@
"cordova",
"whitelist",
"ecosystem:cordova",
- "cordova-android",
- "cordova-ios"
+ "cordova-android"
],
"engines": [
{
"name": "cordova-android",
"version": ">=4.0.0-dev"
- },
- {
- "name": "cordova-ios",
- "version": ">=4.0.0-dev"
}
],
"author": "Apache Software Foundation",
http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/blob/ae544c57/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 3d85081..8a491a4 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -45,24 +45,9 @@
<runs />
</js-module>
</platform>
-
- <platform name="ios">
- <config-file target="config.xml" parent="/*">
- <feature name="Whitelist">
- <param name="ios-package" value="CDVWhitelistPlugin" />
- <param name="onload" value="true" />
- </feature>
- </config-file>
- <header-file src="src/ios/CDVWhitelistPlugin.h" />
- <source-file src="src/ios/CDVWhitelistPlugin.m" />
-
- <js-module src="whitelist.js" name="whitelist">
- <runs />
- </js-module>
- </platform>
<info>
-This plugin is only applicable for versions of cordova-ios and cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
+This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
</info>
</plugin>
http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/blob/ae544c57/src/ios/CDVWhitelistPlugin.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVWhitelistPlugin.h b/src/ios/CDVWhitelistPlugin.h
deleted file mode 100644
index b91409c..0000000
--- a/src/ios/CDVWhitelistPlugin.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import <Cordova/CDVPlugin.h>
-#import <Cordova/CDVWhitelist.h>
-#import <Cordova/CDVURLRequestFilter.h>
-
-@interface CDVWhitelistPlugin : CDVPlugin <CDVURLRequestFilter>{}
-
-@property (nonatomic, readonly, strong) CDVWhitelist* navigationWhitelist; // readonly for public
-@property (nonatomic, readonly, strong) CDVWhitelist* accessWhitelist; // readonly for public
-
-@end
http://git-wip-us.apache.org/repos/asf/cordova-plugin-whitelist/blob/ae544c57/src/ios/CDVWhitelistPlugin.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVWhitelistPlugin.m b/src/ios/CDVWhitelistPlugin.m
deleted file mode 100644
index c90088f..0000000
--- a/src/ios/CDVWhitelistPlugin.m
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVWhitelistPlugin.h"
-#import <Cordova/CDVViewController.h>
-
-#pragma mark CDVWhitelistConfigParser
-
-@interface CDVWhitelistConfigParser : NSObject <NSXMLParserDelegate> {}
-
-@property (nonatomic, strong) NSMutableArray* navigationWhitelistHosts;
-@property (nonatomic, strong) NSMutableArray* accessWhitelistHosts;
-@property (nonatomic, strong) NSArray* defaultHosts;
-
-@end
-
-@implementation CDVWhitelistConfigParser
-
-@synthesize navigationWhitelistHosts, accessWhitelistHosts;
-
-- (id)init
-{
- self = [super init];
- if (self != nil) {
- self.defaultHosts = @[
- @"file:///*",
- @"content:///*",
- @"data:///*"
- ];
-
- self.navigationWhitelistHosts = [[NSMutableArray alloc] initWithArray:self.defaultHosts];
- self.accessWhitelistHosts = [[NSMutableArray alloc] initWithArray:self.defaultHosts];
- }
- return self;
-}
-
-- (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict
-{
- if ([elementName isEqualToString:@"allow-navigation"]) {
- [navigationWhitelistHosts addObject:attributeDict[@"href"]];
- }
- else if ([elementName isEqualToString:@"access"]) {
- [accessWhitelistHosts addObject:attributeDict[@"origin"]];
- }
-}
-
-- (void)parser:(NSXMLParser*)parser didEndElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName
-{
-}
-
-- (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError
-{
- NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]);
-}
-
-
-@end
-
-#pragma mark CDVWhitelistPlugin
-
-@interface CDVWhitelistPlugin () {}
-@property (nonatomic, strong) CDVWhitelist* navigationWhitelist;
-@property (nonatomic, strong) CDVWhitelist* accessWhitelist;
-@end
-
-@implementation CDVWhitelistPlugin
-
-@synthesize navigationWhitelist, accessWhitelist;
-
-- (void)setViewController:(UIViewController *)viewController
-{
- if ([viewController isKindOfClass:[CDVViewController class]]) {
- CDVWhitelistConfigParser *whitelistConfigParser = [[CDVWhitelistConfigParser alloc] init];
- [(CDVViewController *)viewController parseSettingsWithParser:whitelistConfigParser];
- self.navigationWhitelist = [[CDVWhitelist alloc] initWithArray:whitelistConfigParser.navigationWhitelistHosts];
- // if no access tags set, default to * (https://issues.apache.org/jira/browse/CB-9568)
- if ([whitelistConfigParser.accessWhitelistHosts isEqualToArray:whitelistConfigParser.defaultHosts]) {
- [whitelistConfigParser.accessWhitelistHosts addObject:@"*"];
- }
- self.accessWhitelist = [[CDVWhitelist alloc] initWithArray:whitelistConfigParser.accessWhitelistHosts];
- }
-}
-
-- (BOOL)shouldAllowNavigationToURL:(NSURL *)url
-{
- return IsAtLeastiOSVersion(@"9.0") || [self.navigationWhitelist URLIsAllowed:url];
-}
-
-- (BOOL)shouldAllowRequestForURL:(NSURL *)url
-{
- return IsAtLeastiOSVersion(@"9.0") || [self.accessWhitelist URLIsAllowed:url];
-}
-
-@end
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org