Giter VIP home page Giter VIP logo

minimalwebview's Introduction

MinimalWebView

build

A tiny .NET 6 Windows application that hosts web UI in WebView2. No UI framework, just a plain old Win32 message loop.

image

This is very bare-bones and is mostly useful as an educational example. If you're looking for more functionality, my MaximalWebView builds on top of this.

Motivation

This is an experiment to see how far I can push a slim Windows application that uses C# for the hosting logic and web UI for the "front-end".

The native UI situation on Windows is a little bleak and WebView2 ships with Windows 11, so it's a good time to lean into web UI a little more. But... the .NET team has been killing it recently, I'd like to write my code that lives outside Chromium in C# or F#.

Microsoft provides WinForms and WPF wrappers for WebView2, so I could embed web UI in a plain old .NET GUI app. But WinForms and WPF are big dependencies and they're mostly unnecessary for web UI. Why not see how far we can get with an old-school Win32 message pump?

Dependencies

Microsoft.Web.WebView2.Core to interact with WebView2, and CsWin32 to generate bindings to native Windows APIs (at compile time only).

Known Issues

The resulting application cannot currently be trimmed because of the way Microsoft.Web.WebView2.Core does COM interop. Please upvote this issue.

Credits

Initially derived from Vítězslav Imrýšek's handy CsWin32Playground, where he shows how to create a message pump using CsWin32.

minimalwebview's People

Contributors

rgwood avatar vitezslavimrysek avatar sylveon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.