{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/firefox-ios/pulls/comments/27981693","id":27981693,"diff_hunk":"@@ -776,46 +776,38 @@ extension BrowserViewController: WKNavigationDelegate {\n \n     func webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) {\n         let url = navigationAction.request.URL\n-        \n-        var openExternally = false\n-        \n+\n         if let scheme = url.scheme {\n             switch scheme {\n             case \"about\", \"http\", \"https\":\n-                openExternally = false\n-            case \"mailto\", \"tel\", \"facetime\", \"sms\":\n-                openExternally = true\n-            default:\n-                // Filter out everything we can't open.\n-                decisionHandler(WKNavigationActionPolicy.Cancel)\n+                decisionHandler(WKNavigationActionPolicy.Allow)\n                 return\n+            default:\n+                break;\n             }\n         }\n-        \n-        if openExternally {\n-            if UIApplication.sharedApplication().canOpenURL(url) {\n-                // Ask the user if it's okay to open the url with UIApplication.\n-                let alert = UIAlertController(\n-                    title: String(format: NSLocalizedString(\"Opening %@\", comment:\"Opening an external URL\"), url),\n-                    message: NSLocalizedString(\"This will open in another application\", comment: \"Opening an external app\"),\n-                    preferredStyle: UIAlertControllerStyle.Alert\n-                )\n \n-                alert.addAction(UIAlertAction(title: NSLocalizedString(\"Cancel\", comment:\"Alert Cancel Button\"), style: UIAlertActionStyle.Cancel, handler: { (action: UIAlertAction!) in\n-                    // NOP\n-                }))\n-                \n-                alert.addAction(UIAlertAction(title: NSLocalizedString(\"OK\", comment:\"Alert OK Button\"), style: UIAlertActionStyle.Default, handler: { (action: UIAlertAction!) in\n-                    UIApplication.sharedApplication().openURL(url)\n-                    return\n-                }))\n+        if UIApplication.sharedApplication().canOpenURL(url) {","path":"Client/Frontend/Browser/BrowserViewController.swift","position":41,"original_position":41,"commit_id":"56a852e30d9c968fe0c0d6b418fc9896dd260172","original_commit_id":"56a852e30d9c968fe0c0d6b418fc9896dd260172","user":{"login":"st3fan","id":28052,"avatar_url":"https://avatars.githubusercontent.com/u/28052?v=3","gravatar_id":"","url":"https://api.github.com/users/st3fan","html_url":"https://github.com/st3fan","followers_url":"https://api.github.com/users/st3fan/followers","following_url":"https://api.github.com/users/st3fan/following{/other_user}","gists_url":"https://api.github.com/users/st3fan/gists{/gist_id}","starred_url":"https://api.github.com/users/st3fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/st3fan/subscriptions","organizations_url":"https://api.github.com/users/st3fan/orgs","repos_url":"https://api.github.com/users/st3fan/repos","events_url":"https://api.github.com/users/st3fan/events{/privacy}","received_events_url":"https://api.github.com/users/st3fan/received_events","type":"User","site_admin":false},"body":"I don't like this. I think we should follow what Safari does for at least a few specific url schemes:\r\n\r\n* `tel` shows an alert: +1234567890 Cancel / Call\r\n* `sms` opens the SMS app directly (no harm because nothing happens until you confirm there)\r\n* `facetime` shows an alert: myapple@id.com Cancel / FaceTime\r\n* There is also a special case for App Store links (there are a ton of special links) that we should handle in a non-generic way I think?\r\n\r\nFor other schemes i think it is good to show something generic.\r\n","created_at":"2015-04-08T15:37:22Z","updated_at":"2015-04-08T15:37:22Z","html_url":"https://github.com/mozilla/firefox-ios/pull/303#discussion_r27981693","pull_request_url":"https://api.github.com/repos/mozilla/firefox-ios/pulls/303","_links":{"self":{"href":"https://api.github.com/repos/mozilla/firefox-ios/pulls/comments/27981693"},"html":{"href":"https://github.com/mozilla/firefox-ios/pull/303#discussion_r27981693"},"pull_request":{"href":"https://api.github.com/repos/mozilla/firefox-ios/pulls/303"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/firefox-ios/pulls/303","id":32619241,"html_url":"https://github.com/mozilla/firefox-ios/pull/303","diff_url":"https://github.com/mozilla/firefox-ios/pull/303.diff","patch_url":"https://github.com/mozilla/firefox-ios/pull/303.patch","issue_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/303","number":303,"state":"open","locked":false,"title":"Bug 1146611 - Prompt for opening anything that can be opened","user":{"login":"wesj","id":1117644,"avatar_url":"https://avatars.githubusercontent.com/u/1117644?v=3","gravatar_id":"","url":"https://api.github.com/users/wesj","html_url":"https://github.com/wesj","followers_url":"https://api.github.com/users/wesj/followers","following_url":"https://api.github.com/users/wesj/following{/other_user}","gists_url":"https://api.github.com/users/wesj/gists{/gist_id}","starred_url":"https://api.github.com/users/wesj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesj/subscriptions","organizations_url":"https://api.github.com/users/wesj/orgs","repos_url":"https://api.github.com/users/wesj/repos","events_url":"https://api.github.com/users/wesj/events{/privacy}","received_events_url":"https://api.github.com/users/wesj/received_events","type":"User","site_admin":false},"body":"I think we should probably just do something like this (and then get less restrictive from here). i.e. If there's something installed that can open the url, Prompt the user to open with it.","created_at":"2015-04-03T21:52:20Z","updated_at":"2015-04-08T15:37:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f42b29e90a8f5692f5ab90244a8abe66a75bd1a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/firefox-ios/pulls/303/commits","review_comments_url":"https://api.github.com/repos/mozilla/firefox-ios/pulls/303/comments","review_comment_url":"https://api.github.com/repos/mozilla/firefox-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/303/comments","statuses_url":"https://api.github.com/repos/mozilla/firefox-ios/statuses/56a852e30d9c968fe0c0d6b418fc9896dd260172","head":{"label":"wesj:loadUrls","ref":"loadUrls","sha":"56a852e30d9c968fe0c0d6b418fc9896dd260172","user":{"login":"wesj","id":1117644,"avatar_url":"https://avatars.githubusercontent.com/u/1117644?v=3","gravatar_id":"","url":"https://api.github.com/users/wesj","html_url":"https://github.com/wesj","followers_url":"https://api.github.com/users/wesj/followers","following_url":"https://api.github.com/users/wesj/following{/other_user}","gists_url":"https://api.github.com/users/wesj/gists{/gist_id}","starred_url":"https://api.github.com/users/wesj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesj/subscriptions","organizations_url":"https://api.github.com/users/wesj/orgs","repos_url":"https://api.github.com/users/wesj/repos","events_url":"https://api.github.com/users/wesj/events{/privacy}","received_events_url":"https://api.github.com/users/wesj/received_events","type":"User","site_admin":false},"repo":{"id":27951196,"name":"firefox-ios-1","full_name":"wesj/firefox-ios-1","owner":{"login":"wesj","id":1117644,"avatar_url":"https://avatars.githubusercontent.com/u/1117644?v=3","gravatar_id":"","url":"https://api.github.com/users/wesj","html_url":"https://github.com/wesj","followers_url":"https://api.github.com/users/wesj/followers","following_url":"https://api.github.com/users/wesj/following{/other_user}","gists_url":"https://api.github.com/users/wesj/gists{/gist_id}","starred_url":"https://api.github.com/users/wesj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesj/subscriptions","organizations_url":"https://api.github.com/users/wesj/orgs","repos_url":"https://api.github.com/users/wesj/repos","events_url":"https://api.github.com/users/wesj/events{/privacy}","received_events_url":"https://api.github.com/users/wesj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wesj/firefox-ios-1","description":"Firefox for iOS","fork":true,"url":"https://api.github.com/repos/wesj/firefox-ios-1","forks_url":"https://api.github.com/repos/wesj/firefox-ios-1/forks","keys_url":"https://api.github.com/repos/wesj/firefox-ios-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wesj/firefox-ios-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wesj/firefox-ios-1/teams","hooks_url":"https://api.github.com/repos/wesj/firefox-ios-1/hooks","issue_events_url":"https://api.github.com/repos/wesj/firefox-ios-1/issues/events{/number}","events_url":"https://api.github.com/repos/wesj/firefox-ios-1/events","assignees_url":"https://api.github.com/repos/wesj/firefox-ios-1/assignees{/user}","branches_url":"https://api.github.com/repos/wesj/firefox-ios-1/branches{/branch}","tags_url":"https://api.github.com/repos/wesj/firefox-ios-1/tags","blobs_url":"https://api.github.com/repos/wesj/firefox-ios-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wesj/firefox-ios-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wesj/firefox-ios-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/wesj/firefox-ios-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wesj/firefox-ios-1/statuses/{sha}","languages_url":"https://api.github.com/repos/wesj/firefox-ios-1/languages","stargazers_url":"https://api.github.com/repos/wesj/firefox-ios-1/stargazers","contributors_url":"https://api.github.com/repos/wesj/firefox-ios-1/contributors","subscribers_url":"https://api.github.com/repos/wesj/firefox-ios-1/subscribers","subscription_url":"https://api.github.com/repos/wesj/firefox-ios-1/subscription","commits_url":"https://api.github.com/repos/wesj/firefox-ios-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/wesj/firefox-ios-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/wesj/firefox-ios-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/wesj/firefox-ios-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/wesj/firefox-ios-1/contents/{+path}","compare_url":"https://api.github.com/repos/wesj/firefox-ios-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wesj/firefox-ios-1/merges","archive_url":"https://api.github.com/repos/wesj/firefox-ios-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wesj/firefox-ios-1/downloads","issues_url":"https://api.github.com/repos/wesj/firefox-ios-1/issues{/number}","pulls_url":"https://api.github.com/repos/wesj/firefox-ios-1/pulls{/number}","milestones_url":"https://api.github.com/repos/wesj/firefox-ios-1/milestones{/number}","notifications_url":"https://api.github.com/repos/wesj/firefox-ios-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wesj/firefox-ios-1/labels{/name}","releases_url":"https://api.github.com/repos/wesj/firefox-ios-1/releases{/id}","created_at":"2014-12-13T05:57:28Z","updated_at":"2015-03-26T21:24:58Z","pushed_at":"2015-04-07T22:29:35Z","git_url":"git://github.com/wesj/firefox-ios-1.git","ssh_url":"git@github.com:wesj/firefox-ios-1.git","clone_url":"https://github.com/wesj/firefox-ios-1.git","svn_url":"https://github.com/wesj/firefox-ios-1","homepage":"","size":16130,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"68139d68d254ab498e3c564c7ea23d39535915a1","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":26133979,"name":"firefox-ios","full_name":"mozilla/firefox-ios","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/firefox-ios","description":"Firefox for iOS","fork":false,"url":"https://api.github.com/repos/mozilla/firefox-ios","forks_url":"https://api.github.com/repos/mozilla/firefox-ios/forks","keys_url":"https://api.github.com/repos/mozilla/firefox-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/firefox-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/firefox-ios/teams","hooks_url":"https://api.github.com/repos/mozilla/firefox-ios/hooks","issue_events_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/firefox-ios/events","assignees_url":"https://api.github.com/repos/mozilla/firefox-ios/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/firefox-ios/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/firefox-ios/tags","blobs_url":"https://api.github.com/repos/mozilla/firefox-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/firefox-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/firefox-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/firefox-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/firefox-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/firefox-ios/languages","stargazers_url":"https://api.github.com/repos/mozilla/firefox-ios/stargazers","contributors_url":"https://api.github.com/repos/mozilla/firefox-ios/contributors","subscribers_url":"https://api.github.com/repos/mozilla/firefox-ios/subscribers","subscription_url":"https://api.github.com/repos/mozilla/firefox-ios/subscription","commits_url":"https://api.github.com/repos/mozilla/firefox-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/firefox-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/firefox-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/firefox-ios/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/firefox-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/firefox-ios/merges","archive_url":"https://api.github.com/repos/mozilla/firefox-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/firefox-ios/downloads","issues_url":"https://api.github.com/repos/mozilla/firefox-ios/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/firefox-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/firefox-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/firefox-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/firefox-ios/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/firefox-ios/releases{/id}","created_at":"2014-11-03T19:07:02Z","updated_at":"2015-04-08T07:38:57Z","pushed_at":"2015-04-08T09:16:01Z","git_url":"git://github.com/mozilla/firefox-ios.git","ssh_url":"git@github.com:mozilla/firefox-ios.git","clone_url":"https://github.com/mozilla/firefox-ios.git","svn_url":"https://github.com/mozilla/firefox-ios","homepage":"","size":27208,"stargazers_count":3078,"watchers_count":3078,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":505,"mirror_url":null,"open_issues_count":22,"forks":505,"open_issues":22,"watchers":3078,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/firefox-ios/pulls/303"},"html":{"href":"https://github.com/mozilla/firefox-ios/pull/303"},"issue":{"href":"https://api.github.com/repos/mozilla/firefox-ios/issues/303"},"comments":{"href":"https://api.github.com/repos/mozilla/firefox-ios/issues/303/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/firefox-ios/pulls/303/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/firefox-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/firefox-ios/pulls/303/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/firefox-ios/statuses/56a852e30d9c968fe0c0d6b418fc9896dd260172"}}}}