Closed Bug 1661751 Opened 1 year ago Closed 1 year ago

Firefox print dialog doesn't get past throbber & "Preparing Preview", starting in Firefox 80

Categories

(Toolkit :: Printing, defect)

80 Branch
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: formyrebates, Unassigned, NeedInfo)

References

Details

(Whiteboard: [print2020])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

After allowing upgrade from 79.0 to 80.0, Firefox will not print. A window appears indicating that it is preparing to print, but does not progress to actually printing.
I tried clearing history and cache. No joy. I tried rebooting. No joy. Tried deleting print_printer. No joy. I had to uninstall 80.0 and re-install 79.0 with a new profile to repair this problem.

Actual results:

After allowing upgrade from 79.0 to 80.0, Firefox will not print. A window appears indicating that it is preparing to print, but does not progress to actually printing.
I tried clearing history and cache. No joy. I tried rebooting. No joy. Tried deleting print_printer. No joy. I had to uninstall 80.0 and re-install 79.0 with a new profile to repair this problem.

Expected results:

After allowing upgrade from 79.0 to 80.0, Firefox will not print. A window appears indicating that it is preparing to print, but does not progress to actually printing.
I tried clearing history and cache. No joy. I tried rebooting. No joy. Tried deleting print_printer. No joy. I had to uninstall 80.0 and re-install 79.0 with a new profile to repair this problem.

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

Component: Untriaged → Printing: Output
Product: Firefox → Core

Hi — Could you please provide more information about your particular setup? It would help us better debug the issue.

  • When you try to print, are you using print preview or printing without print preview?
  • Are you able to save to PDF?
  • What type of printer do you have installed?
Flags: needinfo?(formyrebates)
Whiteboard: [print2020]

hi, reporter!

Following up on comment 2 -- would you mind helping us out with answers to the questions there?

I have the same problem on Linux on firefox from aurora channel. I noticed around 82.b0?? but it could have been earlier - I usually don't print from within Firefox.

Steps to repro:

  1. file -> print
  2. before it displays any options, it shows a spinner and doesn't make progress (so no option to try to print to a pdf).

My printing works otherwise (cups with default class pointing to a sole printer).

See screenshot at: http://www.saahbs.net/temp/0ea3c5/firefox-borked-printing.png

Hitting ESC does allow to return to browsing.

Creating a fresh profile and starting it with --safe-mode also repros.

Please advise, thanks! saahbs

saahbs: thanks for letting us know, and sorry to hear that. Could you try printing https://example.org/ and see if it happens there?

