mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-03 16:51:09 +02:00
Support providing a filename unconditionally, when passing binary data to PDFViewerApplication.open
Previously this was only supported in Firefox, however when merging PDFs the `PDFViewerApplication.onSaveAndLoad` method will provide a `filename` unconditionally.
This commit is contained in:
parent
e86e9d9465
commit
0763c69b6a
11
web/app.js
11
web/app.js
@ -1220,11 +1220,12 @@ const PDFViewerApplication = {
|
||||
const workerParams = AppOptions.getAll(OptionKind.WORKER);
|
||||
Object.assign(GlobalWorkerOptions, workerParams);
|
||||
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
if (args.data && isPdfFile(args.filename)) {
|
||||
this._contentDispositionFilename = args.filename;
|
||||
}
|
||||
} else if (args.url) {
|
||||
if (args.data && isPdfFile(args.filename)) {
|
||||
this._contentDispositionFilename = args.filename;
|
||||
} else if (
|
||||
(typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) &&
|
||||
args.url
|
||||
) {
|
||||
// The Firefox built-in viewer always calls `setTitleUsingUrl`, before
|
||||
// `initPassiveLoading`, and it never provides an `originalUrl` here.
|
||||
this.setTitleUsingUrl(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user