I am glad to know that the issue with HTTPS is now resolved.
Mentioned onDownloadAs is related to the editor method downloadAs:
Unfortunately, there is no direct method or event to fulfill your goal, however, I have mentioned a potential solution for this case here:
Other approach is to disable downloads from the editor completely, so that only option remains is a download button in your storage application. There you can implement any logic that will suit your case.