mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
fix(ios-webview): loading of local-file dependency (#6947)
Fixes loading of html dependencies when loading a local file to web view. I've just implemented the code changes in the patch provided by @gregorywojcik [here](https://github.com/NativeScript/NativeScript/issues/6377#issuecomment-433322681) references #6377
This commit is contained in:

committed by
Alexander Vakrilov

parent
bb5cec3ed3
commit
dcad754d1d
@ -131,7 +131,8 @@ export class WebView extends WebViewBase {
|
|||||||
|
|
||||||
public _loadUrl(src: string) {
|
public _loadUrl(src: string) {
|
||||||
if (src.startsWith("file:///")) {
|
if (src.startsWith("file:///")) {
|
||||||
this.ios.loadFileURLAllowingReadAccessToURL(NSURL.URLWithString(src), NSURL.URLWithString(src));
|
var cachePath = src.substring(0, src.lastIndexOf("/"));
|
||||||
|
this.ios.loadFileURLAllowingReadAccessToURL(NSURL.URLWithString(src), NSURL.URLWithString(cachePath));
|
||||||
} else {
|
} else {
|
||||||
this.ios.loadRequest(NSURLRequest.requestWithURL(NSURL.URLWithString(src)));
|
this.ios.loadRequest(NSURLRequest.requestWithURL(NSURL.URLWithString(src)));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user