Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit e5404e8

Browse files
committed
fix: undefined fs in iOS
1 parent 23ab883 commit e5404e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/webview-ext.ios.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="./types/ios/NotaWebViewExt.d.ts" />
22

33
import "@nativescript/core";
4-
import { alert, confirm, profile, prompt, Trace } from "@nativescript/core";
4+
import { alert, confirm, profile, prompt, Trace, File, knownFolders } from "@nativescript/core";
55
import { isEnabledProperty } from "@nativescript/core/ui/core/view";
66
import { webViewBridge } from "./nativescript-webview-bridge-loader";
77
import { autoInjectJSBridgeProperty, NavigationType, scrollBounceProperty, WebViewExtBase } from "./webview-ext-common";
@@ -197,7 +197,7 @@ export class WebViewExt extends WebViewExtBase {
197197
return;
198198
}
199199

200-
const baseUrl = `file:///${fs.knownFolders.currentApp().path}/`;
200+
const baseUrl = `file:///${knownFolders.currentApp().path}/`;
201201
const nsBaseUrl = NSURL.URLWithString(baseUrl);
202202

203203
this.writeTrace(`WKWebViewWrapper.loadUrl(content) -> this.ios.loadHTMLStringBaseURL("${nsBaseUrl}")`);
@@ -366,7 +366,7 @@ export class WebViewExt extends WebViewExtBase {
366366
return;
367367
}
368368

369-
const scriptCode = await fs.File.fromPath(filepath).readText();
369+
const scriptCode = await File.fromPath(filepath).readText();
370370

371371
this.addNamedWKUserScript(resourceName, scriptCode);
372372
}

0 commit comments

Comments
 (0)