Remove the DownloadManager.downloadUrl method

This method has only a single call-site in the viewer, since it's used as a fallback, and the functionality can be moved into the `DownloadManager.download` method instead.
This commit is contained in:
Jonas Jenwald 2024-06-12 13:21:33 +02:00
parent 341ff40e74
commit 42999e5bef
4 changed files with 29 additions and 37 deletions

View file

@ -82,14 +82,6 @@ class FirefoxCom {
class DownloadManager {
#openBlobUrls = new WeakMap();
downloadUrl(url, filename, options = {}) {
FirefoxCom.request("download", {
originalUrl: url,
filename,
options,
});
}
downloadData(data, filename, contentType) {
const blobUrl = URL.createObjectURL(
new Blob([data], { type: contentType })
@ -141,9 +133,9 @@ class DownloadManager {
}
download(data, url, filename, options = {}) {
const blobUrl = URL.createObjectURL(
new Blob([data], { type: "application/pdf" })
);
const blobUrl = data
? URL.createObjectURL(new Blob([data], { type: "application/pdf" }))
: null;
FirefoxCom.request("download", {
blobUrl,