Open HelloooJoe opened 7 months ago
I have the same error on Android Devices. MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:EZTestMauiApp"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:ejl="clr-namespace:HybridWebView;assembly=HybridWebView"
x:Class="EZTestMauiApp.MainPage"
BackgroundColor="#ffffff">
<ContentPage.Behaviors>
<toolkit:StatusBarBehavior StatusBarColor="#000000" StatusBarStyle="Default" />
</ContentPage.Behaviors>
<RefreshView x:Name="refreshView" Command="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}">
<ejl:HybridWebView x:Name="hybridWebView" HybridAssetRoot="hybrid_root" RawMessageReceived="OnHybridWebViewRawMessageReceived" />
</RefreshView>
</ContentPage>
MainPage.xaml.cs
public ICommand RefreshCommand { get; }
private bool isRefreshing;
public MainPage()
{
InitializeComponent();
RefreshCommand = new Command(ExecuteRefreshCommand);
BindingContext = this;
}
private void ExecuteRefreshCommand()
{
Debug.WriteLine("ExecuteRefreshCommand triggered");
hybridWebView.Reload();
Task.Delay(2000).ContinueWith(t =>
{
IsRefreshing = false;
Console.WriteLine("After ExecuteRefreshCommand refreshView: " + refreshView.IsEnabled);
});
}
There is 'Resource not found (404)' on the screen.
I use VueJS Framework to develop the UI, so it's a SPA web page. All the urls are virtual.
Description
When using the HybridWebView experiment in a .NET MAUI application on a desktop platform, refreshing the page leads to a 404 error. This issue affects the usability and the user experience, especially during development and testing phases.
Steps to Reproduce
Expected Behavior
The application should reload the current page/content within the HybridWebView without any errors, preserving the user's state and context where applicable.
Actual Behavior
The application fails to find the requested page after a refresh and displays a 404 error, indicating that the resource cannot be found.
Possible Solutions or Suggestions
Question
Is handling refresh actions on the desktop within the scope of the HybridWebView control, or should it be managed at the application level? Any guidance on best practices or recommendations would be greatly appreciated.
Environment
Additional Context
Add any other context or screenshots about the enhancement request here.