mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Use the native URL.createObjectURL
method in web/pdf_attachment_viewer.js
There's no particular reason for using the PDF.js helper function `createObjectURL` here, given that the relevant code-path is already guarded by multiple "disableCreateObjectURL" option checks.
This commit is contained in:
parent
0baabf69db
commit
cd666e3a37
1 changed files with 3 additions and 2 deletions
|
@ -14,7 +14,6 @@
|
|||
*/
|
||||
|
||||
import {
|
||||
createObjectURL,
|
||||
createPromiseCapability,
|
||||
getFilenameFromUrl,
|
||||
removeNullCharacters,
|
||||
|
@ -86,7 +85,9 @@ class PDFAttachmentViewer {
|
|||
let blobUrl;
|
||||
button.onclick = function () {
|
||||
if (!blobUrl) {
|
||||
blobUrl = createObjectURL(content, "application/pdf");
|
||||
blobUrl = URL.createObjectURL(
|
||||
new Blob([content], { type: "application/pdf" })
|
||||
);
|
||||
}
|
||||
let viewerUrl;
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue