New to CEFSharp, having an issue or two

814 views
Skip to first unread message

ken....@live.com

unread,
Mar 10, 2014, 4:14:33 PM3/10/14
to cefs...@googlegroups.com
I have downloaded and gotten the "CefSharp.MinimalExample-master" project to work (somewhat).
It uses binaries: "CefSharp.Core.3.29.0-pre0" and "CefSharp.Wpf.3.29.0-pre0".

I had developed a web site previously which relies heavily on ajax calls to the server.

When I navigate to the web site directly through Chrome (or any major browser) everything works as normal (as you might expect).

When I run the Cef-WPF application I get a parse error on the $.ajax request.  It looks like a JSON/JSONP-type parse error.  In any case, the call never reaches the server.  I have confirmed that the URL is identical in both cases (even though alert works differently in WPF and I have to adjust for a maximum length and account for "&"'s getting dropped). 

Also, I cannot seem to get script debugging to work in the CefSharp browser.  I have tried to copy over the latest libcef.dll but it still doesn't work.  

I was wondering 1) if anyone else has trouble calling ajax from Cef, 2) other than getting the latest libcef, what can I do to enable debugging?

Thanks,

Ken Rubin

Jørn Hansen

unread,
Mar 10, 2014, 5:47:39 PM3/10/14
to cefs...@googlegroups.com


On Monday, March 10, 2014 9:14:33 PM UTC+1, ken....@live.com wrote:
I have downloaded and gotten the "CefSharp.MinimalExample-master" project to work (somewhat).
It uses binaries: "CefSharp.Core.3.29.0-pre0" and "CefSharp.Wpf.3.29.0-pre0".

I had developed a web site previously which relies heavily on ajax calls to the server.

When I navigate to the web site directly through Chrome (or any major browser) everything works as normal (as you might expect).

When I run the Cef-WPF application I get a parse error on the $.ajax request.  It looks like a JSON/JSONP-type parse error.  In any case, the call never reaches the server.  I have confirmed that the URL is identical in both cases (even though alert works differently in WPF and I have to adjust for a maximum length and account for "&"'s getting dropped). 

Also, I cannot seem to get script debugging to work in the CefSharp browser.  I have tried to copy over the latest libcef.dll but it still doesn't work.  

To get debugging to work you would also need the `devtools_ressources.pak` file (see the FAQ wiki page for a bit more on this). The .pak file is currently not part of the "CefSharp.Core.3.29.0-pre0" NuGet binary. It's on the not too distant future todo for me - see issue #137. 

Anyway, the MinimalExample *is* minimal ;-)


I was wondering 1) if anyone else has trouble calling ajax from Cef, 2) other than getting the latest libcef, what can I do to enable debugging?

