react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Http only exception with local file in webview in wpf app

Open code936 opened this issue 8 years ago • 2 comments

Environment

react-native-cli: 2.0.1 react: 16.3.1 react-native: 0.55.2 react-native-windows: 0.55.0-rc.0 rnpm-plugin-windows: 0.2.8 rnpm-plugin-wpf: 0.1.2 Node : v8.9.4 npm : 5.6.0

Target Platform: WPF Target Device: Desktop .NET 4.6 Visual Studio Version 2017 OS: Windows 7 Service pack 1

Steps to Reproduce

I an trying to open an html page from c:\ in wpf application. Refer below code.

<WebView source={{ uri: "file:///C:/test.html" }} />

It throws exception "only http and https schema are allowed". When i comment line "request.RequestUri = new Uri(uri);" in file \node_modules\react-native-windows\ReactWindows\ReactNative.Net46\Views\Web\ReactWebViewManager.cs at line number 118 then it works without any issue. Exactly what line "request.RequestUri = new Uri(uri);" does?

Is my uri scheme is incorrect?

code936 avatar Apr 19 '18 06:04 code936

This issue is fixed under - https://github.com/Microsoft/react-native-windows/pull/1830 @matthargett Please close this issue.

piyush965 avatar May 18 '18 07:05 piyush965

fixed by #1830

matthargett avatar May 18 '18 23:05 matthargett