(I want to distinguish whether it's related to the particular content you were printing, or if it affects all content including https://example.org/ which is quite simple.)

Flags: needinfo?(rc)

Tried example.org and it repros.

If there is a "--verbose-extra=extra-extra" which I can run with to provide detailed log, let me know and I'll do it.

saahbs

Flags: needinfo?(rc)

(jwatt, do you know what next to suggest/request here?)

Flags: needinfo?(jwatt)

Hi saahbs. Thanks for the bug report! Since this started at a different time than the original commenter, this would ideally be reported as a separate bug report so we don't potentially end up having overlapping conversations about separate issues in one report. Whether you file a new bug to or not, the following would be very helpful:

If you open Tools -> Web Developer -> Browser Console, click the delete icon (trash can/bin) and then try to print again, I expect you will get some new error(s) in the Browser Console window. Can you copy and paste them so we can see what they are (or attach them as a file if there are a lot of them)?

It would also be very helpful if you can open the page about:support and click Copy text to clipboard and paste that as an attachment using the "Attach New File" button.

Flags: needinfo?(jwatt)
Attached file ff-about-support.txt

My browser auto updated to 82.0b7 and I can't repro anymore. The File->Print now goes directly to print dialog and everything works. Print preview ?is back? in the file menu (I think it was removed before and suspect the file->print went to broken preview mode).

What codepaths between 82.0b6 to b7 related to printing changed?

Attached is the support log.

I found a Linux notebook in the house running 80.0b6 (yes 80, not 82) without Cups and it showed File->Print dialog without issues. No repro.

I updated it to current 82.0b7 and again no repro.

Currently I have no machine with affected ff version. If you can point me to where I can manually fetch 82.0b6, I can downgrade on my cups configured machine and provide browser console dump.

thanks, saahbs

(In reply to saahbs from comment #10)

My browser auto updated to 82.0b7 and I can't repro anymore. The File->Print now goes directly to print dialog and everything works. Print preview ?is back? in the file menu (I think it was removed before and suspect the file->print went to broken preview mode).

If it helps: you can opt-in to the new UI (print preview integrated into print dialog) by setting print.tab_modal.enabled to true in about:config. (That pref is probably the thing that changed between b6 and b7, I would guess.)

(I think we have it set up so that it defaults to true for early-beta builds, vs. default to false for late-beta builds. That way we get some broader "early beta" testing of the new not-quite-ready-for-production codepath; and we also get coverage of the code that's actually going to ship to release users, during the late-beta period.)

Thanks dholbert, that did it, I was able to repro on 82.0b7 with print.tab_modal.enable = true.

I get the new preview UI, it is blank with a spinner and makes no progress.

Here is the error message when attempting to print example.com:

Uncaught (in promise) TypeError: can't access property "id", matchedPaper is undefined
refreshSettings chrome://global/content/print.js:434
init chrome://global/content/print.js:250
async* chrome://global/content/print.js:85
EventListener.handleEvent* chrome://global/content/print.js:82
print.js:434:9

Thanks, saahbs! That's really helpful. That points to this snippet of code in current trunk (it's identical to the code in beta, though the line number is a bit different):
https://searchfox.org/mozilla-central/rev/1a973762afcbc5066f73f1508b0c846872fe3952/toolkit/components/printing/content/print.js#423-438

It looks like in your case:
(1) We're hitting the clause that says // We didn't find a good match. Take the first paper size
(2) ...but our collection of paper sizes is probably empty for some reason.
(3) So the matchedPaper = Object.values(...)[0] ends up with undefined
(4) So matchedPaper.id ends up throwing an exception, and we never finish preparing the print dialog.

sfoster, it looks like you've worked on that snippet of code -- would you mind taking a look here and adding some sort of error-handling code for the case where the Object.values(...) expression returns an empty collection and matchedPaper ends up undefined?

Component: Printing: Output → Printing
Flags: needinfo?(sfoster)
Product: Core → Toolkit

Actually going to spin off a separate bug for saahbs' issue, since it looks likely that it's a recent regression (new in Firefox 82), which adds a bit of urgency to trying to fix it before it hits release. (And I don't want that fact to get mixed up due to the fact that comment 0 here was about Firefox 80.)

(So I think saahbs' issue probably had a different cause from the original reporter's issue here, though the symptoms do sound the same.)

Flags: needinfo?(sfoster)
Summary: Cannot Print After Upgrading From Firefox 79.0 to 80.0 → Firefox print dialog doesn't get past throbber & "Preparing Preview"
Summary: Firefox print dialog doesn't get past throbber & "Preparing Preview" → Firefox print dialog doesn't get past throbber & "Preparing Preview", starting in Firefox 80
See Also: → 1669631

Since we haven't heard back in a month I don't think we can take any action on the original bug report here

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
Resolution: INVALID → INCOMPLETE

For what it's worth, I see this problem on FF v86.01 (Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0)

Setting print.tab_modal.enabled to False restored print capabilities.

Uncaught (in promise) 
Exception   
columnNumber: 0
data: null
filename: "chrome://global/content/print.js"
lineNumber: 903
location: XPCWrappedNative_NoHelper { QueryInterface: QueryInterface(), filename: Getter, name: Getter, … }
message: "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPrinterList.systemDefaultPrinterName]"
name: "NS_ERROR_FAILURE"
result: 2147500037
stack: "getPrintDestinations@chrome://global/content/print.js:903:32\nasync*init@chrome://global/content/print.js:230:22\nasync*@chrome://global/content/print.js:91:45\nEventListener.handleEvent*@chrome://global/content/print.js:88:10\n"
<prototype>: ExceptionPrototype { toString: toString(), name: Getter, message: Getter, … }
print.js:903
See Also: → 1699343

Thanks, Jimmie! It's unlikely that your issue has the same root cause as the original reporter's issue 7 months ago, so I spun off bug 1699343 for the problem that you're hitting.

Firefox 94 print preview has turned up again, print.tab_modal.enabled is set to false.
certain web site when printing open up a about:printpreview dialog in the address bar and I wait for the print preview to show up after 30 seconds or maybe 45 seconds

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