mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Remove the sourceEventType
from the viewer (bug 1757771 follow-up)
After the changes in https://bugzilla.mozilla.org/show_bug.cgi?id=1757771, that simplified the MOZCENTRAL downloading code, the `sourceEventType` is now completely unused and should thus be removed (in my opinion). Furthermore, with these changes, we also no longer need a *separate* internal "save"-event and can instead just use the older "download"-event everywhere.
This commit is contained in:
parent
60e9065bf6
commit
4f1cd6a9c2
5 changed files with 16 additions and 29 deletions
|
@ -158,14 +158,13 @@ class DownloadManager {
|
|||
return false;
|
||||
}
|
||||
|
||||
download(blob, url, filename, sourceEventType = "download") {
|
||||
download(blob, url, filename) {
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
|
||||
FirefoxCom.requestAsync("download", {
|
||||
blobUrl,
|
||||
originalUrl: url,
|
||||
filename,
|
||||
sourceEventType,
|
||||
}).then(error => {
|
||||
if (error) {
|
||||
// If downloading failed in `PdfStreamConverter.jsm` it's very unlikely
|
||||
|
@ -275,7 +274,7 @@ class MozL10n {
|
|||
if (!PDFViewerApplication.initialized) {
|
||||
return;
|
||||
}
|
||||
PDFViewerApplication.eventBus.dispatch(type, { source: window });
|
||||
PDFViewerApplication.eventBus.dispatch("download", { source: window });
|
||||
};
|
||||
|
||||
window.addEventListener("save", handleEvent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue