{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/3392","labels_url":"https://api.github.com/repos/facebook/react-native/issues/3392/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/3392/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/3392/events","html_url":"https://github.com/facebook/react-native/pull/3392","id":111268866,"number":3392,"title":"Added support for opening http:// and https:// links in Mobile Safari.","user":{"login":"pjcabrera","id":199736,"avatar_url":"https://avatars.githubusercontent.com/u/199736?v=3","gravatar_id":"","url":"https://api.github.com/users/pjcabrera","html_url":"https://github.com/pjcabrera","followers_url":"https://api.github.com/users/pjcabrera/followers","following_url":"https://api.github.com/users/pjcabrera/following{/other_user}","gists_url":"https://api.github.com/users/pjcabrera/gists{/gist_id}","starred_url":"https://api.github.com/users/pjcabrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjcabrera/subscriptions","organizations_url":"https://api.github.com/users/pjcabrera/orgs","repos_url":"https://api.github.com/users/pjcabrera/repos","events_url":"https://api.github.com/users/pjcabrera/events{/privacy}","received_events_url":"https://api.github.com/users/pjcabrera/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20needs-revision","name":"GH Review: needs-revision","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"javache","id":5676,"avatar_url":"https://avatars.githubusercontent.com/u/5676?v=3","gravatar_id":"","url":"https://api.github.com/users/javache","html_url":"https://github.com/javache","followers_url":"https://api.github.com/users/javache/followers","following_url":"https://api.github.com/users/javache/following{/other_user}","gists_url":"https://api.github.com/users/javache/gists{/gist_id}","starred_url":"https://api.github.com/users/javache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javache/subscriptions","organizations_url":"https://api.github.com/users/javache/orgs","repos_url":"https://api.github.com/users/javache/repos","events_url":"https://api.github.com/users/javache/events{/privacy}","received_events_url":"https://api.github.com/users/javache/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-10-13T20:53:40Z","updated_at":"2015-10-14T11:05:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/3392","html_url":"https://github.com/facebook/react-native/pull/3392","diff_url":"https://github.com/facebook/react-native/pull/3392.diff","patch_url":"https://github.com/facebook/react-native/pull/3392.patch"},"body":"We have a requirement in our app, to open in mobile Safari, any http:// and https:// links displayed in a web view. Our web view is not full screen, and displaying external content in that web view is outside of the scope of our app, so we open them in mobile Safari.\r\n\r\nI've forked the WebView component and added a property, externalHTTPEnabled, and modified the RCTWebView implementation of\r\n\r\n```- (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request\r\n navigationType:(UIWebViewNavigationType)navigationType```\r\n\r\nto check if the user has tapped a link and that the URL has a prefix of 'http' (this matches 'http://' and 'https://' URLs).\r\n\r\nBy adding a property and defaulting to false, this added functionality doesn't break existing behavior."},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/148017976","html_url":"https://github.com/facebook/react-native/pull/3392#issuecomment-148017976","issue_url":"https://api.github.com/repos/facebook/react-native/issues/3392","id":148017976,"user":{"login":"nicklockwood","id":546885,"avatar_url":"https://avatars.githubusercontent.com/u/546885?v=3","gravatar_id":"","url":"https://api.github.com/users/nicklockwood","html_url":"https://github.com/nicklockwood","followers_url":"https://api.github.com/users/nicklockwood/followers","following_url":"https://api.github.com/users/nicklockwood/following{/other_user}","gists_url":"https://api.github.com/users/nicklockwood/gists{/gist_id}","starred_url":"https://api.github.com/users/nicklockwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicklockwood/subscriptions","organizations_url":"https://api.github.com/users/nicklockwood/orgs","repos_url":"https://api.github.com/users/nicklockwood/repos","events_url":"https://api.github.com/users/nicklockwood/events{/privacy}","received_events_url":"https://api.github.com/users/nicklockwood/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T11:05:00Z","updated_at":"2015-10-14T11:05:00Z","body":"Yeah, this seems like the wrong API for this.\r\n\r\nI can imagine it would be useful to have a generic way to intercept webview requests and execute arbitrary JS code, similar to the `injectedJavaScript` property, but with the ability to block or redirect the url.\r\n\r\nBut a blanket redirect of all links to Safari seems too specific of a use case to be something we'd want to expose as a public property."}}