You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by shazron <gi...@git.apache.org> on 2016/06/28 00:11:30 UTC

[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

GitHub user shazron opened a pull request:

    https://github.com/apache/cordova-ios/pull/232

    CB-11270 - Handle JavaScript onclick handler navigation

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shazron/cordova-ios CB-11270

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-ios/pull/232.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #232
    
----
commit 58b13f8f99ed10f05f685d2df40c231a5c42a4c0
Author: Shazron Abdullah <sh...@apache.org>
Date:   2016-06-28T00:11:50Z

    CB-11270 - Handle JavaScript onclick handler navigation

----


---
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


[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/232#discussion_r73437041
  
    --- Diff: tests/CordovaLibTests/CDVWhitelistTests.m ---
    @@ -295,6 +295,37 @@ - (void)testAllowIntentsAndNavigations
         XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"https://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueIntentAllowed);
         // Test http (not allowed in either)
         XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"http://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueNoneAllowed);
    +    
    +    
    +    NSURL* telUrl = [NSURL URLWithString:@"tel:5555555"];
    +    NSMutableURLRequest* telRequest = [NSMutableURLRequest requestWithURL:telUrl];
    +    telRequest.mainDocumentURL = telUrl;
    +    
    +    // mainDocumentURL and URL are the same in the NSURLRequest
    +    // Only UIWebViewNavigationTypeLinkClicked and UIWebViewNavigationTypeOther should return YES
    +    XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeLinkClicked]);
    +    XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeOther]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeReload]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeBackForward]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormSubmitted]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormResubmitted]);
    +    
    --- End diff --
    
    See my comment on that note. The operative test here is for "shouldOverrideLoadWithRequest" -- if the intent is allowed, it should return NO, as in it shouldn't override the load with the request (since it is opened externally).


---
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


[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/232#discussion_r73512970
  
    --- Diff: tests/CordovaLibTests/CDVWhitelistTests.m ---
    @@ -295,6 +295,37 @@ - (void)testAllowIntentsAndNavigations
         XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"https://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueIntentAllowed);
         // Test http (not allowed in either)
         XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"http://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueNoneAllowed);
    +    
    +    
    +    NSURL* telUrl = [NSURL URLWithString:@"tel:5555555"];
    +    NSMutableURLRequest* telRequest = [NSMutableURLRequest requestWithURL:telUrl];
    +    telRequest.mainDocumentURL = telUrl;
    +    
    +    // mainDocumentURL and URL are the same in the NSURLRequest
    +    // Only UIWebViewNavigationTypeLinkClicked and UIWebViewNavigationTypeOther should return YES
    +    XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeLinkClicked]);
    +    XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeOther]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeReload]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeBackForward]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormSubmitted]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormResubmitted]);
    +    
    --- End diff --
    
    Yep, I see now that this test wouldn't make sense.


---
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


