Search code examples
c#javascriptasynchronouschromium-embeddedcefglue

Xilium CefGlue Async Javascript to native C# with parameters and return values?


I have been experimenting with CEFGlue in C# recently particularly from the JS>Native integration.

I have tried 3 approaches but none seems to be appropriate.

  1. Through XHR and Custom SchemeHandler - generally great but seems to blocks both the renderer and browser for long running tasks.
  2. Through V8 callbacks - awesome but blocks the renderer for long running tasks
  3. Through cefQuery aka Asynchronous Bindings - does not block the renderer or browser but does not seem to have support for passing any parameters.

I have a trivial requirement it seems.

  1. Asynchronous execution i.e. neither browser nor renderer are to block on long running tasks.
  2. I need to pass parameters and process return values in Javascript.

Is there a feature of CEFGlue that I can experiment with that will allow me to accomplish this task?

Thanks.


Solution

  • I have posted an answer to my own question on Google CEF group. The solution works quite well.

    CEF Google Group