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.

MiniBrowser

Cantar
Posts: 19
Joined: Thu May 20, 2021 1:04 pm

MiniBrowser

Post 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?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: MiniBrowser

Post 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.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: MiniBrowser

Post by salvadordf »

I just uploaded a small workaround for that issue.
Please, download CEF4Delphi from GitHub again.
Cantar
Posts: 19
Joined: Thu May 20, 2021 1:04 pm

Re: MiniBrowser

Post by Cantar »

Thank you, everything is fine
Cantar
Posts: 19
Joined: Thu May 20, 2021 1:04 pm

Re: MiniBrowser

Post 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
Last edited by Cantar on Thu May 20, 2021 5:53 pm, edited 1 time in total.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: MiniBrowser

Post 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
Cantar
Posts: 19
Joined: Thu May 20, 2021 1:04 pm

Re: MiniBrowser

Post by Cantar »

Thank you,
Cantar
Posts: 19
Joined: Thu May 20, 2021 1:04 pm

Re: MiniBrowser

Post 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
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: MiniBrowser

Post 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.
Cantar
Posts: 19
Joined: Thu May 20, 2021 1:04 pm

Re: MiniBrowser

Post by Cantar »

Thanks a lot
Post Reply