mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
[GeckoView] Add a button to download and open the file in an external app (bug 1829367)
This commit is contained in:
parent
f151a39d14
commit
a652dc85e4
10 changed files with 54 additions and 16 deletions
|
@ -108,10 +108,11 @@ class FirefoxCom {
|
|||
class DownloadManager {
|
||||
#openBlobUrls = new WeakMap();
|
||||
|
||||
downloadUrl(url, filename) {
|
||||
downloadUrl(url, filename, options = {}) {
|
||||
FirefoxCom.request("download", {
|
||||
originalUrl: url,
|
||||
filename,
|
||||
options,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -160,13 +161,14 @@ class DownloadManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
download(blob, url, filename) {
|
||||
download(blob, url, filename, options = {}) {
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
|
||||
FirefoxCom.request("download", {
|
||||
blobUrl,
|
||||
originalUrl: url,
|
||||
filename,
|
||||
options,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue