maui-hybridwebview

Embed web content and enable bidirectional JavaScript–C# interop in .NET MAUI apps.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Petelids/Sudoku --skill maui-hybridwebview-petelids
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maui-hybridwebview
Source: https://github.com/Petelids/Sudoku/tree/main/skills/maui-skills/maui-hybridwebview
Command: npx skills add https://github.com/Petelids/Sudoku --skill maui-hybridwebview-petelids

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers integrate web content into .NET MAUI apps by enabling bidirectional JavaScript–C# communication via HybridWebView, simplifying hybrid UI patterns and local asset hosting.

Core Features & Use Cases

  • Bidirectional JavaScript–C# interop between the MAUI host and embedded web content.
  • Local web assets hosting under Resources/Raw/wwwroot with configurable root.
  • Raw messaging and JSON-typed interop with a generated JsonSerializerContext for type-safe data transfer.
  • Lightweight embedding suitable for embedding small web UIs and bridging web content to native app logic.

Quick Start

Add a HybridWebView to your MAUI page, set DefaultFile to index.html, and wire RawMessageReceived to begin JavaScript–C# interop.

Frequently Asked Questions about maui-hybridwebview

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call C# methods from JavaScript in a .NET MAUI app?

To call C# methods from JavaScript in a .NET MAUI app, use the HybridWebView control to enable bidirectional JavaScript-C# interop. You must include the HybridWebView bridge script in your index.html file to establish the communication channel for invoking native methods.

What is the best way to embed local web content in a MAUI application?

The best way to embed local web content in a MAUI application is using the HybridWebView control. It hosts local web assets under the Resources/Raw/wwwroot directory and provides a configurable root path for organizing your HTML, CSS, and JavaScript files.

Can I send typed JSON data between JavaScript and C# in a MAUI HybridWebView?

Yes, you can send typed JSON data between JavaScript and C# in a MAUI HybridWebView. It uses a source-generated JsonSerializerContext with JsonSerializable types to ensure safe, typed data transfer during bidirectional web-to-native interop communication.

Does the MAUI HybridWebView work across both mobile and desktop targets?

Yes, the MAUI HybridWebView works across both mobile and desktop targets. It enables hybrid UIs that host local web content and require web-to-native interop, allowing you to invoke JavaScript functions from C# and call C# methods from JavaScript consistently.

Why does my MAUI HybridWebView fail to load local web assets?

Your MAUI HybridWebView might fail to load local web assets if they are not placed under the Resources/Raw/wwwroot directory. The control enforces this specific asset placement and requires the index.html file to include the HybridWebView bridge script.

How do I start using JavaScript-C# interop in MAUI?

To start using JavaScript-C# interop in MAUI, add a HybridWebView control to your page, set its DefaultFile property to index.html, and wire up the RawMessageReceived event handler. This establishes the bridge for raw messaging between web content and native logic.