Open Bug 2076745 Opened 1 month ago Updated 13 hours ago

PDF in iframe renders in pdf.js instead of the configured external application (regression in 157)

Categories

(Firefox :: PDF Viewer, defect, P1)

Firefox 157
defect

Tracking

()

ASSIGNED
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox158 --- wontfix
firefox159 --- wontfix
firefox160 --- fix-optional

People

(Reporter: faical.abaza, Assigned: calixte)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 external file)

Attached file testcase.html —

Steps to reproduce

  1. In Settings > Files and Applications, set "Portable Document Format (PDF)" to "Use [external application]" (tested with Adobe Acrobat Reader).
  2. Load a web page that embeds a PDF in an iframe (see attached testcase).

Environment: Windows 11 64-bit, Firefox 157.0 (fr). Reproduced on both managed and unmanaged machines. No Handlers, PDFjs or DisableBuiltinPDFViewer enterprise policies are set.

Actual results

The PDF is rendered inside the iframe with the built-in viewer (pdf.js). The external application setting is ignored.

With pdfjs.disabled=true, the iframe shows "Unable to display this PDF here" with an "Open PDF" button, which downloads the file and only then opens it in the external application.

Direct links to PDF files still open correctly in the external application. Only the iframe case is affected.

Also reproduces in Firefox 158 Beta.

Expected results

The configured external application opens the PDF, as it did in Firefox 156 (works as expected in 156.0b5, broken in 157.0 and 158 Beta).

Business impact: we are an MSP. Several of our customers use a web ERP that shows generated PDFs (purchase orders, invoices) in an iframe. Their users relied on this behavior to open the PDF directly in their PDF editor and send it by email from there. About 18 machines are affected so far across 5 customers, with more expected as they update to 157. Current workaround: pdfjs.disabled=true, which adds an extra click and disables PDF preview on all sites.

I can confirm this regression on Firefox 157.0 (Windows 11).

The PDF is loaded through an iframe. The response headers are:

Content-Type: application/pdf
Content-Disposition: inline; filename=document.pdf

I tested versions:

  • Firefox 156: the PDF inside the iframe opens directly with the configured external PDF application (Foxit PDF Reader).
  • Firefox 157: Firefox handles it with PDF.js instead.

Opening the iframe PDF URL directly in a new tab still launches Foxit correctly in 157.

The user should be allowed to choose how to open the PDF, regardless of the page structure or response data.

I can reproduce this regression on Windows 11 with Firefox 157.0 (64-bit).

My PDF handling preference is configured to open PDF files with PDF-XChange Viewer, an external application.

After Firefox updated from 156.0.1 to 157.0, PDF documents served by the Brazilian eproc judicial system stopped opening automatically in PDF-XChange Viewer. Instead, they open in Firefox's built-in PDF viewer.

I verified the relevant settings. Setting pdfjs.disabled=true does not restore the previous behavior; instead Firefox displays "This PDF cannot be displayed here" with an "Open PDF" button, requiring an additional click.

I then downgraded Firefox from 157.0 to 156.0.1, using the same Firefox profile and without changing the PDF handler configuration. The previous behavior was immediately restored: clicking the PDF in eproc automatically opens it in PDF-XChange Viewer.

Therefore, in my case the regression is specifically reproducible in Firefox 157.0 and disappears when reverting to 156.0.1.

The issue occurs on more than one eproc installation/domain, so it does not appear to be specific to a single website.

This has a significant impact on my daily workflow. I work extensively with the Brazilian electronic judicial system (eproc) and need to open a large number of PDF documents throughout the day. Previously, each PDF opened directly and automatically in my configured external viewer. With Firefox 157, the additional browser step required for every document significantly disrupts this workflow, especially when reviewing cases containing many PDF files.

For users who routinely handle large volumes of PDF documents, preserving the configured external-application behavior is important, rather than requiring an additional action for every embedded PDF.

Duplicate of this bug: 2078210

calixte, could this be a regressed by bug 2076745?

edit: ha! wrong bug #

Component: Untriaged → PDF Viewer
Flags: needinfo?(cdenizet)
Assignee: nobody → cdenizet
Severity: -- → S3
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(cdenizet)
Keywords: regression
Priority: -- → P1
Regressed by: 2049760

Set release status flags based on info from the regressing bug 2049760

Let unsandboxed frame attribute loads use the configured external PDF
application instead of forcing the viewer or fallback. Keep bypassing
"Always ask" and "Save file" for these loads, and accept GIO handlers.

See Also: → 2076852
Duplicate of this bug: 2080917
See Also: → 2082998

Will this get fixed? In Firefox 160.1 still when printing PDF it dos not open the assigned app and still opens Firefox print dialog box..

A fix for this would be nice. The PDF action is inconsistent. We use this feature heavily. It seems that started happening when a fix was applied for the Mac IOS, it fixed them and broke us.

I'll rework on it asap.
Thank you for the reminder :).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: