Chromely
Chromely is a lightweight alternative to Electron.NET, Electron for .NET/.NET Core developers.
Chromely is a .NET/.NET Core HTML5 Chromium desktop framework. It is focused on building apps based on Xilium.CefGlue, CefSharp implementations of embedded Chromium (Cef) without WinForms or WPF. Chromely uses Windows and Linux native GUI API as "thin" chromium hosts. It can be extended to use WinForms or WPF.
With Chromely you can build Single Page Application (SPA) HTML5 desktop apps with or without Node/npm. Building SPA apps using javascript frameworks like Angular, React, Vue or similar is easy. You can use Visual Studio Code or any IDE you are familiar with as long as Chromely knows the entry html file from the compiled/bundled files. For more info please see - Chromely-Apps.
Options of communicating (IPC) with rendering process are via:
- .NET/Javascript integration (CefSharp) - more info @ Expose .NET class to JavaScript.
- Generic Message Routing (Xilium.CefGlue) - more info @ Generic Message Routing.
- Ajax HTTP/XHR (Xilium.CefGlue, CefSharp) - more info @ Custom Scheme Handling.
Roadmap & Help Wanted
If you like Chromely, please give it a star - it helps!
Have a quick question? Wanna chat? Connect on
Platforms
Cross-platform - Windows, Linux. Built on CefGlue, CefSharp, NET Standard 2.0, .NET Core 2.0, .NET Framework 4.61 and above.
For more info/documentation, please check Chromely wiki.
Creating a Simple App (Using CefGlue with Winapi host)
For more info see - Getting Started
class Program
{
static int Main(string[] args)
{
string startUrl = "https://google.com";
ChromelyConfiguration config = ChromelyConfiguration
.Create()
.WithAppArgs(args)
.WithHostSize(1000, 600)
.WithStartUrl(startUrl);
var factory = WinapiHostFactory.Init();
using (var window = factory.CreateWindow(() => new CefGlueBrowserHost(config),
"chromely", constructionParams: new FrameWindowConstructionParams()))
{
window.SetSize(config.HostWidth, config.HostHeight);
window.CenterToScreen();
window.Show();
return new EventLoop().Run(window);
}
}
}
dotnet cli demo template install
Run Starter Template (Using dotnet core cli). For more info, please see -dotnet new -i "Chromely.CefGlue.Win.Template::*"
dotnet new chromelywin
dotnet restore
dotnet build
dotnet chromelycef.dll download v65 --cpu=x64 --dest="bin\Debug\netcoreapp2.1"
dotnet run
Chromely Demos
For more info on demos - Demos
References
- WinApi - https://github.com/prasannavl/WinApi
- Cef - https://bitbucket.org/chromiumembedded/cef
- Xilium.CefGlue - https://bitbucket.org/xilium/xilium.cefglue/wiki/Home
- CefSharp - https://github.com/cefsharp/CefSharp
- Json Serializer - https://github.com/lbv/litjson
- Caliburn.Light Container - https://github.com/tibel/Caliburn.Light/blob/master/src/Caliburn.Core/IoC/SimpleContainer.cs
Contributing
Contributions are always welcome, via PRs, issues raised, or any other means.
Author
License
MIT-licensed
Credits
Thanks to JetBrains for the OSS license of Resharper Ultimate.
Improved and optimized using: