Giter Club home page Giter Club logo

chromely's Introduction

** Announcement ** - Chromely is no longer being maintained!

For those who would like to continue working on the project via forks or alternative approaches, please send mattkol the appropriate links and they will be added here.

Thanks to all the contributors over the years for making the platform a great learning place.

Thank you all.

Chromely


For developers who are interested in WebView2 there is EdgeSharp, an offshoot of 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, but can be extended to use WinForms or WPF. Chromely uses Windows, Linux and MacOS native GUI API as "thin" chromium hosts.

With Chromely you can build Single Page Application (SPA) HTML5 desktop apps with or without Node/npm. Building SPA apps using Blazor or 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 - Blazor-Demos and Chromely-Apps.

Options of communicating (IPC) with rendering process are via:

If you like Chromely, please give it a star - it helps!

Have a quick question? Wanna chat? Connect on Join the chat at https://gitter.im/chromely_/Lobby

Have an app/project/tool using Chromely - please share!

Platforms

Cross-platform -Windows, Linux, MacOS. Built on CEF, CefGlue, NET Standard 2.0, .NET Core 3.0, .NET Framework 4.61 and above.

  • Windows(1) 32-bit
  • Windows(1) 64-bit
  • Linux(2) 32-bit
  • Linux(2) 64-bit
  • MacOSX(3) 64-bit
  • Linux ARM(4) Raspberry Pi

 (1)  Windows 7, Service Pack 1 and newer
 (2)  Ubuntu 16.04 and newer
       (Mono currently not working)
 (3)  Tested on macOS Mojave 10.14.6 (Other versions will likely work too)
 (4)  i.e. Raspberry Pi 3+ (starting with v5.x)
       (for v4.x - manual download of CEF builds for ARM required, available on http://chromely.org/cefbuilds/index.html)

Chromely.Core Chromely Chromely.Owin

Chromely + Angular
Chromely + React
Chromely + Vue

Creating a Simple App

For more info see - Getting Started or Wiki

A basic Chromely project requires:

ThreadApt.STA();

AppBuilder
    .Create(args)
    .UseApp<ChromelyBasicApp>()
    .Build()
    .Run();

Chromely Demos

Get started with our demos.

References

Contributing

Contributions are always welcome, via PRs, issues raised, or any other means. To become a dedicated contributor, please contact the Chromely team or raise an issue mentioning your intent.

License

Chromely is MIT licensed. For dependency licenses please see.

chromely's People

Contributors

8 avatar axel-habermaier avatar biohazard999 avatar dependabot[bot] avatar donotcodeit avatar elgonzo avatar esskar avatar fiahblade avatar frankpfattheicher avatar gitter-badger avatar gustavohennig avatar hecatron avatar mattkol avatar michal-paukert-tfs avatar novustheory avatar progsung avatar rupertavery avatar smx-smx avatar soarc avatar steveboyd avatar viceice avatar windwang avatar xplicit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chromely's Issues

Unable to load DLL 'libcef'

Tried >dotnet restore => works well.

C:\Works\Work-Chromely>dotnet run
2018-05-31 20:48:05.258 [ERROR] Oops! Something went wrong. Unable to load DLL 'libcef':
.
(Exception from HRESULT: 0x8007007E) at Xilium.CefGlue.Interop.libcef.api_hash(Int32 entry)
at Xilium.CefGlue.CefRuntime.CheckVersionByApiHash()
at Xilium.CefGlue.CefRuntime.Load(String path)
at Chromely.CefGlue.Winapi.ChromeHost.CefGlueBrowserHost.OnCreate(CreateWindowPacket& packet)
at WinApi.Windows.Packetizer.ProcessCreate(WindowMessage& msg, EventedWindowCore window)
at WinApi.Windows.WindowCore.WindowProc(IntPtr hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
..
Missing some pre-conditions ??

MacOS?

Nice work!

Does this also work on MacOS?

Thanks,
Peter

Dev tools

Is it possible to open chrome dev tools for debugging?

Opening multiple windows in Chromely

Is there a way to open multiple chromely windows? Say for instance I want to open a new link in another chromely window. I have tried using window.open() or links with target _blank but nothing appears to happen.

If register as externalurl it opens in separate browser but I want it to open in another chromely window.

Additionally I was thinking of creating a loading screen where I have one window open and then when it closes I open a second main one. Is that possible with chromely?

libui .net core bindings

Related with the mac os compatibility, have you seen these .Net Core bindings for libui?
As we need only a main window, maybe it is easier to integrate it?

Another related question. Do you know if the mac os (last version) allows the application to listen in local port for calls/events from the UI? I don't want to depend only in the internal message loop for the communication. In Windows, I don't know about the UWP, but desktop bridge applications can listen in localhost.

Fullscreen Not working CefGlue Gtk (Linux) Version 68

I have been developing against the "old" dll's provided in issue #48 and wanted to ask about the ability to close the window and open a new one after one is already opened; however, before making a new post I wanted to make sure I had the newest code. I updated to CefGlue Version 68 and tried testing the code and it appears that the full-screen functionality no longer works. Using the following code does not create a full-screen window.

            string startUrl = "http://www.google.com";
            ChromelyConfiguration config = ChromelyConfiguration
                                          .Create()
                                          .WithHostTitle("chromely")
                                          .WithAppArgs(args)
                                          .WithStartUrl(startUrl)
                                          .WithHostMode(Chromely.Core.Host.WindowState.Fullscreen, false)
                                          .WithHostSize(1280, 1024)

                                           //Set multi-threaded_message_loop false
                                           //only supported on windows
                                           .WithCustomSetting(CefSettingKeys.MultiThreadedMessageLoop, false)

                                           .WithCommandLineArg("disable-gpu", "1")
                                           .WithCommandLineArg("disable-gpu-compositing", "1")
                                           .WithCommandLineArg("disable-smooth-scrolling", "1")
                                           .WithCommandLineArg("no-sandbox", "1");

            using (app = new CefGlueBrowserWindow(config))
            {
                return app.Run(args);
            }

When run, this creates a non-full-screen window in which the browser never loads.

2018-12-17 12:36:01.688 [INFO] CefRuntime.ExecuteProcess() returns -1
[1217/123602.755251:ERROR:gpu_process_transport_factory.cc(1026)] Lost UI shared context.

DevTools listening on ws://127.0.0.1:20480/devtools/browser/4f0f3d7c-c08b-4571-9806-f4f781b27f9b
[1217/123603.015621:ERROR:backend_impl.cc(1423)] Unable to map Index file
[1217/123603.038694:ERROR:backend_impl.cc(1423)] Unable to map Index file
[1217/123603.043017:ERROR:disk_cache.cc(169)] Unable to create cache
[1217/123603.044592:ERROR:shader_disk_cache.cc(600)] Shader Cache Creation failed: -2
[1217/123603.591586:ERROR:service_manager_context.cc(250)] Attempting to run unsupported native service: /home/wesley/Shared/Chromely - Copy/publish/content_renderer.service
[1217/123604.266971:ERROR:sandbox_linux.cc(378)] InitializeSandbox() called with multiple threads in process gpu-process.

The output appears to be the same problem occurring with the original update.

corert compiled binaries not working

I have used CoreRT, (NET Core runtime optimized for AOT ) to build my Chromely sample app. It successfully generated native binaries. But when the executable generated following error. Unable to load DLL 'libcef': specified module is not available.

Frameless windows...?

I'm sorta a noob but I have no idea how to make the window frameless... I've heard of WM_NCHITTEST but can't find it in the window flags... thanx

Visual studio 2017

Hello, Thank you for this beautiful project!

I followed these steps: https://github.com/mattkol/Chromely/wiki/dotnet-cli-Starter-Template
And it works well.

But when I open the project in vs2017 and run the debug.
I have an empty window an the dotnet console open with this message

2018-07-04 19:29:25.726 [ERROR] Oops! Something went wrong.     Unable to load DLL 'libcef' or one of its dependencies: Le module spécifié est introuvable. (Exception from HRESULT: 0x8007007E)           at Xilium.CefGlue.Interop.libcef.api_hash(Int32 entry)
   at Xilium.CefGlue.CefRuntime.CheckVersionByApiHash()
   at Xilium.CefGlue.CefRuntime.Load(String path)
   at Chromely.CefGlue.Winapi.ChromeHost.CefGlueBrowserHost.OnCreate(CreateWindowPacket& packet)
   at WinApi.Windows.Packetizer.ProcessCreate(WindowMessage& msg, EventedWindowCore window)
   at WinApi.Windows.WindowCore.WindowProc(IntPtr hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
2018-07-04 19:29:25.756 [ERROR] Oops! Something went wrong.     Object reference not set to an instance of an object.
   at Chromely.CefGlue.Winapi.ChromeHost.CefGlueBrowserHost.OnSize(SizePacket& packet)
   at WinApi.Windows.Packetizer.ProcessSize(WindowMessage& msg, EventedWindowCore window)
   at WinApi.Windows.WindowCore.WindowProc(IntPtr hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
2018-07-04 19:29:25.779 [ERROR] Oops! Something went wrong.     Object reference not set to an instance of an object.
   at Chromely.CefGlue.Winapi.ChromeHost.CefGlueBrowserHost.OnSize(SizePacket& packet)
   at WinApi.Windows.Packetizer.ProcessSize(WindowMessage& msg, EventedWindowCore window)
   at WinApi.Windows.WindowCore.WindowProc(IntPtr hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam)

(I'am on windows 64 and with the last Chromely)

I tested these steps : https://github.com/mattkol/Chromely/wiki/CefGlue-Application-Layout, but with no sucess.

Do you understand more me ?

Thank you !

Android Support

Hi,

I am curious if Chromely does support Android Platform ?
If no, what is the reason ?

Thanks

.....

Please delete it. something wrong with Github

Linux-x64 Ubuntu 18.04 Unable to load DLL 'kernel32'

Wut

.Net Core 2.0
Chromely.Core
WinAPI
Chromely.CefGlue.Winapi

Program.cs:

using Chromely.CefGlue.Winapi;
using Chromely.CefGlue.Winapi.ChromeHost;
using Chromely.Core;
using Chromely.Core.Helpers;
using WinApi.Windows;

namespace CoreTest
{
    class Program
    {
        static int Main(string[] args)
        {
            string startUrl = "https://www.google.com/";

            ChromelyConfiguration config = ChromelyConfiguration
                                          .Create()
                                          .WithAppArgs(args)
                                          .WithHostSize(1000, 600)
                                          // The single process should only be used for debugging purpose.
                                          // For production, this should not be needed when the app is published 

                                          // Alternate approach for multi-process, is to add a subprocess application
                                          //.WithCustomSetting(CefSettingKeys.BrowserSubprocessPath, path_to_sunprocess)
                                          .WithCustomSetting(CefSettingKeys.SingleProcess, true)
                                          .WithStartUrl(startUrl);

            var factory = WinapiHostFactory.Init();
            using (var window = factory.CreateWindow(() => new CefGlueBrowserHost(config),
                  "SNIPR Test", constructionParams: new FrameWindowConstructionParams())) {
                window.SetSize(config.HostWidth, config.HostHeight);
                window.CenterToScreen();
                window.Show();
                return new EventLoop().Run(window);
            }
        }
    }
}

.....

Please delete it. something wrong with Github

....

Please delete it. something wrong with Github

I Can not run the Demo

  1. I have download cef3.3359_window64
  2. Copy all files from /Release to the demo folder.
    Copy all files from /Resources to demo folder.
    3.when I run cefglue_winapi_demo.exe , it is a blank

CPU's consumption

Hi, nice and interesting open source project, thank you!
I did run the demos and compiled my .Net Core application following the instructions in the Getting-Started-CefGlue-Winapi-(.NET-Core)

I noticed that in all precompiled demos and in my new project, the CPU's consumption is 30-35% continuously.
crhomelyappt_2

What provokes such high consumption?
another question. In case of "multi-process", I don't understand what path to give

         .WithCustomSetting(CefSettingKeys.BrowserSubprocessPath, path_to_sunprocess)

Thanks!

Getting to run Chromely with GTK on windows and linux

In your demo on "Getting Started CefGlue Gtk (Linux)" you write:

var factory = WinapiHostFactory.Init();
            using (var app = new CefGlueBrowserHost(config))

this class seems to be from CefGlue.WinApi.
Is WinApi and CefGlue.WinApi required to run on linux? the wiki page doesn't mention them.

Even with those 2 packages, it won't run on windows, because Cef is missing.
So I added cef like written further down on the wiki page.

I then installed the gtk+ 64bit runtime in v2.24 from
https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer

(installing the 32bit version will throw BadImageFormatException)

With this installed, I got this exception:
Exception thrown: 'System.DllNotFoundException' in Chromely.CefGlue.Gtk.dll:
'gtksharpglue-2'

After googling I found, that I need Gtk# to be installed from http://www.mono-project.com/download/stable/

Now I get BadImageFormatException agai, presumably, because Gtk# doesn't ship a 64bit version.
at Chromely.CefGlue.Gtk.ChromeHost.NativeMethods.Win.gtksharp_gtk_widget_get_window(IntPtr widget)

Is 64bit required for Chromely or would it run in32bit mode, too?

....

Please delete it. something wrong with Github

CefSharp PUT and DELETE methods

I noticed that the default JS handler for CefSharp only implements the get and post methods. I started to create my own JS handler but after looking at the source code, if I understand correctly, the method kinds to get kinda lost and bundled only with an identification on route string instead.

Am I right in thinking this? If so, are there plans to fully support PUT AND DELETE for CefSharp? If I'm confused, how would I get puts and deletes working?

Thanks.

Route parameter identifier

Is there a way to achieve a route like the following...

this.RegisterGetRequest("/conversations/id:", this.GetConversation);

where the route will match id any value placed after /conversations part of the route. For example:

/conversations/ce20e093-9726-4607-85ac-a8eba25533c1

Thanks.

Razor pages

In the use case where we want to deliver a ASP.NET Core Web Application locally, Electron works and I have delivered several of these.

The Demo project for Chromely looks great but does not use Razor pages to deliver content.

I am wondering how to make Chromely work with an ASP.NET Core Web Application -> Web Application (i.e. using Razor pages).

It would be great to use Chromely instead of electron.
Do you have any examples of this yet?

Thank you.

How to hide the right click menu?

Hi,

It's not a issue, maybe it's feature reqiure, how to hide the right click menu? is there any option to do that? I don't want user click the right menu the "Show DevTools" and "Close DevTools" to review source code.

Thanks,
Jack

Duplex communication like Electron.Net IPC

Hi does this have duplex Communication between c# layer and JavaScript layer?
from what I’ve seen its more of a one way Restful client / server setup from JavaScript at the moment....
how do i also communicate with JavaScript layer from c# layer....
I’m really just looking to shoot messages both ways asynchronously
Im Using CefSharp version but if CefGlue is easyier please let me know....
Regards

locale resources are not loaded

Whenever i try run myapp.exe it starts a window but its just blank. debug.log has the following error

[0614/010709.822:WARNING:resource_bundle.cc(563)] locale resources are not loaded

and in dev tools the console has this error

Not allowed to load local resource: file:///{path to project}\bin\Debug\index.html

Blazor support

Currently I'm working on a project to bring blazor to desktop: blaster

Good to see a lightweight alternative to electron in c# 👍

But I've troubles where to catch up to serve the blazor files. Basically I need just a hint where to handle the mime types chromium serves for the example IIS config.

Thats the output of the blazor publish:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".dll" />
      <remove fileExtension=".json" />
      <remove fileExtension=".wasm" />
      <remove fileExtension=".woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".dll" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".json" mimeType="application/json" />
      <mimeMap fileExtension=".wasm" mimeType="application/wasm" />
      <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
      <mimeMap fileExtension=".woff2" mimeType="application/font-woff" /> 
    </staticContent>
    <httpCompression>
      <dynamicTypes>
        <add mimeType="application/octet-stream" enabled="true" />
        <add mimeType="application/wasm" enabled="true" />
      </dynamicTypes>
    </httpCompression>
    <rewrite>
      <rules>
        <rule name="Serve subdir">
          <match url=".*" />
          <action type="Rewrite" url="Blaster.Blazor\dist\{R:0}" />
        </rule>
        <rule name="SPA fallback routing" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="Blaster.Blazor\dist\" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Awesome project :)

Improvement Suggestion

First of all Thanks for creating this beautiful library 👏 and Thanks for understanding .net people inner thoughts 👍

Unfortunately from Doc look like Chormely does not work on mac.
May I suggest you a solution.
Avalonia Most popular .net core UI it build successfully on mac as well, It has a Chromium Embedded Framework (CEF) By using It there should be no issue with builds.
I think Its most stable way for chromely.

Please share your thoughts on it.

Full screen?

This may not exactly be a Chromely issue, but I'm trying to figure out how to create a full screen window.

I've discovered the

WS_MAXIMIZE

flag, but that seems to only maximize the window within the constraints set by the ChromelyConfiguration. Is there a built in way to do this? Thanks.

DI for JsonMapper - Logger

How can I change the IJsonMapper with DI (with other JSON library or even other protocol)?
The same for the Logger.
Thanks!

Converting expando object to typed object

I'm playing around with chromely, pretty impressed so far, but one thing bothered me. Here we are working with an expandobject: https://github.com/mattkol/Chromely/blob/master/angular-react-vue/ChromelyVueCefSharp/Controllers/DemoController.cs#L96-L116

Having my backend in .NET I very much prefer to use typed objects. In case anyone else wants to do the same

  1. Add System.Web.Extensions as a reference to your project.
  2. Add a second constructor to the MovieInfo class
public MovieInfo()
{
}
  1. Convert the data using this code
var javaScriptSerializer = new JavaScriptSerializer();
List<MovieInfo> movies = javaScriptSerializer.ConvertToType<List<MovieInfo>>(request.PostData);

You can now work with movies in a nice way.

Provide demo binaries

I am not a .NET developer and I do not have .NET SDK, but I am searching for a lightweight alternative to Electron/NW.js and I want to try out Chromely. However, I cannot find any demo chromely.exe binaries for Windows. Can you provide a demo app, running a local HTML file in a subfolder, similar to NW.js?

Thanks!

how to pass args from Program.cs to DemoController?

Hello

I am in need of some help using chromely

I want to give chromely an array of args when calling dotnet run,
and then use those args in the controller.

using the demo,
where would i need to put args in Program.cs,
and how do i call args from within DemoController?

Your assistance would be greatly appreciated

Error with Angular demo

Hello,

Thanks for Chromely
I got the following erreor with angular demo

(xcopy failed)

c:\EXP\Chromely\angular\ChromelyAngularCefGlue\ChromelyAngularCefGlue.csproj(66,7): error MSB3073: La commande "xcopy "c:\EXP\Chromely\angular\ChromelyAngularCefGlue\dist" "c:\EXP\Chromely\angular\ChromelyAngularCefGlue\bin\x64\Debug\net461\dist" /i /s /r /y /c" s'est arrêtée avec le code 4.
1>Génération du projet "ChromelyAngularCefGlue.csproj" terminée -- ÉCHEC.

Regards

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.