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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.
Hello everyone, is there a way to open the download box? I have noticed that it appears when a file is finished downloading and gives options to open the location and run the downloaded file.
In WebView4Delphi I do it like this:
If you want to use the user interface of Chromium then you can call TChromiumCore.ExecuteChromeCommand(IDC_SHOW_DOWNLOADS, CEF_WOD_CURRENT_TAB); or navigate to chrome://downloads/ to show all the downloads.
If you prefer to use a custom interface and to control each download then use the following methods, properties and events :
TChromiumCore.DownloadBubble : Disable this property to hide the download notification.
TChromiumCore.OnCanDownload
TChromiumCore.OnBeforeDownload
TChromiumCore.OnDownloadUpdated
TChromiumCore.StartDownload
TChromiumCore.DownloadImage
TChromiumCore.OnDownloadImageFinished
Read the code comments for all of them and see the MiniBrowser demo :
https://github.com/salvadordf/CEF4Delphi/blob/cfba87c4d0964f6ccf943b2f5633217684733c11/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L494
Thank you very much Salvador for your help, it works.
One question: I'm using the "MiniBrowser" demo, how can I open an independent window pointing to chrome://downloads/ when starting a download?
Thank you very much for your time and help
The MiniBrowser demo sets Chromium1.MultiBrowserMode to True in order to handle all popup windows with one TChromium component.
Try calling TChromiumCore.ExecuteChromeCommand(IDC_SHOW_DOWNLOADS, CEF_WOD_NEW_POPUP) in the TChromiumCore.OnBeforeDownload event
Enabling the MultiBrowserMode property will show all popup windows with the Chromium user interface. If you want to use Delphi forms then set Chromium1.MultiBrowserMode to False and use the code in the PopupBrowser2 demo to handle popup windows with Delphi forms.