I would suggest that you start by isolating your specific ajax issue by downloading the cefclient.exe from the upstream CEF project which does all the heavylifting (from here: http://www.magpcss.net/cef_downloads/index.php?query=label%3ACEF3+label%3Awindows+label%3Aclient+sort%3Aname#list ). The cefclient.exe comes with everything included to open the JS developer console. The August release should be the one matching CefSharp 3.29.*

Just copying over another version of libcef.dll is probably not a good idea

Best regards,
JornH
 
Thanks,

Ken Rubin

ken....@live.com

unread,
Mar 11, 2014, 9:07:35 AM3/11/14
to cefs...@googlegroups.com
Thanks!
Message has been deleted

ken....@live.com

unread,
Mar 11, 2014, 11:35:31 AM3/11/14
to cefs...@googlegroups.com
Hi Jorn,

Thanks for the information.  I have installed that client application and it works (i.e. the ajax call goes through).  It does not, however, let me bring up the debugger window.  I tried pressing F12 (which I normally do when using Chrome) and SHIFT+CTRL+J.  Neither produced any result.  I do see the file: "devtools_resources.pak", in the "Release" folder of the client package I downloaded.  However, I do not recognize the ".PAK" extension and don't know if there is something I need to do with that file to "activate" it.  I do see "debug.log" and "console.log" files (also in the "Release" folder), but I'm looking for an interactive debugger equivalent to pressing F12 in Chrome.  Does that exist?  I am quite new to web development so I am not sure if there are other debugging options available.

By the way, when I said I copied over the libcef.dll file into my project I did forget to mention that I also copied over the latest versions of all the referenced dlls--so that they would be in phase with each other.
Lastly, when I downloaded the file from the site you referenced, I installed the latest win-64 version.  I literally just started with this project yesterday and so am not beholden to any legacy version.  I'd like to go forward with the latest and greatest version CEF has to offer.  

To summarize: does CEF offer a GUI debugger?  If so, do I have to do something to the "devtools_resources.pak" files to make it work?

Take care,

Ken Rubin


On Monday, March 10, 2014 4:14:33 PM UTC-4, ken....@live.com wrote:

Jørn Hansen

unread,
Mar 11, 2014, 12:58:27 PM3/11/14
to cefs...@googlegroups.com


On Tuesday, March 11, 2014 4:35:31 PM UTC+1, ken....@live.com wrote:
Hi Jorn,

Thanks for the information.  I have installed that client application and it works (i.e. the ajax call goes through).  

Good! (or bad, because that indicates the problem is when adding the CefSharp .NET layer ;-)  But it's always good to have cefclient.exe as a reference to compare with. Hopefully you are up for trying to narrow down the problem - that would help improve the quality of CefSharp3 for others too.

It does not, however, let me bring up the debugger window.  I tried pressing F12 (which I normally do when using Chrome) and SHIFT+CTRL+J.  Neither produced any result.  

Well, what you have with both CefSharp and CEF is not a 1 to 1 match with Chrome but more a toolkit with extra freedom (and also limitations) to build on the Chromium project. With this also comes the need for you to configure stuff.
 
I do see the file: "devtools_resources.pak", in the "Release" folder of the client package I downloaded.  However, I do not recognize the ".PAK" extension and don't know if there is something I need to do with that file to "activate" it.  I do see "debug.log" and "console.log" files (also in the "Release" folder), but I'm looking for an interactive debugger equivalent to pressing F12 in Chrome.  Does that exist?  I am quite new to web development so I am not sure if there are other debugging options available.


Try Right-click > Show DevTools in cefclient.exe and the familiar Chromium DevTools should pop up in a window.


By the way, when I said I copied over the libcef.dll file into my project I did forget to mention that I also copied over the latest versions of all the referenced dlls--so that they would be in phase with each other.
Lastly, when I downloaded the file from the site you referenced, I installed the latest win-64 version.  

You should use the versions of the CEF code that comes bundled with CefSharp. The managed CefSharp .NET code is linked to the unmanaged CEF code - and there is probably no guarantee that it's binary compatible. 
 
I literally just started with this project yesterday and so am not beholden to any legacy version.  I'd like to go forward with the latest and greatest version CEF has to offer.  

Great to have you here! I have only been fooling around with CefSharp since around end of January - so I can relate to this "where do I start feeling".


To summarize: does CEF offer a GUI debugger?  If so, do I have to do something to the "devtools_resources.pak" files to make it work?

Yes, as outlined above. No the .PAK files are just bundles of resources used by the underlying CEF/Chromium code (if you look at some of them in a text editor you see javascript, .css etc.)

 With the above information I hope you are ready to dig a bit more around on your own. (I actually have no experience with how to show the DevTools - yet!). I will leave you with 3 additional pointers though:
   - Take a look at the CefSharp.Wpf.Example in the CefSharp repo.
   - Search the history in the Google Group here. - https://groups.google.com/forum/#!searchin/cefsharp/devtools/cefsharp/Rnt0mtPC944/2z6jyHH-9soJ seems relavant
   - "Use the source, Luke" :-)

Cheers,
JornH

ken....@live.com

unread,
Mar 11, 2014, 2:14:39 PM3/11/14
to cefs...@googlegroups.com
"or bad, because that indicates the problem is when adding the CefSharp .NET layer ;-"
- Not necessarily so.  I actually think this is an issue with my web server and was just hoping to get debugging turned on so I could look into it more easily...  Yesterday, after sending this post, I wrote a whole new web site in node.js/express.  The site did nothing more than serve up static pages and accept ajax request at a particular address.  The static page it served up did nothing more than make an ajax request back to node.  This worked in chrome and chromium.  So CefSharp is probably OK, though it does behave differently given a JS file that did not change...

"Try Right-click > Show DevTools in cefclient.exe and the familiar Chromium DevTools should pop up in a window."
- Sweet.  Thanks.

"You should use the versions of the CEF code that comes bundled with CefSharp"
- Got ya.  I didn't at first know that this was not the WPF version.  I was hoping to just get the latest and be done.

"Great to have you here"
- Thanks.  I hope I can help.

'"Use the source, Luke" :-)'
- Nice.  I'll put my C++ goggles back on.  Haven't worn those in many years!

Thanks, Jorn, you're awesome.


On Monday, March 10, 2014 4:14:33 PM UTC-4, ken....@live.com wrote:

Per Lundberg

unread,
Mar 11, 2014, 4:32:46 PM3/11/14
to cefs...@googlegroups.com
Hi,

Also a few cents from my side: the debugger works with CefSharp1, but not (yet) with CefSharp3. This is because it's more complex to support it with CefSharp3 (in CefSharp1 it was trivial on our side). I set this up as a new GitHub issue: https://github.com/cefsharp/CefSharp/issues/267

If someone wants to volunteer fixing it - feel free.

Best regards,
Per
Reply all
Reply to author
Forward
0 new messages