cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agrieve <...@git.apache.org>
Subject [GitHub] cordova-ios pull request: Unplug whitelist - review
Date Wed, 29 Oct 2014 14:40:16 GMT
Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/116#discussion_r19541663
  
    --- Diff: CordovaLib/Classes/CDVViewController.m ---
    @@ -749,24 +767,77 @@ - (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*
             return YES;
         }
     
    -    /*
    -     * Handle all other types of urls (tel:, sms:), and requests to load a url in the
main webview.
    -     */
    -    else {
    -        if ([self.whitelist schemeIsAllowed:[url scheme]]) {
    -            return [self.whitelist URLIsAllowed:url];
    -        } else {
    -            if ([[UIApplication sharedApplication] canOpenURL:url]) {
    -                [[UIApplication sharedApplication] openURL:url];
    -            } else { // handle any custom schemes to plugins
    -                [[NSNotificationCenter defaultCenter] postNotification:[NSNotification
notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
    +    return NO;
    +}
    +
    +- (BOOL)shouldAllowRequestForURL:(NSURL *)url
    +{
    +    BOOL anyPluginsResponded = NO;
    +    BOOL shouldAllowRequest = NO;
    +    for (NSString* pluginName in pluginObjects) {
    +        CDVPlugin* plugin = [pluginObjects objectForKey:pluginName];
    +        SEL selector = NSSelectorFromString(@"shouldAllowRequestForURL:");
    --- End diff --
    
    You should document these new selectors in CDVPlugin.h. When doing so, make note that
shouldAllowRequestForURL doesn't work with websocket, or at all for WKWebView


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message