From 2a0de0b66b41c345cd357cbb828b3ca6f49fd395 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 27 Aug 2020 16:01:45 +0200 Subject: [PATCH] Download, rather than opening, PDF attachments in Firefox (bug 1661259, PR 12286 follow-up) Unfortunately the work-around implemented in PR 12286 didn't actually work in all cases, please refer to the previous commit messages. To prevent opening of PDF attachments from being completely broken for some users, we'll simply force-download them for now in MOZCENTRAL-builds to unbreak things. (Given that the "Open with" dialog now features a "Open with Firefox"-option, this is less bad than it previously would've been.) --- web/pdf_attachment_viewer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web/pdf_attachment_viewer.js b/web/pdf_attachment_viewer.js index 6646830cd..079b083ca 100644 --- a/web/pdf_attachment_viewer.js +++ b/web/pdf_attachment_viewer.js @@ -172,6 +172,7 @@ class PDFAttachmentViewer extends BaseTreeViewer { const element = document.createElement("a"); if ( + (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) && PdfFileRegExp.test(filename) && !viewerCompatibilityParams.disableCreateObjectURL ) {