Hi.
Sory for my english
I am studying an demo example "ResponseFilterBrowser".
Example uses windows messaging api (Winapi.Messages).
But i use Tchromium in windows less mode in a separate thread without windows.
How can i retrieve response body in thread?
Thanx.
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.
retrieve response body in thread
retrieve response body in thread
You do not have the required permissions to view the files attached to this post.
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: retrieve response body in thread
Hi,
The same way you do with a normal browser.
TChromium events will be executed in CEF threads and you will have to store the body contents in a variable protected by a critical section.
After that, send a message to the thread that will handle the body contents with PostThreadMessage :
https://stackoverflow.com/questions/139 ... hin-thread
I've never used it but some people recommend OmniThreadLibrary to simplify thread handling :
https://otl.17slon.com/
The same way you do with a normal browser.
TChromium events will be executed in CEF threads and you will have to store the body contents in a variable protected by a critical section.
After that, send a message to the thread that will handle the body contents with PostThreadMessage :
https://stackoverflow.com/questions/139 ... hin-thread
I've never used it but some people recommend OmniThreadLibrary to simplify thread handling :
https://otl.17slon.com/
Re: retrieve response body in thread
But is there no other way, without windows messaging api (Winapi.Messages)?
Re: retrieve response body in thread
Can I use TCEFUrlRequestClientComponent in thread without Winapi.Messages?
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: retrieve response body in thread
I've never tried this with that component but in theory you can set GlobalCEFApp.MultiThreadedMessageLoop to false, GlobalCEFApp.ExternalMessagePump to true and use the GlobalCEFWorkScheduler.
With that configuration the browser process message loop runs in the same thread.
The ExternalPumpBrowser demo has all the code you need to use the GlobalCEFWorkScheduler but I'm not sure it will work with TCEFUrlRequestClientComponent.
With that configuration the browser process message loop runs in the same thread.
The ExternalPumpBrowser demo has all the code you need to use the GlobalCEFWorkScheduler but I'm not sure it will work with TCEFUrlRequestClientComponent.
Re: retrieve response body in thread
It would be very nice if you added one more parameter to the OnResourceResponse Event - ResponseBody
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: retrieve response body in thread
I'm sorry but I can only add the parameters given by the CEF API and ICefResourceRequestHandler.OnResourceResponse doesn't have a "ResponseBody".