Call DownloadHandler::CanDownload
when downloading a PDF file from the PDF viewer
#3783
Labels
enhancement
Enhancement request
Describe the bug
Typically,
DownloadHandler::CanDownload
is called before any download, giving the developer the opportunity to decide whether a file should be downloaded.DownloadHandler::CanDownload
is not executed when a PDF file is downloaded through the PDF viewer plugin, circumventing the logic found inDownloadHandler::CanDownload
.Although one may argue that the PDF is technically already downloaded, thereby making this method call redundant, it subverts the exceptation that
DownloadHandler::CanDownload
method is called on all downloads.My current workaround is to move my
DownloadHandler::CanDownload
logic intoDownloadHandler::OnBeforeDownload
, and returning false inDownloadHandler::OnBeforeDownload
, allowing the alloy runtime to cancel the download by default. This is a hacky/dirty workaround which I wish to avoid.To Reproduce
Steps to reproduce the behavior:
cef-project
containing the MVP of the bugminimal
executable.DownloadHandler::CanDownload
will log a message starting withCanDownload
when triggered, allowing you to grep for the log.CanDownload
logExpected behavior
DownloadHandler::CanDownload
is called when downloading a PDF file through the PDF viewer.Versions (please complete the following information):
Additional context
So far, I have only tried reproducing the bug in the
minimal
project incef-project
, but I also observe this behaviour in another project.Let me know if I can provide more information. If you know where I can look to start fixing this bug, kindly let me know.
Regards,
Luca
The text was updated successfully, but these errors were encountered: