From 02ea48788d39cbf8c8c27344b660c3946acb13f2 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Sun, 19 Apr 2026 09:21:17 -0500 Subject: [PATCH] fix: delegate ShouldInterceptRequest in DevFlowWebViewClient DevFlowWebViewClient replaces MAUI's WebKitWebViewClient on Android but was not delegating ShouldInterceptRequest to the inner client. This broke local asset serving for all Blazor Hybrid apps because MAUI's ShouldInterceptRequest is the mechanism that serves wwwroot/ assets via the https://0.0.0.1/ custom scheme. Without this delegation, all CSS and JS asset requests fail (the base WebViewClient returns null = 'don't intercept'), Blazor never initializes, and the app is stuck on the loading screen. Fixes #101 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../BlazorWebViewDebugService.Android.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/DevFlow/Microsoft.Maui.DevFlow.Blazor/BlazorWebViewDebugService.Android.cs b/src/DevFlow/Microsoft.Maui.DevFlow.Blazor/BlazorWebViewDebugService.Android.cs index ca0719de3..29c7c5100 100644 --- a/src/DevFlow/Microsoft.Maui.DevFlow.Blazor/BlazorWebViewDebugService.Android.cs +++ b/src/DevFlow/Microsoft.Maui.DevFlow.Blazor/BlazorWebViewDebugService.Android.cs @@ -137,6 +137,11 @@ public override void OnPageFinished(AWebView? view, string? url) } } + public override WebResourceResponse? ShouldInterceptRequest(AWebView? view, IWebResourceRequest? request) + { + return _innerClient?.ShouldInterceptRequest(view, request) ?? base.ShouldInterceptRequest(view, request); + } + public override bool ShouldOverrideUrlLoading(AWebView? view, IWebResourceRequest? request) { return _innerClient?.ShouldOverrideUrlLoading(view, request) ?? base.ShouldOverrideUrlLoading(view, request);