Skip to content

Repository files navigation

AWV.WebView.Avalonia

  • Cross-platform WebView control for Avalonia. Supports Windows, Linux (GTK), and Android.

Setup

Windows

  1. Make sure your project targets the Windows-specific TFM to support WinForms/WPF components:
<TargetFramework>net9.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
  • or you can add this to your csproj
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
    <UseWindowsForms>true</UseWindowsForms>
    <TargetFramework>net9.0-windows</TargetFramework>
</PropertyGroup>
  1. Then you can add the WebView in your .axaml:
<awv:WebView Url="https://www.github.com"/>

Note


Linux

  1. Ensure the following native dependencies are installed:
# libgtk-3 and libwebkit2gtk
sudo pacman -Syu gtk3 webkit2gtk
  1. Target plain net9.0 in your .csproj:
<TargetFramework>net9.0</TargetFramework>
  1. Add the WebView in your XAML the same way:
<awv:WebView Url="https://www.github.com"/>

Android

  1. Target net9.0-android in your .csproj.
  2. No additional setup is required; permissions are declared in the Android manifest.
  3. Usage in XAML is the same as above.

Dependencies

  • Linux: libgtk-3 and libwebkit2gtk
  • Windows: WebView2 runtime

Tested Platforms

Windows 11

Windows_preview.png

Arch Linux

Linux_preview.png

Android

Android_preview.png

Notes

  • This project started as side project of my bigger project, so it might not be perfect.
  • The control automatically picks the correct platform implementation.
  • WindowsForms is required only for Windows. Using it on Linux/macOS will fail at build time.
  • If you found any issues, or want some features to add, please report them on the Issues page.

License

About

WebView for Avalonia UI on multiple platforms.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages