Page 1 of 4

MiniBrowser

Posted: Thu May 20, 2021 1:10 pm
by Cantar
There is no TNetEncoding class in Delphi XE and I cannot compile
MiniBrowser project from demos Cef 90.6.5. What to do in this case?

Re: MiniBrowser

Posted: Thu May 20, 2021 2:40 pm
by salvadordf
Sorry about that. I'll disable those calls for older Delphi versions as soon as I can.
Meanwhile, you can comment those lines to build the MiniBrowser demo with Delphi XE.

Re: MiniBrowser

Posted: Thu May 20, 2021 3:00 pm
by salvadordf
I just uploaded a small workaround for that issue.
Please, download CEF4Delphi from GitHub again.

Re: MiniBrowser

Posted: Thu May 20, 2021 3:32 pm
by Cantar
Thank you, everything is fine

Re: MiniBrowser

Posted: Thu May 20, 2021 5:51 pm
by Cantar
In this example, on the Chromium1BeforeDownload event, callback.cont saves the downloaded file to disk. How to open
a downloadable file using an external program

Re: MiniBrowser

Posted: Thu May 20, 2021 6:13 pm
by salvadordf
If you want to download that file using an external program you can do this :
  • Cancel the download in Chromium1DownloadUpdated by calling callback.cancel
  • Read the downloadItem.Url value and send it to the external program. You will have to read the documentation about that external program to know how can you start downloading a URL.
If you just want to download that file using CEF4Delphi and then open it with an external program then you can use "ShellExecute" as you can see here :
https://stackoverflow.com/questions/16941455/how-do-i-open-a-file-with-the-default-text-editor
https://www.thoughtco.com/execute-and-run-applications-1058462

Re: MiniBrowser

Posted: Thu May 20, 2021 6:18 pm
by Cantar
Thank you,

Re: MiniBrowser

Posted: Sat May 22, 2021 5:39 pm
by Cantar
Chromium1BeforeDownload event, callback.cont function.
There is a way in cef4 to detect when an event is successful and the file is not busy

Re: MiniBrowser

Posted: Sun May 23, 2021 10:16 am
by salvadordf
The MiniBrowser demo shows how to handle downloads. The TMiniBrowserFrm.Chromium1DownloadUpdated procedure checks the values of downloadItem.IsComplete, downloadItem.IsCanceled and downloadItem.IsInProgress to know the status of that item.

Re: MiniBrowser

Posted: Mon May 24, 2021 5:24 am
by Cantar
Thanks a lot