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?
-
- Posts: 7
- Joined: Thu Jul 26, 2018 5:14 pm
"Generic Message Router" missing?
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.
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.
- salvadordf
- Posts: 4578
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: "Generic Message Router" missing?
CEF4Delphi is a C API wrapper of the CEF3 binaries and the "Generic Message Router" is not part of the C API.
-
- Posts: 7
- Joined: Thu Jul 26, 2018 5:14 pm
Re: "Generic Message Router" missing?
Thank you for your timely reply! Can I implement it in Delphi? If possible, is this a key feature worthy to try?
- salvadordf
- Posts: 4578
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: "Generic Message Router" missing?
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.

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.
-
- Posts: 7
- Joined: Thu Jul 26, 2018 5:14 pm
Re: "Generic Message Router" missing?
Thanks again 

Re: "Generic Message Router" missing?
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?
- salvadordf
- Posts: 4578
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: "Generic Message Router" missing?
Thank you very much for your contribution!
Please, use the source directory unless your units include a full application.

Please, use the source directory unless your units include a full application.
- salvadordf
- Posts: 4578
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: "Generic Message Router" missing?
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.
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?
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
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
- salvadordf
- Posts: 4578
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: "Generic Message Router" missing?
Thank you very much!
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.

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.