Xilium.CefGlue/3 & CefGlue/1

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

Moderator: fddima

Re: Bug in \CefGlue\Structs\CefCookie.cs (Xilium.CefGlue.Cef

Postby fddima » Tue Aug 14, 2012 6:45 pm

As i'm say before - at already fixed in latest source code.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby BdC » Fri Sep 07, 2012 10:55 pm

Is there any short term plan to add support for CefRegisterExtension in CefGlue/3?
BdC
Newbie
 
Posts: 4
Joined: Fri Sep 07, 2012 10:50 pm

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Wed Sep 12, 2012 8:59 am

BdC wrote:Is there any short term plan to add support for CefRegisterExtension in CefGlue/3?

It is already can be done, by writing own handlers, and interact between renderer and main process.

JSBinding feature are planned, but no works queued.
Keep track issue: Add support for CLR<>JS interaction (aka JSBinding / ScriptableObject).
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby orsox » Tue Sep 25, 2012 4:52 am

Great Work!
Could you please post cef-binaries for your latest update to r778!?

Keep up the good work!
orsox
Newbie
 
Posts: 1
Joined: Tue Sep 25, 2012 4:36 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Tue Sep 25, 2012 9:53 am

orsox wrote:Great Work!
Could you please post cef-binaries for your latest update to r778!?

Keep up the good work!


Thanks! Check project's home page.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Thu Oct 04, 2012 3:58 pm

CefGlue sources updated to R838. At project's home you can find match windows binaries.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Sun Oct 28, 2012 7:30 am

CefGlue sources updated to R880. At project's home you can find match windows binaries.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Xilium.CefGlue/3 & CefGlue/1 - RegisterScriptableObject

Postby steven181 » Mon Oct 29, 2012 12:51 am

Hi
May I know there is any solution to use RegisterScriptableObject with CEF3.
Thanks for your support.

Steven
steven181
Techie
 
Posts: 11
Joined: Mon Oct 29, 2012 12:42 am

Re: Xilium.CefGlue/3 & CefGlue/1 - RegisterScriptableObject

Postby fddima » Mon Oct 29, 2012 9:26 am

steven181 wrote:Hi
May I know there is any solution to use RegisterScriptableObject with CEF3.
Thanks for your support.
Steven

For new questions - better create new post (new thread).
No, currently CefGlue3 doesn't expose any of this functionality. But may be better / simplier is make own custom scheme handler, and interact with this handler via standard XHR (XMLHttpRequest) from javascript.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1 - RegisterScriptableObject

Postby steven181 » Tue Oct 30, 2012 11:04 am

fddima wrote:
steven181 wrote:Hi
May I know there is any solution to use RegisterScriptableObject with CEF3.
Thanks for your support.
Steven

For new questions - better create new post (new thread).
No, currently CefGlue3 doesn't expose any of this functionality. But may be better / simplier is make own custom scheme handler, and interact with this handler via standard XHR (XMLHttpRequest) from javascript.


Thank you very much for your suggestion.
I have successful created XMLHttpRequest using custom scheme handler.
I have copied the example code from CefGlue1, class "ClientSchemeHandler" with something like:

Code: Select all
protected override bool ProcessRequest(CefRequest request, CefCallback callback)
        {
            var urlString = request.Url;
            this._redirectUrl = urlString;

            string errorMessage = null;
            int errorStatus = 0;
            string errorStatusText = null;

            try
            {
                var uri = new Uri(urlString);
                var path = uri.Host + uri.AbsolutePath; // ignore host

                var asm = typeof(ClientSchemeHandler).Assembly;
                var resPrefix = "CefGlue.Client.Resources.";

               
                var resName = "test";
                var bytes1 = Encoding.UTF8.GetBytes(resName);
                this.stream = new MemoryStream(bytes1, false);

                if (this.stream != null)
                {
                    // found
                    this.responseLength = -1;
                    this.status = 200;
                    this.statusText = "OK";
                    this.mimeType = GetMimeTypeFromUriSuffix(path);
                    callback.Continue();
                   
                    return true;
                }
            }
            catch (Exception ex)
            {
                errorStatus = 500;
                errorStatusText = "Internal Error";
                errorMessage = "test<!doctype html><html><body><h1>Internal Error!</h1><pre>" + ex.ToString() + "</pre></body></html>";
            }

            // not found or error while processing request
            errorMessage = errorMessage ?? "<!doctype html><html><body><h1>Not Found!</h1><p>The requested url [" + urlString + "] not found!</p></body></html>";
            var bytes = Encoding.UTF8.GetBytes(errorMessage);
            this.stream = new MemoryStream(bytes, false);

            this.responseLength = -1;
            this.status = errorStatus != 0 ? errorStatus : 404;
            this.statusText = errorStatusText ?? "Not Found";
            this.mimeType = "text/html";
            callback.Continue();
            return true;
        }


and Javascript code:
Code: Select all
function testAjax() {
            var xhr = new XMLHttpRequest();

            xhr.onreadystatechange = function () {
                if (xhr.readyState == 4 && xhr.status == 200) {

                   
                    document.getElementById("ta").innerHTML = xhr.responseText;
                }
            };

            xhr.open("GET", "res://tests/hello.html", true);

            xhr.setRequestHeader('My-Custom-Header', 'Some Value');
            xhr.send();

           
        }


I don't know why it cannot fire the call back:
Code: Select all
document.getElementById("ta").innerHTML = xhr.responseText;


Can you please give me any suggestion?

Thank so much for your help.

Steven
steven181
Techie
 
Posts: 11
Joined: Mon Oct 29, 2012 12:42 am

PreviousNext

Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 24 guests