Closed kritsadadechawantana closed 2 years ago
I have the same need here. I found a temp fix while an official one is released :
In order for WkWebView to work with local content, we need to : 1/ Set the private api allowFileAccessFromFileURLs 2/ Save html file to app's Library or Documents folder (or subfolder). 3/ Set baseUrl to the html's containing folder 4/ Put all resources needed (pictures, thumbnails, assets) in the html's containing folder or subfolder. 5/ Use WkWebView.LoadFileUrl(uri, baseUri)
Note : BundlePath is accessible but readonly
Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes.
If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks!
Description
i can't use local image reference in html with WKWebview
Steps to Reproduce
Expected Behavior
i need to display local images from local path like this "/var/mobile/Containers/Data/Application/BBD4FB76-852B-4BC8-BACF-A1DEAFE31C1F/Documents/mcontent/images/"