[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-ios/pull/232


---
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


[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/232#discussion_r73358461
  
    --- Diff: CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m ---
    @@ -95,23 +95,33 @@ - (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url
         return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
     }
     
    -- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    ++ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    +{
    +    return (UIWebViewNavigationTypeLinkClicked == navigationType ||
    +        (UIWebViewNavigationTypeOther == navigationType &&
    +         [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]]
    +         )
    +        );
    +}
    +
    ++ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
     {
         NSString* allowIntents_whitelistRejectionFormatString = @"ERROR External navigation rejected - <allow-intent> not set for url='%@'";
         NSString* allowNavigations_whitelistRejectionFormatString = @"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'";
         
         NSURL* url = [request URL];
    -    CDVIntentAndNavigationFilterValue filterValue = [self filterUrl:url];
         
         switch (filterValue) {
             case CDVIntentAndNavigationFilterValueNavigationAllowed:
                 return YES;
             case CDVIntentAndNavigationFilterValueIntentAllowed:
    -            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag)
    -            if (UIWebViewNavigationTypeLinkClicked == navigationType) {
    +            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR
    +            // it's a UIWebViewNavigationTypeOther, and it's an internal link
    +            if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
                     [[UIApplication sharedApplication] openURL:url];
                 }
    -            // consume the request (i.e. no error) if it wasn't a UIWebViewNavigationTypeLinkClicked
    +            
    --- End diff --
    
    Currently if we make it in to openURL, we'll still fall through to return NO.
    Since we handled it (by sending it to openURL), should we return YES from inside the if clause?


---
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


[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/232#discussion_r73512881
  
    --- Diff: CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m ---
    @@ -95,23 +95,33 @@ - (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url
         return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
     }
     
    -- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    ++ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    +{
    +    return (UIWebViewNavigationTypeLinkClicked == navigationType ||
    +        (UIWebViewNavigationTypeOther == navigationType &&
    +         [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]]
    +         )
    +        );
    +}
    +
    ++ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
     {
         NSString* allowIntents_whitelistRejectionFormatString = @"ERROR External navigation rejected - <allow-intent> not set for url='%@'";
         NSString* allowNavigations_whitelistRejectionFormatString = @"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'";
         
         NSURL* url = [request URL];
    -    CDVIntentAndNavigationFilterValue filterValue = [self filterUrl:url];
         
         switch (filterValue) {
             case CDVIntentAndNavigationFilterValueNavigationAllowed:
                 return YES;
             case CDVIntentAndNavigationFilterValueIntentAllowed:
    -            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag)
    -            if (UIWebViewNavigationTypeLinkClicked == navigationType) {
    +            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR
    +            // it's a UIWebViewNavigationTypeOther, and it's an internal link
    +            if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
                     [[UIApplication sharedApplication] openURL:url];
                 }
    -            // consume the request (i.e. no error) if it wasn't a UIWebViewNavigationTypeLinkClicked
    +            
    --- End diff --
    
    Got it (especially now that I reread [the doc for the outer method](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/#//apple_ref/occ/intfm/UIWebViewDelegate/webView:shouldStartLoadWithRequest:navigationType:))!  Thanks for explaining.


---
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


[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/232#discussion_r73358362
  
    --- Diff: tests/CordovaLibTests/CDVWhitelistTests.m ---
    @@ -295,6 +295,37 @@ - (void)testAllowIntentsAndNavigations
         XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"https://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueIntentAllowed);
         // Test http (not allowed in either)
         XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"http://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueNoneAllowed);
    +    
    +    
    +    NSURL* telUrl = [NSURL URLWithString:@"tel:5555555"];
    +    NSMutableURLRequest* telRequest = [NSMutableURLRequest requestWithURL:telUrl];
    +    telRequest.mainDocumentURL = telUrl;
    +    
    +    // mainDocumentURL and URL are the same in the NSURLRequest
    +    // Only UIWebViewNavigationTypeLinkClicked and UIWebViewNavigationTypeOther should return YES
    +    XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeLinkClicked]);
    +    XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeOther]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeReload]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeBackForward]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormSubmitted]);
    +    XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormResubmitted]);
    +    
    --- End diff --
    
    Would it make sense to test the intent-allowed case?  This currently fails - see comment in comments section.
    ```    
        // Only CDVIntentAndNavigationFilterValueIntentAllowed and CDVIntentAndNavigationFilterValueNavigationAllowed should return YES
        XCTAssertTrue([CDVIntentAndNavigationFilter shouldOverrideLoadWithRequest:telRequest navigationType:UIWebViewNavigationTypeOther filterValue:CDVIntentAndNavigationFilterValueNavigationAllowed]);
        XCTAssertTrue([CDVIntentAndNavigationFilter shouldOverrideLoadWithRequest:telRequest navigationType:UIWebViewNavigationTypeOther filterValue:CDVIntentAndNavigationFilterValueIntentAllowed]);
        XCTAssertFalse([CDVIntentAndNavigationFilter shouldOverrideLoadWithRequest:telRequest navigationType:UIWebViewNavigationTypeOther filterValue:CDVIntentAndNavigationFilterValueNoneAllowed]);
    
    ```


---
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


[GitHub] cordova-ios issue #232: CB-11270 - Handle JavaScript onclick handler navigat...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on the issue:

    https://github.com/apache/cordova-ios/pull/232
  
    LGTM!


---
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


[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/232#discussion_r73356143
  
    --- Diff: CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m ---
    @@ -95,23 +95,33 @@ - (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url
         return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
     }
     
    -- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    ++ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    +{
    +    return (UIWebViewNavigationTypeLinkClicked == navigationType ||
    +        (UIWebViewNavigationTypeOther == navigationType &&
    +         [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]]
    +         )
    +        );
    +}
    +
    ++ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
     {
         NSString* allowIntents_whitelistRejectionFormatString = @"ERROR External navigation rejected - <allow-intent> not set for url='%@'";
         NSString* allowNavigations_whitelistRejectionFormatString = @"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'";
         
         NSURL* url = [request URL];
    -    CDVIntentAndNavigationFilterValue filterValue = [self filterUrl:url];
         
         switch (filterValue) {
             case CDVIntentAndNavigationFilterValueNavigationAllowed:
                 return YES;
             case CDVIntentAndNavigationFilterValueIntentAllowed:
    -            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag)
    -            if (UIWebViewNavigationTypeLinkClicked == navigationType) {
    +            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR
    +            // it's a UIWebViewNavigationTypeOther, and it's an internal link
    +            if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
                     [[UIApplication sharedApplication] openURL:url];
    --- End diff --
    
    Currently if we make it in to openURL, we'll still fall through to return NO.
    Since we handled it (by sending it to openURL), should we return YES from inside the if clause?


---
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


[GitHub] cordova-ios pull request #232: CB-11270 - Handle JavaScript onclick handler ...

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/232#discussion_r73432421
  
    --- Diff: CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m ---
    @@ -95,23 +95,33 @@ - (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url
         return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
     }
     
    -- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    ++ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    +{
    +    return (UIWebViewNavigationTypeLinkClicked == navigationType ||
    +        (UIWebViewNavigationTypeOther == navigationType &&
    +         [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]]
    +         )
    +        );
    +}
    +
    ++ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
     {
         NSString* allowIntents_whitelistRejectionFormatString = @"ERROR External navigation rejected - <allow-intent> not set for url='%@'";
         NSString* allowNavigations_whitelistRejectionFormatString = @"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'";
         
         NSURL* url = [request URL];
    -    CDVIntentAndNavigationFilterValue filterValue = [self filterUrl:url];
         
         switch (filterValue) {
             case CDVIntentAndNavigationFilterValueNavigationAllowed:
                 return YES;
             case CDVIntentAndNavigationFilterValueIntentAllowed:
    -            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag)
    -            if (UIWebViewNavigationTypeLinkClicked == navigationType) {
    +            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR
    +            // it's a UIWebViewNavigationTypeOther, and it's an internal link
    +            if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
                     [[UIApplication sharedApplication] openURL:url];
                 }
    -            // consume the request (i.e. no error) if it wasn't a UIWebViewNavigationTypeLinkClicked
    +            
    --- End diff --
    
    returning NO here signals to the WebView that it should not load the URL inside itself, so it is correct in this context since we open the url externally.


---
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


[GitHub] cordova-ios issue #232: CB-11270 - Handle JavaScript onclick handler navigat...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on the issue:

    https://github.com/apache/cordova-ios/pull/232
  
    I ran the tests - they passed.
    
    I wrote a manual test with an index.html that has a javascript tel: link and an iframe with the same javascript tel: link.  The index.html tel:link works, the iframe tel:link does not work - this is what we want, I think.
    
    Please see the inline comments on the "Files changed" tab.


---
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