TIdHTTP freeze on CEF4Old work
Posted: Sat Jul 07, 2018 1:30 pm
Hello! Please take a look to this code:
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?
Code: Select all
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;