Open Bug 1683947 Opened 5 years ago Updated 24 days ago

The printing popup opens when opening some pdf files

Categories

(Firefox :: PDF Viewer, defect)

Firefox 84
defect

Tracking

()

Tracking Status
firefox84 --- affected
firefox85 --- affected
firefox86 --- affected

People

(Reporter: u676766, Unassigned)

References

Details

(Whiteboard: [pdfjs-javascript])

Attachments

(1 file)

119.70 KB, application/pdf
Details
Attached file L_3_B.pdf

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11.1; rv:84.0) Gecko/20100101 Firefox/84.0

Steps to reproduce:

Open the pdf attached to this bug report.

Actual results:

Immediately on opening, the printing modal opens as well.

Expected results:

The printing modal should not open.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → PDF Viewer

Manage to reproduce the issue on Windows 10 x64, MacOS 10.15 and on Ubuntu 20.04 x64.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → All

In this pdf there is script which must be ran when the document is opened:

this.print({bUI:true,bSilent:false,bShrinkToFit:true});

So it's the expected behaviour.

Anyway the implementation relies on window.print which can be disabled using a pref dom.enable_window_print.
And I just tested the pdf with Acrobat DC under Windows and the behaviour is the same.

Chrome and Safari do not have this behavior. If it was implemented like this on purpose maybe it should be challenged?

Flags: needinfo?(cdenizet)

You can find the reason why we did that here:
https://bugzilla.mozilla.org/show_bug.cgi?id=843342

Flags: needinfo?(cdenizet)

(In reply to Calixte Denizet (:calixte) from comment #6)

You can find the reason why we did that here:
https://bugzilla.mozilla.org/show_bug.cgi?id=843342

This was 8 years ago. I think it should be challenged again. Other browser do not behave like this.

Confirming this behaviour with Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0

But it also happen when opening the pdf with Adobe Acrobat, so as in Comment 3 mentioned it is a defined by a script in the pdf. So it should behave this way.

I suggest to close it as invalid.

Romain, what do you think the right behaviour should be here?
I would keep the current behaviour as it is consistent with Adobe Acrobat, though I understand the concern that this doesn't feel webby.

Flags: needinfo?(rtestard)

Is there a supported configuration where this could result in having the page print automatically (i.e a website can launch a print-out when serving a pdf document without user intervention)?
It seems this was supported on PDFium but then removed given they have a policy to open print dialogue following user gesture (https://bugs.chromium.org/p/chromium/issues/detail?id=968914) - useful thread https://stackoverflow.com/questions/57895126/chrome-77-not-auto-printing-pdfs: https://bugs.chromium.org/p/chromium/issues/detail?id=968914

I can trust that some websites rely on this feature although this is likely rare and declining fast if sites cannot rely on Chrome to work.
Overall I feel like this bug should be fixed in case it exposes users to potential threats, otherwise we should won't fix to avoid breaking existing (rare) sites that may have custom code for Firefox.

Flags: needinfo?(rtestard)
Whiteboard: [pdfjs-form-js]
Whiteboard: [pdfjs-form-js] → [pdfjs-javascript]
Duplicate of this bug: 2039456
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: