{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cordova-ios/pulls/comments/73512881","id":73512881,"diff_hunk":"@@ -95,23 +95,33 @@ - (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url\n     return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];\n }\n \n-- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType\n++ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType\n+{\n+    return (UIWebViewNavigationTypeLinkClicked == navigationType ||\n+        (UIWebViewNavigationTypeOther == navigationType &&\n+         [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]]\n+         )\n+        );\n+}\n+\n++ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue\n {\n     NSString* allowIntents_whitelistRejectionFormatString = @\"ERROR External navigation rejected - <allow-intent> not set for url='%@'\";\n     NSString* allowNavigations_whitelistRejectionFormatString = @\"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'\";\n     \n     NSURL* url = [request URL];\n-    CDVIntentAndNavigationFilterValue filterValue = [self filterUrl:url];\n     \n     switch (filterValue) {\n         case CDVIntentAndNavigationFilterValueNavigationAllowed:\n             return YES;\n         case CDVIntentAndNavigationFilterValueIntentAllowed:\n-            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag)\n-            if (UIWebViewNavigationTypeLinkClicked == navigationType) {\n+            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR\n+            // it's a UIWebViewNavigationTypeOther, and it's an internal link\n+            if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){\n                 [[UIApplication sharedApplication] openURL:url];\n             }\n-            // consume the request (i.e. no error) if it wasn't a UIWebViewNavigationTypeLinkClicked\n+            ","path":"CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m","position":34,"original_position":34,"commit_id":"58b13f8f99ed10f05f685d2df40c231a5c42a4c0","original_commit_id":"58b13f8f99ed10f05f685d2df40c231a5c42a4c0","user":{"login":"tony--","id":513830,"avatar_url":"https://avatars.githubusercontent.com/u/513830?v=3","gravatar_id":"","url":"https://api.github.com/users/tony--","html_url":"https://github.com/tony--","followers_url":"https://api.github.com/users/tony--/followers","following_url":"https://api.github.com/users/tony--/following{/other_user}","gists_url":"https://api.github.com/users/tony--/gists{/gist_id}","starred_url":"https://api.github.com/users/tony--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony--/subscriptions","organizations_url":"https://api.github.com/users/tony--/orgs","repos_url":"https://api.github.com/users/tony--/repos","events_url":"https://api.github.com/users/tony--/events{/privacy}","received_events_url":"https://api.github.com/users/tony--/received_events","type":"User","site_admin":false},"body":"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.","created_at":"2016-08-04T12:35:22Z","updated_at":"2016-08-04T12:35:22Z","html_url":"https://github.com/apache/cordova-ios/pull/232#discussion_r73512881","pull_request_url":"https://api.github.com/repos/apache/cordova-ios/pulls/232","_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/comments/73512881"},"html":{"href":"https://github.com/apache/cordova-ios/pull/232#discussion_r73512881"},"pull_request":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/232"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cordova-ios/pulls/232","id":75400145,"html_url":"https://github.com/apache/cordova-ios/pull/232","diff_url":"https://github.com/apache/cordova-ios/pull/232.diff","patch_url":"https://github.com/apache/cordova-ios/pull/232.patch","issue_url":"https://api.github.com/repos/apache/cordova-ios/issues/232","number":232,"state":"open","locked":false,"title":"CB-11270 - Handle JavaScript onclick handler navigation","user":{"login":"shazron","id":36107,"avatar_url":"https://avatars.githubusercontent.com/u/36107?v=3","gravatar_id":"","url":"https://api.github.com/users/shazron","html_url":"https://github.com/shazron","followers_url":"https://api.github.com/users/shazron/followers","following_url":"https://api.github.com/users/shazron/following{/other_user}","gists_url":"https://api.github.com/users/shazron/gists{/gist_id}","starred_url":"https://api.github.com/users/shazron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazron/subscriptions","organizations_url":"https://api.github.com/users/shazron/orgs","repos_url":"https://api.github.com/users/shazron/repos","events_url":"https://api.github.com/users/shazron/events{/privacy}","received_events_url":"https://api.github.com/users/shazron/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-28T00:11:25Z","updated_at":"2016-08-04T12:35:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9fa7bc3a38bc82993af3e25a86fc9b56ead8778","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/cordova-ios/pulls/232/commits","review_comments_url":"https://api.github.com/repos/apache/cordova-ios/pulls/232/comments","review_comment_url":"https://api.github.com/repos/apache/cordova-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cordova-ios/issues/232/comments","statuses_url":"https://api.github.com/repos/apache/cordova-ios/statuses/58b13f8f99ed10f05f685d2df40c231a5c42a4c0","head":{"label":"shazron:CB-11270","ref":"CB-11270","sha":"58b13f8f99ed10f05f685d2df40c231a5c42a4c0","user":{"login":"shazron","id":36107,"avatar_url":"https://avatars.githubusercontent.com/u/36107?v=3","gravatar_id":"","url":"https://api.github.com/users/shazron","html_url":"https://github.com/shazron","followers_url":"https://api.github.com/users/shazron/followers","following_url":"https://api.github.com/users/shazron/following{/other_user}","gists_url":"https://api.github.com/users/shazron/gists{/gist_id}","starred_url":"https://api.github.com/users/shazron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazron/subscriptions","organizations_url":"https://api.github.com/users/shazron/orgs","repos_url":"https://api.github.com/users/shazron/repos","events_url":"https://api.github.com/users/shazron/events{/privacy}","received_events_url":"https://api.github.com/users/shazron/received_events","type":"User","site_admin":false},"repo":{"id":25056226,"name":"cordova-ios","full_name":"shazron/cordova-ios","owner":{"login":"shazron","id":36107,"avatar_url":"https://avatars.githubusercontent.com/u/36107?v=3","gravatar_id":"","url":"https://api.github.com/users/shazron","html_url":"https://github.com/shazron","followers_url":"https://api.github.com/users/shazron/followers","following_url":"https://api.github.com/users/shazron/following{/other_user}","gists_url":"https://api.github.com/users/shazron/gists{/gist_id}","starred_url":"https://api.github.com/users/shazron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazron/subscriptions","organizations_url":"https://api.github.com/users/shazron/orgs","repos_url":"https://api.github.com/users/shazron/repos","events_url":"https://api.github.com/users/shazron/events{/privacy}","received_events_url":"https://api.github.com/users/shazron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shazron/cordova-ios","description":"Mirror of Apache Cordova iOS","fork":true,"url":"https://api.github.com/repos/shazron/cordova-ios","forks_url":"https://api.github.com/repos/shazron/cordova-ios/forks","keys_url":"https://api.github.com/repos/shazron/cordova-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shazron/cordova-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shazron/cordova-ios/teams","hooks_url":"https://api.github.com/repos/shazron/cordova-ios/hooks","issue_events_url":"https://api.github.com/repos/shazron/cordova-ios/issues/events{/number}","events_url":"https://api.github.com/repos/shazron/cordova-ios/events","assignees_url":"https://api.github.com/repos/shazron/cordova-ios/assignees{/user}","branches_url":"https://api.github.com/repos/shazron/cordova-ios/branches{/branch}","tags_url":"https://api.github.com/repos/shazron/cordova-ios/tags","blobs_url":"https://api.github.com/repos/shazron/cordova-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shazron/cordova-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shazron/cordova-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/shazron/cordova-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shazron/cordova-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/shazron/cordova-ios/languages","stargazers_url":"https://api.github.com/repos/shazron/cordova-ios/stargazers","contributors_url":"https://api.github.com/repos/shazron/cordova-ios/contributors","subscribers_url":"https://api.github.com/repos/shazron/cordova-ios/subscribers","subscription_url":"https://api.github.com/repos/shazron/cordova-ios/subscription","commits_url":"https://api.github.com/repos/shazron/cordova-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/shazron/cordova-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/shazron/cordova-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/shazron/cordova-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/shazron/cordova-ios/contents/{+path}","compare_url":"https://api.github.com/repos/shazron/cordova-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shazron/cordova-ios/merges","archive_url":"https://api.github.com/repos/shazron/cordova-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shazron/cordova-ios/downloads","issues_url":"https://api.github.com/repos/shazron/cordova-ios/issues{/number}","pulls_url":"https://api.github.com/repos/shazron/cordova-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/shazron/cordova-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/shazron/cordova-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shazron/cordova-ios/labels{/name}","releases_url":"https://api.github.com/repos/shazron/cordova-ios/releases{/id}","deployments_url":"https://api.github.com/repos/shazron/cordova-ios/deployments","created_at":"2014-10-10T22:57:03Z","updated_at":"2016-01-28T18:20:20Z","pushed_at":"2016-06-28T00:10:48Z","git_url":"git://github.com/shazron/cordova-ios.git","ssh_url":"git@github.com:shazron/cordova-ios.git","clone_url":"https://github.com/shazron/cordova-ios.git","svn_url":"https://github.com/shazron/cordova-ios","homepage":null,"size":27742,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"7d993909d7274d6d22c77645491da6e5e5188eda","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":6898387,"name":"cordova-ios","full_name":"apache/cordova-ios","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cordova-ios","description":"Mirror of Apache Cordova iOS","fork":false,"url":"https://api.github.com/repos/apache/cordova-ios","forks_url":"https://api.github.com/repos/apache/cordova-ios/forks","keys_url":"https://api.github.com/repos/apache/cordova-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cordova-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cordova-ios/teams","hooks_url":"https://api.github.com/repos/apache/cordova-ios/hooks","issue_events_url":"https://api.github.com/repos/apache/cordova-ios/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cordova-ios/events","assignees_url":"https://api.github.com/repos/apache/cordova-ios/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cordova-ios/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cordova-ios/tags","blobs_url":"https://api.github.com/repos/apache/cordova-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cordova-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cordova-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cordova-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cordova-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cordova-ios/languages","stargazers_url":"https://api.github.com/repos/apache/cordova-ios/stargazers","contributors_url":"https://api.github.com/repos/apache/cordova-ios/contributors","subscribers_url":"https://api.github.com/repos/apache/cordova-ios/subscribers","subscription_url":"https://api.github.com/repos/apache/cordova-ios/subscription","commits_url":"https://api.github.com/repos/apache/cordova-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cordova-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cordova-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cordova-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cordova-ios/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cordova-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cordova-ios/merges","archive_url":"https://api.github.com/repos/apache/cordova-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cordova-ios/downloads","issues_url":"https://api.github.com/repos/apache/cordova-ios/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cordova-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cordova-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cordova-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cordova-ios/labels{/name}","releases_url":"https://api.github.com/repos/apache/cordova-ios/releases{/id}","deployments_url":"https://api.github.com/repos/apache/cordova-ios/deployments","created_at":"2012-11-28T08:00:23Z","updated_at":"2016-08-04T09:36:30Z","pushed_at":"2016-08-03T00:09:10Z","git_url":"git://github.com/apache/cordova-ios.git","ssh_url":"git@github.com:apache/cordova-ios.git","clone_url":"https://github.com/apache/cordova-ios.git","svn_url":"https://github.com/apache/cordova-ios","homepage":null,"size":30031,"stargazers_count":1012,"watchers_count":1012,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":573,"mirror_url":"git://git.apache.org/cordova-ios.git","open_issues_count":9,"forks":573,"open_issues":9,"watchers":1012,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/232"},"html":{"href":"https://github.com/apache/cordova-ios/pull/232"},"issue":{"href":"https://api.github.com/repos/apache/cordova-ios/issues/232"},"comments":{"href":"https://api.github.com/repos/apache/cordova-ios/issues/232/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/232/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/232/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cordova-ios/statuses/58b13f8f99ed10f05f685d2df40c231a5c42a4c0"}}}}
{"actor":{"display_login":"tony--"}}