Mafesoft.Maui.AdvancedWebView
1.0.0
See the version list below for details.
dotnet add package Mafesoft.Maui.AdvancedWebView --version 1.0.0
NuGet\Install-Package Mafesoft.Maui.AdvancedWebView -Version 1.0.0
<PackageReference Include="Mafesoft.Maui.AdvancedWebView" Version="1.0.0" />
<PackageVersion Include="Mafesoft.Maui.AdvancedWebView" Version="1.0.0" />
<PackageReference Include="Mafesoft.Maui.AdvancedWebView" />
paket add Mafesoft.Maui.AdvancedWebView --version 1.0.0
#r "nuget: Mafesoft.Maui.AdvancedWebView, 1.0.0"
#:package Mafesoft.Maui.AdvancedWebView@1.0.0
#addin nuget:?package=Mafesoft.Maui.AdvancedWebView&version=1.0.0
#tool nuget:?package=Mafesoft.Maui.AdvancedWebView&version=1.0.0
AdvancedWebView
AdvancedWebView is a lightweight WebView for .NET MAUI (Android and iOS). It extends the built-in MAUI WebView, so navigation events, cookies and user agent keep working, and it adds platform settings that the standard control does not expose.
Requirements
- .NET 10
- Android 5.0 (API 21) or later
- iOS 15 or later
Installation
dotnet add package Mafesoft.Maui.AdvancedWebView
Register the handler in MauiProgram.cs:
using Mafesoft.Maui.Controls;
builder
.UseMauiApp<App>()
.UseAdvancedWebView();
Usage
<ContentPage xmlns:awv="clr-namespace:Mafesoft.Maui.Controls;assembly=Mafesoft.Maui.AdvancedWebView">
<awv:AdvancedWebView
x:Name="WebView"
Source="https://dotnet.microsoft.com"
JavaScriptEnabled="True"
ScrollBouncesEnabled="False"
Navigating="OnNavigating" />
</ContentPage>
// Block a URL
void OnNavigating(object sender, WebNavigatingEventArgs e)
{
if (e.Url.StartsWith("https://ads.")) e.Cancel = true;
}
// Clear the HTTP cache
WebView.ClearCache();
Properties
| Property | Default | Android | iOS | Notes |
|---|---|---|---|---|
JavaScriptEnabled |
true |
✔ | ✔ | iOS: read when the view is created |
JavaScriptCanOpenWindowsAutomatically |
false |
✔ | ✔ | iOS: read when the view is created |
ScrollBouncesEnabled |
false |
✔ | ✔ | Android: overscroll glow |
MediaPlaybackRequiresUserGesture |
false |
✔ | ✔ | iOS: read when the view is created |
AllowsInlineMediaPlayback |
true |
✔ | Read when the view is created | |
AllowMixedContent |
false |
✔ | HTTP resources in HTTPS pages | |
AllowFileAccess |
false |
✔ | file:// and content:// URLs |
|
CacheMode |
Default |
✔ | Default, NoCache, CacheOnly, CacheElseNetwork |
Inherited from the MAUI WebView: Source, UserAgent, Cookies, Navigating, Navigated, EvaluateJavaScriptAsync, GoBack, GoForward, Reload.
Methods
| Method | Description |
|---|---|
ClearCache() |
Clears the HTTP cache (memory and disk). Cookies and local storage are kept. |
Sample app
samples/AdvancedWebView.Sample is a small browser that shows every feature: switches for the properties, cache mode picker, ClearCache(), URL blocking in Navigating, EvaluateJavaScriptAsync, and a local test page for alert(), confirm() and window.open().
dotnet build samples/AdvancedWebView.Sample -t:Run -f net10.0-android
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net10.0-ios26.0 is compatible. |
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.120)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.120)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.