Open kxc-wraikny opened 3 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Hi @kxc-wraikny. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
I have added link to the reproduction repo.
I can repro this issue on the latest Visual Studio 17.6.12(build410) (8.0.61 & 8.0.21)
Description
In macOS (
net8.0-maccatalyst
), I wrote the following code in order to openResources/Raw/foo/bar.html
inWebView
.The directory name
foo/
is ignored andbar.html
is tried to be read.I checked the implementation and found that the directory name is ignored in the following places.
https://github.com/dotnet/maui/blob/45a86865ffc44a501b1c4c8d6b50ee419d1696b9/src/Core/src/Platform/iOS/MauiWKWebView.cs#L176-L183
LoadFile
is called fromLoadUrlAsync
becausefoo/bar.html
is a invalid format URI.https://github.com/dotnet/maui/blob/45a86865ffc44a501b1c4c8d6b50ee419d1696b9/src/Core/src/Platform/iOS/MauiWKWebView.cs#L120-L134
It was possible to open the file from
Resources/Raw/index.html
with a reference to<a href="foo/bar.html" >foo/bar</a>"
. It was also possible to open the file by getting the full path fromOpenAppPackageFileAsync
as described in theworkaround
.Sorry if this is a limiting issue for other platforms such as iOS, however in that case it would be kind if it is commented in the documentation or source code.
Thanks.
Steps to Reproduce
Resources/Raw/foo/bar.html
.<WebView Source="foo/bar.html" />
element.Link to public reproduction project repository
https://github.com/kxc-wraikny/webview_ignores_subdir_on_macos_reproduction
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
macOS Sonoma 14.5
Did you find any workaround?
Relevant log output
No response