Giter Site home page Giter Site logo

webwindow's Introduction

WebWindow

A WebkitGtk Window for building native AoT desktop applications on Linux using web technologies, C#, and .NET

Why?

.NET Maui is not completely multi-platform; it doesn't support Linux. Therefore, there is no Microsoft supported way to create desktop applications in C# and .NET using web technologies.

I created a WebKit-based Blazor WebView that can be used to create Blazor Hybrid applications on Linux, but on low-spec ARM devices the startup time can be rather poor. This could be fixed with native AoT, but native AoT currently generates unusable code for anything with Razor components (including Blazor) causing the application to either segfault or otherwise not function properly.

This solution does not use Razor commponents. Instead it simply exposes the WebKitGTK WebView's DOM with Javascript interop so DOM manipulation can be done in C#. Because there are no Razor components, this solution can be compiled with native AoT for fast start times while still providing convenient DOM manipulation in C#.

Run the Demonstration

git clone https://github.com/JinShil/WebWindow.git
cd WebWindow/WebWindow.Test
dotnet run

Run the Demonstration with Native AoT

You may need to install these dependencies:

sudo apt-get install clang zlib1g-dev

Then publish the project with Native AoT.

cd WebWindow/WebWindow.Test
dotnet publish -r linux-x64 -c Release --self-contained=true -p:PublishAot=true -p:StripSymbols=true

If you get an error about not being able to find -lstdc++ try this and then run the publish command again.

sudo apt install libstdc++-12-dev

Then run the resulting executable:

./bin/Release/net8.0/linux-x64/publish/WebWindow.Test

webwindow's People

Contributors

jinshil avatar

Stargazers

ShadowEO avatar Lars Baunwall avatar Anderson Fernandes do Nascimento avatar HuaFangYun avatar

Watchers

 avatar  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.