mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-03 08:41:01 +02:00
Merge pull request #21249 from Snuffleupagus/open-filename-unconditional
Support providing a `filename` unconditionally, when passing binary data to `PDFViewerApplication.open`
This commit is contained in:
commit
1079535a1e
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