Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

"Generic Message Router" missing?

donald7771
Posts: 7
Joined: Thu Jul 26, 2018 5:14 pm

"Generic Message Router" missing?

Post 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.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: "Generic Message Router" missing?

Post by salvadordf »

CEF4Delphi is a C API wrapper of the CEF3 binaries and the "Generic Message Router" is not part of the C API.
donald7771
Posts: 7
Joined: Thu Jul 26, 2018 5:14 pm

Re: "Generic Message Router" missing?

Post by donald7771 »

Thank you for your timely reply! Can I implement it in Delphi? If possible, is this a key feature worthy to try?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: "Generic Message Router" missing?

Post 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.
donald7771
Posts: 7
Joined: Thu Jul 26, 2018 5:14 pm

Re: "Generic Message Router" missing?

Post by donald7771 »

Thanks again :lol:
jchoover
Posts: 14
Joined: Tue Apr 30, 2019 5:45 pm

Re: "Generic Message Router" missing?

Post 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?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: "Generic Message Router" missing?

Post by salvadordf »

Thank you very much for your contribution! :D

Please, use the source directory unless your units include a full application.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: "Generic Message Router" missing?

Post 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.
jchoover
Posts: 14
Joined: Tue Apr 30, 2019 5:45 pm

Re: "Generic Message Router" missing?

Post 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
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: "Generic Message Router" missing?

Post 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.
Post Reply