CefGlue vs CefSharp in 2017

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

CefGlue vs CefSharp in 2017

Postby NedB » Wed Feb 22, 2017 8:24 am

Hello,

I am investigating CEF .NET wrappers and am a bit puzzled on which one to choose.

I am aware that this question has been asked multiple times in the past, notably:
http://stackoverflow.com/questions/1222 ... vice-versa
https://groups.google.com/forum/#!topic ... 964FZpZZlw

I've been testing the capabilities of both wrappers, overviewing the API surface and first thought CefSharp was more complete until the huge facepalm I just had when I noticed Xilium.CefGlue docs I've been looking at have not been updated for 2 years now (https://xilium.bitbucket.io/cefglue/doc/index.html).

I figure things have changed in the past several years. Could anyone please comment the main differences of these wrappers now in 2017? What is the API coverage of CEF, which is more complete, which focuses on what features?

My use case is Offscreen browser automation for web crawling. These are synchronous tasks of step by step clicking on things and executing javascript and returning html/js values, waiting for some html elements to be loaded before proceeding etc. Any suggestions to enforce such sync behavior would be very welcome as well.
NedB
Newbie
 
Posts: 2
Joined: Wed Feb 22, 2017 7:52 am

Re: CefGlue vs CefSharp in 2017

Postby fddima » Thu Feb 23, 2017 12:02 am

I'm doesnt update docs. Just ignore it.
CefGlue currently updated with CEF stable releases (with sone delay). Only CefGlue work on all platforms, only CefGlue and ChromiumFX provide almost full API coverage. Only CefSharp has pre-made controls which can be used really easily by newbies.
fddima
Master
 
Posts: 759
Joined: Tue Dec 07, 2010 6:10 am

Re: CefGlue vs CefSharp in 2017

Postby NedB » Thu Feb 23, 2017 4:57 am

Thanks for the quick reply : )

The cross platform point is actually very interesting. Any thoughts on future .NET Core support after its upcoming NETStandard 2.0 compliant release?

If ignoring the cross platform point, why would one choose CefGlue over ChromiumFX? Do you think ChromiumFX would fit web crawling scenario more due to it seemingly having more/easier functionality for browser/render process communication?

In my case instructions for how to crawl a page will come through my API from separate applications. Instructions will contain the javascript to execute, what elements to wait for, etc. So I need to wrap CEF for synchronous automation.
NedB
Newbie
 
Posts: 2
Joined: Wed Feb 22, 2017 7:52 am

Re: CefGlue vs CefSharp in 2017

Postby fddima » Thu Feb 23, 2017 5:54 am

As author of CefGlue it will be not fair to say that something wrong with other bindings. So i'm not say.

ChromiumFX has interesting functionality about remote access, but i'm prefer stay close to CEF API, and make any own meaningful IPC layer for controlling browser when need. If you plan use browser for crawling... actually you never want expose raw CEF API outside browser for any task, instead you need Load / Wait / FindElement / etc. In that sense there is no have big difference in actual bindings to use. I'm exactly use it in this direction previously.

Yep, i'm plan .net core support for CefGlue vNext (will be bit different from current era versions, but similar, may be around CEF v60).

So again: CefSharp best at this moment in sense .net adaptation, ready-to-use controls and good enough API (with big coverage in practical sense).
CefGlue - most conservative with API, mostly they very close to CEF C++ API.
ChromiumFX - also as CefGlue.

This should turn you that you be able choose that you want, but in anyway you should learn CEF API (depending from task). Peoples who just want browser control in own app - safely can choose CefSharp. Peoples who CAN write own WPF or WinForms control - can use CefGlue or ChromiumFX safely.

Best place for CEF documentation is original CEF wiki & hearders. In other bindings (at least in CefGlue) documentation from headers appears as intellisense text.
fddima
Master
 
Posts: 759
Joined: Tue Dec 07, 2010 6:10 am

Re: CefGlue vs CefSharp in 2017

Postby Czarek » Sun Mar 05, 2017 5:37 am

A bit off-topic. I don't know why, but I always thought that CefGlue was exposing hard to use C API. Now I see how wrong I was, I've looked at C<>C# generators in CefGlue and ChromiumFX projects and this is awesome! :) I want that in cefpython as well.
Maintainer of the CEF Python, PHP Desktop, CEF2go and CEF C API projects.
User avatar
Czarek
Genius
 
Posts: 1097
Joined: Sun Nov 06, 2011 2:12 am
Location: Poland

Re: CefGlue vs CefSharp in 2017

Postby fddima » Sun Mar 05, 2017 6:08 am

Czarek wrote:A bit off-topic. I don't know why, but I always thought that CefGlue was exposing hard to use C API. Now I see how wrong I was, I've looked at C<>C# generators in CefGlue and ChromiumFX projects and this is awesome! :) I want that in cefpython as well.


Nowadays CefSharp done many steps forward, than the days when i'm touch it first time (in CEF1 era). It was actually very-very limited. Btw, CefSharp had been first .NET binding. But it was architecturally based on C++/CLI and needed other C runtime library, than default (nowadays it is not required, as i'm understand). So I'm started CefGlue just to try make "P/Invoke"-only bindings which can consume standard binaries, and as result it can be runned over mono on linux.

I'm always tried wrap CEF API into something other, but after using it in several projects, i'm found that way for me - is just stay close to CEF API (or having this possibility) works best for me. Anyway our applications always has own controlling layer, so involving additional API layers just no have sense. Probably, if we want provide ready-to-use embeddable control - API usually should be factored in other way, or peoples can't normally consume them, but - this is that i'm never done actually. And CefSharp's way of (re)organizing API in that case may be more reasonable.

And about C<>C# generators -> CefGlue always had partially hand-written code, and this is lot stupid code actually. ChromiumFX probably better, as it had been designed after CefGlue and design bit more optimal (i'm never look at ChromiumFX too deeply). Again CefGlue vNext should reduce amount of this hand-written code to about zero (except some core functions, like strings, list, etc). But there is still exist some code transformations which should be done: for example converting methods to properties (easy), or when C/C++ API has one ref parameter, sometimes in C# we should actually have only one return parameter (for example GetFrameIdentifiers() - it is more logical return array of identifiers, that accept reference to List which will be filled with ids).

So, i'm trying canonize this things and solve them in "complileric"-way, just for fun mainly, instead of ad-hoc writing cases. vNext will be backed by generated metadata from cef_parser + additional include parsers for internal types (done in C#, but easy can be rewritten to python), and C#-based generator. During initial development work are closed-source, i have plans publish public beta around CEF 59-60 releases.

Also i'm had some initiative with Marshall about providing standard XML-based metadata. Unfortunately this work has not been finished. And now i'm don't thing that it is very needed (rewriting internal CEF tooling without benefits - no have sense).

PS: If you want eventually want to discuss about bindings/generating - feel free to ask me (better exchange skype accounts in private messages).
fddima
Master
 
Posts: 759
Joined: Tue Dec 07, 2010 6:10 am

Re: CefGlue vs CefSharp in 2017

Postby Czarek » Sun Mar 05, 2017 6:34 am

Thanks Dmitry. I will first try to analyze source codes in CefGlue/ChromiumFX and if I have some questions I will contact you. I want to have automated bindings to CEF while allowing me to customize the API. Python is a dynamic language so things work different. I also wouldn't want to break existing cefpython API too much. It's a big task that I would love to implement some day. This topic was very inspiring.
Maintainer of the CEF Python, PHP Desktop, CEF2go and CEF C API projects.
User avatar
Czarek
Genius
 
Posts: 1097
Joined: Sun Nov 06, 2011 2:12 am
Location: Poland

Re: CefGlue vs CefSharp in 2017

Postby fddima » Sun Mar 05, 2017 8:06 am

Czarek wrote:Thanks Dmitry. I will first try to analyze source codes in CefGlue/ChromiumFX and if I have some questions I will contact you. I want to have automated bindings to CEF while allowing me to customize the API. Python is a dynamic language so things work different. I also wouldn't want to break existing cefpython API too much. It's a big task that I would love to implement some day. This topic was very inspiring.


I just note, that while CefGlue's generator is just work, but it contains by design errors which i'm just not touch because of vNext. Errors... manually defined class roles, but CEF metadata already define them via obj_class.is_library_side and obj_class.is_client_side. Some other things, like assuming CefBase is one existing base class, which nowadays no more true (so i'm don't expose CEF Views api). Surely you can pick and examine it as start work, as well as original cef_translator tool.
fddima
Master
 
Posts: 759
Joined: Tue Dec 07, 2010 6:10 am

Re: CefGlue vs CefSharp in 2017

Postby MaitreDede » Mon Jun 19, 2017 4:37 pm

Hi,

About the cross-platform point, do you know if any of the libs quoted in this thred (CefSharp, CefGlue, ChromiumFX) or any other works on Raspberry Pi (raspbian) ? CefSharp will not be compatible, since it is written in C++/CLI, but for others ?
Coding bugs...
User avatar
MaitreDede
Newbie
 
Posts: 6
Joined: Mon Jul 04, 2016 3:59 pm
Location: New Caledonia

Re: CefGlue vs CefSharp in 2017

Postby fddima » Wed Jun 21, 2017 8:09 am

MaitreDede wrote:Hi,

About the cross-platform point, do you know if any of the libs quoted in this thred (CefSharp, CefGlue, ChromiumFX) or any other works on Raspberry Pi (raspbian) ? CefSharp will not be compatible, since it is written in C++/CLI, but for others ?

Others should work, but i'm not sure that anyone tried.
fddima
Master
 
Posts: 759
Joined: Tue Dec 07, 2010 6:10 am

Next

Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 1 guest