Open Bug 1675720 Opened 4 years ago Updated 2 years ago

print.print_to_filename overwritten on opening of print prompt

Categories

(Core :: Printing: Setup, defect, P3)

Firefox 82
defect

Tracking

()

People

(Reporter: benc853, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0

Steps to reproduce:

print.print_to_filename was set within preferences.json (locked), syspref.js (locked), or manually set in about:config.
"Ctrl + p" to bring up print prompt.
Select print to file.

Actual results:

File save location is either:
When running Firefox within container (zabenno/firefox:full): //mozilla.pdf
When running via apt install on Ubuntu (20|18).04: ~/mozilla.pdf

Expected results:

File save location be the path set within print.print_to_filename preference rather than generated value.

This is a new bug with version 82, version 81 functions correctly.

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

Hey benc853,

Thanks for reporting this.

Just a add some clarification, this affects the native print dialog on Ubuntu.

I looked into it with mozregression and found this range:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=6ade89a5867fe41bdd01683b406e1a7d95a3a1e0&tochange=c0f3cbdf8ac5bc018a9d67e5f1c56761a894a66e

Bob, do you think you could take a look to see what may be happening here?

Flags: needinfo?(bobowencode)

(In reply to Erik Nordin [:nordzilla] from comment #1)

Hey benc853,

Thanks for reporting this.

Just a add some clarification, this affects the native print dialog on Ubuntu.

I looked into it with mozregression and found this range:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=6ade89a5867fe41bdd01683b406e1a7d95a3a1e0&tochange=c0f3cbdf8ac5bc018a9d67e5f1c56761a894a66e

Bob, do you think you could take a look to see what may be happening here?

My guess is that you need to add nsIPrintSettings::kInitSaveToFileName into those lists of global settings to read.

Flags: needinfo?(bobowencode)

The severity field is not set for this bug.
:mats, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mats)

Erik, do you have cycles to follow up on Bob's comment 2 here?

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mats) → needinfo?(enordin)
Keywords: regression
Regressed by: 1667953

Yes, I will take a look at this.

Assignee: nobody → enordin
Flags: needinfo?(enordin)
Attachment #9191741 - Attachment description: Bug 1675720 - Fix to-file-name pref on Linux system print UI -- WIP → Bug 1675720 - Fix to-file-name pref on Linux system print UI r=emilio,bobowen
Attachment #9191741 - Attachment description: Bug 1675720 - Fix to-file-name pref on Linux system print UI r=emilio,bobowen → Bug 1675720 - WIP
Attachment #9191741 - Attachment description: Bug 1675720 - WIP → Bug 1675720 - Fix print_to_filename prefs for Linux system dialog r=emilio,bobowen,mstriemer
Pushed by enordin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f8e28ebbdaa0 Fix print_to_filename prefs for Linux system dialog r=emilio
Backout by abutkovits@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3b68e1da2db1 Backed out changeset f8e28ebbdaa0 for causing failures on browser_system_dialog_subdialog_hidden.js. CLOSED TREE

I am still looking into why these changes would have caused a dialog to be hidden.

Flags: needinfo?(enordin)

The patch that exists attempted to remove a line of front-end code that appeared to be causing this regression.

It took me a while to hunt down this particular line because

  1. This functionality broke in multiple places, so mozregression did not locate the only spot that broke the code.
  2. The front-end code that appears to cause the regression seems completely unrelated to the behavior that changed.

Given that removing the front-end line of code that fixes this regression ended up causing another issue, I do not necessarily feel like this is the right approach to fix the problem.

Unfortunately, I don't have the cycles right now to dig deeper into the root cause of this issue, and why it's being affected by the front-end code that this patch removes.

Assignee: enordin → nobody
Priority: -- → P3

Hi,
As per comment 1 I will update "has regression range" field accordingly.
Best,
Clara

Has Regression Range: --- → yes

Firefox ESR 91 on Debian still ignores "print.printer_Mozilla_Save_to_PDF.print_to_filename" preference and instead offers to save the PDF file named according to the website title directly to the user's home directory.

The "print.printer_Print_to_File.print_to_filename" preference works if one uses the new "Print" interface only to activate the "Print using the system dialog" option (i.e. printer_Print_to_File) to save the PDF. If one uses the new "Print" interface (i.e. printer_Mozilla_Save_to_PDF) to save the PDF the "print.printer_Mozilla_Save_to_PDF.print_to_filename" preference disappears in "about:config". After that the "print.printer_Print_to_File.print_to_filename" preference no longer works although it remains in "about:config".

Is the "print_to_filename" value stored in a way shared by both print dialogs and are values from "print.printer_*.print_to_filename" preferences loaded only once after Firefox or Print dialog starts?

Maybe the inconsistent behavior I noticed could be caused by or related to the following source code part:
https://searchfox.org/mozilla-central/source/toolkit/components/printing/content/print.js#430

I don't know what potentially sensitive info usually appears in website titles and I cannot access the Bug 1675965. But I would sure appreciate if I could force Firefox to not bother with website titles at all when saving printed website as PDF. All I need from Firefox printing is to offer a default filename like "~/SomePath/WebPrint.pdf". Why? Because the website titles are often too long, too inconsistent or even irrelevant and also may contain weird Unicode characters = in short completely unusable/unacceptable source for filenames I prefer on my system.

Attachment #9191741 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: