Page 1 of 2

"Generic Message Router" missing?

Posted: Tue Nov 20, 2018 8:14 am
by donald7771
According to cef3 document:Starting with trunk revision 1574 CEF provides a generic implementation for routing asynchronous messages...

From what I see it, its like some kind of 'native jQuery-like library', allowing async JavaScript binding, and it looks very convenient.

But it seems that it's missing from CEF4DELPHI ? Anyone knows anything about this?

With the 'Generic Message Router', we can write js code like this:

// Create and send a new query.
var request_id = window.cefQuery({
request: 'my_request',
persistent: false,
onSuccess: function(response) {},
onFailure: function(error_code, error_message) {}
});
// Optionally cancel the query.
window.cefQueryCancel(request_id);

Of course we'll also have to implement the handler in the host (Delphi) program.

Re: "Generic Message Router" missing?

Posted: Tue Nov 20, 2018 8:28 am
by salvadordf
CEF4Delphi is a C API wrapper of the CEF3 binaries and the "Generic Message Router" is not part of the C API.

Re: "Generic Message Router" missing?

Posted: Tue Nov 20, 2018 8:34 am
by donald7771
Thank you for your timely reply! Can I implement it in Delphi? If possible, is this a key feature worthy to try?

Re: "Generic Message Router" missing?

Posted: Tue Nov 20, 2018 8:56 am
by salvadordf
You are free to suggest new features and create pull requests in GitHub. :)

Personally, I would implement other features before this one, like the "Views" or creating a demo with browser extensions or creating a new demo with URLRequests that uses only one TCEFUrlRequestClientComponent for all the requests.

The Views are part of the C API and they are unfinished in CEF4Delphi. Only the data types are defined.

The functions and classes to add browser extensions are already implemented but I've never tried them and I suspect that they would require additional code to make them easy to use.

The "Generic Message Router" makes communications easier but you can already do that with the available process messages and extensions.

Re: "Generic Message Router" missing?

Posted: Tue Nov 20, 2018 10:55 am
by donald7771
Thanks again :lol:

Re: "Generic Message Router" missing?

Posted: Wed May 01, 2019 9:26 pm
by jchoover
I have translated a implementation of this to Delphi, which I would be willing to submit as a PR on GitHub back to the project. If interested, where would you expect the 3 PAS files to be located? Maybe in demos\GenericMessageRouter?

Re: "Generic Message Router" missing?

Posted: Thu May 02, 2019 7:32 am
by salvadordf
Thank you very much for your contribution! :D

Please, use the source directory unless your units include a full application.

Re: "Generic Message Router" missing?

Posted: Mon Sep 30, 2019 1:56 pm
by salvadordf
Hi,

That pull request wasn't submitted and the MessageRouter is not available in GitHub but there are several demos showing how to send and receive process messages.

Re: "Generic Message Router" missing?

Posted: Tue Feb 18, 2020 10:34 pm
by jchoover
Sorry,
Life has been a bit exciting as of late.

I need to find time to get a demo before I would submit a PR, but for now this should get you started:

https://github.com/jchoover/CEF4Delphi/ ... sageRouter

Re: "Generic Message Router" missing?

Posted: Wed Feb 19, 2020 9:23 am
by salvadordf
Thank you very much! :D

I downloaded it and I'll take a look as soon as I can.

However, I'm not sure if we can use parts of that code due to the GPL license.