diff --git a/web/app.js b/web/app.js index 1dfb6e66c9eb08..07980c90734b84 100644 --- a/web/app.js +++ b/web/app.js @@ -991,18 +991,20 @@ 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; + if (typeof PDFJSDev !== "undefined" && !PDFJSDev.test("MOZCENTRAL")) { + if (args.url) { + // The Firefox built-in viewer always calls `setTitleUsingUrl`, before + // `initPassiveLoading`, and it never provides an `originalUrl` here. + this.setTitleUsingUrl( + args.originalUrl || args.url, + /* downloadUrl = */ args.url + ); } - } else if (args.url) { - // The Firefox built-in viewer always calls `setTitleUsingUrl`, before - // `initPassiveLoading`, and it never provides an `originalUrl` here. - this.setTitleUsingUrl( - args.originalUrl || args.url, - /* downloadUrl = */ args.url - ); } + if (args.data && isPdfFile(args.filename)) { + this._contentDispositionFilename = args.filename; + } + // Always set `docBaseUrl` in development mode, and in the (various) // extension builds. if (typeof PDFJSDev === "undefined") {