My app have a WKWebView control. The webview is loading pages from local HTML files. The pages contains some files references (like pictures, css, js) and this files also stored in local filesystem (but not in the project resources folder). How to set proper Uri for this files?
I have tried several different places for the files:
I have tried to use it with and without "file://" prefix, but nothing works.
If i try to read this files directly from C# code (
File.ReadAllText()), then i can see this files are exists and have correct content, but webview doesn't display the images and doesn't load css/js files.
example file writing:
File.WriteAllText(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "Static/", fileName), content);
example HTML with local file reference:
<link href="file:///var/mobile/Containers/Data/Application/4675A5AF-A3DD-457E-8B8B-BFABD4EF4AB8/Documents/.config/Static/0.css" rel="stylesheet">