Ability to load local files in a WebView on iOS devices (#4444)

* Ability to load local files in a WebView on iOS devices

* Ability to load local files in a WebView on iOS devices (removed doc-comments in test)
This commit is contained in:
Eddy Verbruggen
2017-06-28 10:00:02 +02:00
committed by Alexander Vakrilov
parent 1420fa8fcc
commit f399f6c62b
3 changed files with 49 additions and 0 deletions

View File

@@ -71,6 +71,11 @@ export abstract class WebViewBase extends View implements WebViewDefinition {
src = "file://" + src;
}
// loading local files from paths with spaces may fail
if (src.toLowerCase().indexOf("file:///") === 0) {
src = encodeURI(src);
}
if (src.toLowerCase().indexOf("http://") === 0 ||
src.toLowerCase().indexOf("https://") === 0 ||
src.toLowerCase().indexOf("file:///") === 0) {