Page 3 of 10

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

PostPosted: Tue Aug 14, 2012 6:45 pm
by fddima
As i'm say before - at already fixed in latest source code.

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Fri Sep 07, 2012 10:55 pm
by BdC
Is there any short term plan to add support for CefRegisterExtension in CefGlue/3?

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Wed Sep 12, 2012 8:59 am
by fddima
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).

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Tue Sep 25, 2012 4:52 am
by orsox
Great Work!
Could you please post cef-binaries for your latest update to r778!?

Keep up the good work!

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Tue Sep 25, 2012 9:53 am
by fddima
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.

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Thu Oct 04, 2012 3:58 pm
by fddima
CefGlue sources updated to R838. At project's home you can find match windows binaries.

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Sun Oct 28, 2012 7:30 am
by fddima
CefGlue sources updated to R880. At project's home you can find match windows binaries.

Xilium.CefGlue/3 & CefGlue/1 - RegisterScriptableObject

PostPosted: Mon Oct 29, 2012 12:51 am
by steven181
Hi
May I know there is any solution to use RegisterScriptableObject with CEF3.
Thanks for your support.

Steven

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

PostPosted: Mon Oct 29, 2012 9:26 am
by fddima
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.

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

PostPosted: Tue Oct 30, 2012 11:04 am
by steven181
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