TIdHTTP freeze on CEF work

155 Views Asked by At

I'm use CEF 3.2623.1401.gb90a3be (Chromium 49.0.2623.110) in my project in Delphi 10.1. (I have to use a fairly old version of CEF/Chromium for backwards compatibility with WinXP). Take a look to this code:

procedure TMainFrom.IdHTTP_updateWork(ASender: TObject;
  AWorkMode: TWorkMode; AWorkCount: Int64);
  var download_percent:integer;
begin
  download_percent:=round(AWorkCount * 100 / update_file_size);
  Chromium1.browser.MainFrame.ExecuteJavaScript
  ('$(".progress").progress({percent: '+inttostr(download_percent)+'});',
  'about:blank', 0);
end;

The idea is to use JavaScript to show the progress of file download on the page loaded in Chromium. Everything works fine, but Chromium freezes while file is loaded, and only draws progress after the download is complete. Is there any analogue of Application.ProcessMessages for Chromium?

0

There are 0 best solutions below