FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(ios-webview): loading of local-file dependency (#6947) · NativeScript/NativeScript@dcad754 · GitHub

Commit dcad754

Browse files
authored andcommitted
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](#6377 (comment)) references #6377
1 parent bb5cec3 commit dcad754

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎tns-core-modules/ui/web-view/web-view.ios.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export class WebView extends WebViewBase {
131131

132132
public _loadUrl(src: string) {
133133
if (src.startsWith("file:///")) {
134-
this.ios.loadFileURLAllowingReadAccessToURL(NSURL.URLWithString(src), NSURL.URLWithString(src));
134+
var cachePath = src.substring(0, src.lastIndexOf("/"));
135+
this.ios.loadFileURLAllowingReadAccessToURL(NSURL.URLWithString(src), NSURL.URLWithString(cachePath));
135136
} else {
136137
this.ios.loadRequest(NSURLRequest.requestWithURL(NSURL.URLWithString(src)));
137138
}
@@ -160,4 +161,4 @@ export class WebView extends WebViewBase {
160161
public reload() {
161162
this.ios.reload();
162163
}
163-
}
164+
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL