mirror of
https://github.com/status-im/react-native.git
synced 2025-02-26 16:10:58 +00:00
Fix webview crash when trying to display local html files
Summary:
When using webview on android and trying to link to an html file located on device (using `file://`), the application would crash with an error specifying that nothing handles the fired intent. This is due to [`33a1f28`](33a1f28654
) which attempts to intercept all non `http(s)` links.
This is a simple fix so hopefully it can make it into the next stable release.
Closes https://github.com/facebook/react-native/pull/9668
Differential Revision: D3956485
fbshipit-source-id: 5a752abc21802a44e3a26e88669ccb6852076992
This commit is contained in:
parent
1a9853da37
commit
a2aab625f3
@ -118,7 +118,8 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (url.startsWith("http://") || url.startsWith("https://")) {
|
||||
if (url.startsWith("http://") || url.startsWith("https://") ||
|
||||
url.startsWith("file://")) {
|
||||
return false;
|
||||
} else {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
|
Loading…
x
Reference in New Issue
Block a user