Wait after load for background task

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Wait after load for background task

Postby pmadr » Tue Feb 13, 2018 8:24 am

Hi,

I'm trying to use offscreen rendering. It works fine but I have troubles with this page:
https://www.edumen.cz/auto_translate.html

In my browser handler I wait for all IO to finish in OnLoadEnd. It works on many pages but auto_translate.html doesn't show page translated.
I see that translation XHR request is done after a browser is closing (browser->GetHost()->CloseBrowser(true);), like it was blocked by something.

Translation XHR request is:
https://translate.googleapis.com/transl ... =en&tl=cs&

Can I somehow unblock this request and let it run before rendering?
pmadr
Newbie
 
Posts: 8
Joined: Tue Feb 13, 2018 8:04 am

Re: Wait after load for background task

Postby magreenblatt » Tue Feb 13, 2018 8:58 am

How are you running the message loop? How are you waiting for IO to finish?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Wait after load for background task

Postby pmadr » Tue Feb 13, 2018 9:22 am

I run message loop by CefRunMessageLoop();

IO checker checks periodically if all requests (collected in OnBeforeResourceLoad) are finished by CefPostDelayedTask on TID_UI.

I tried to disable my IO checker completely and just wait a specific time by
CefPostDelayedTask(TID_UI, call_renderer, delay);
in OnLoadEnd and afterwards call renderer. XHR request was not processed regardless delay time. Its OnBeforeResourceLoad event is called always after browser->GetHost()->CloseBrowser(true);
pmadr
Newbie
 
Posts: 8
Joined: Tue Feb 13, 2018 8:04 am

Re: Wait after load for background task

Postby magreenblatt » Tue Feb 13, 2018 10:48 am

Does the problem reproduce in the cefclient sample application? Are you setting browser visibility state correctly in your application (calling WasHidden)?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Wait after load for background task

Postby pmadr » Wed Feb 14, 2018 2:51 am

Thank you very much. Calling WasHidden(false) works perfectly.
pmadr
Newbie
 
Posts: 8
Joined: Tue Feb 13, 2018 8:04 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 17 guests