New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix using local asset files on windows #16930
Conversation
Hey there @vividos! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run MAUI-DeviceTests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
@Eilon @jfversluis What's the status on this? Would it be possible to get this into .NET 8 GA? Thanks! |
I'm not very familiar with using WebView to load local app content so I'm not sure exactly how to evaluate this. I understand the general concept and the code looks to be following good practices. |
…to correctly setting the BaseUrl for an HtmlWebViewSource see also: dotnet/maui#16646 dotnet/maui#16930
@jfversluis @Eilon so what are the next steps here? |
/rebase |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
We're now running all kinds of new (Windows) tests as part of our pipeline so just rebased it and triggered all the things. Seems like this change isn't that risky, but the bar at this point is pretty high as we don't want to risk any regressions as we're closer to .NET 8 GA. Let's await the results here and I will bring it up. Thanks for your patience here! |
@jfversluis hey Gerald, any news if this PR can get in? Or will it go into a first patch release? Thanks! |
I think we'll have to defer this to after GA at this point, sorry, but it's coming! |
I think this also fixes the issue #6165 |
No, not when they set their own virtual hostname folder mapping, but when they use
It was developed in PR #7672 to fix #5523, but I guess it was never documented afterwards.
The virtual folder mapping is automatically used when using Thanks for reviewing this PR! I'll follow up with the requested changes. |
OK But it seems that when I use SetVirtualHostNameToFolderMapping I can set a sort of custom local scheme, correct? If I would set this through a custom handler for my WebView2, will this code in this PR still work? Or will it look for Or am I understanding this thing completely wrong? 😄 |
Your understanding is correct, this call on WebView2 establishes that local scheme. In UWP this could be done with the Good question on what would happen when a custom handler interferes with this, e.g. because someone already added a workaround. I would have to try that out... |
OK! If we can just check that and somehow take into account that scenario that would be great and we'd have a complete solution I think 😄 Thank you! |
Hi @vividos. We have added the "s/pr-needs-author-input" label to this issue, which indicates that we have an open question/action for you before we can take further action. This PRwill be closed automatically in 14 days if we do not hear back from you by then - please feel free to re-open it if you come back to this PR after that time. |
@jfversluis @MartyIX The commit I just made should solve the last remaining issue, so the PR should be ready. |
/azp run MAUI-UITests-public |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
… windows that should trigger a call to CoreWebView2.SetVirtualHostNameToFolderMapping()
…RL on windows that should set up virtual host name to folder mapping correctly
…mparison.OrdinalIgnoreCase
…about loading local assets
Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com>
Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com>
…iew2 data URI with inserted base tag
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
Thank you so much for your contribution! |
@jfversluis thanks Gerald for merging this! Do you have an estimation in which SR this will be going in? Thanks! |
Description of Change
This PR fixes both issues in #16646 on the windows platform.
The first commit fixes loading
WebView
content usingUrlWebViewSource
when theLocalScheme
is used, which ishttps://appdir/
.The second commit fixes the case when using
HtmlWebViewSource
and the specifiedBaseUrl
has aLocalScheme
, but the virtual host name to folder mapping is first set and then cleared again.Issues Fixed
Fixes #16646