1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Re-factor the blob-URL caching in DownloadManager.openOrDownloadData

Cache blob-URLs on the actual data, rather than DOM elements, to reduce potential duplicates (note the updated unit-test).
This commit is contained in:
Jonas Jenwald 2023-10-16 16:20:46 +02:00
parent 22d6d95f03
commit 674052d3fc
7 changed files with 17 additions and 18 deletions

View file

@ -806,7 +806,6 @@ class LinkAnnotationElement extends AnnotationElement {
link.href = this.linkService.getAnchorUrl("");
link.onclick = () => {
this.downloadManager?.openOrDownloadData(
this.container,
attachment.content,
attachment.filename,
dest
@ -2861,11 +2860,7 @@ class FileAttachmentAnnotationElement extends AnnotationElement {
* Download the file attachment associated with this annotation.
*/
#download() {
this.downloadManager?.openOrDownloadData(
this.container,
this.content,
this.filename
);
this.downloadManager?.openOrDownloadData(this.content, this.filename);
}
}