Post

Replies

Boosts

Views

Activity

Reply to Loading Angular project in WKWebView: Cors issues on JS files
I've stumbled upon a similar issue and thus on this question, however I also did find fixes for some of these issues. First, as you already pointed out, is base href="/" needs to be changed to base href="./" Second, the type="module" can stay in the script tag, so no need to change that. Last, in your Swift code you need to set a preference key on WKWebView so it's allowed to load other files (fixing the "access control checks"). webView.configuration.preferences.setValue(true, forKey: "allowFileAccessFromFileURLs") I guess you've already found fixes for your issues and I hope this would help others too.
Nov ’24