Closed Bug 1592160 Opened 5 years ago Closed 2 years ago

Firefox doesn't use site-specific browser.download.lastDir when saving PDF Viewer blobs

Categories

(Toolkit :: Downloads API, defect, P3)

70 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1768383

People

(Reporter: jfenn, Unassigned)

References

(Blocks 1 open bug)

Details

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

Steps to reproduce:

I set browser.download.lastdir.savepersite to true years ago. Now, I upgraded to the Firefox 70.0 release.

Actual results:

I found that Firefox fails to remember the last directory a file had been saved to before when I return to a particular website and save a file to disk.

Expected results:

Firefox should remember that the last file I saved from a certain domain/URL to disk was saved to a certain local directory, and Firefox should select this directory again. This used to work in FF before version 70.0.

Please provide actual steps to reproduce the issue.
https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines

  • The correct preference name is browser.download.lastDir.savePerSite
  • When creating the preference, it must be set to type boolean
  • The default behavior has always been a value of true; creating the preference with that value will not affect anything. See bug 702748 for why this hidden preference was introduced.
Has STR: --- → no
Component: Untriaged → Downloads API
Flags: needinfo?(jfenn)
Product: Firefox → Toolkit

I am not quite sure what to add now. I try this:

(In reply to Gingerbread Man from comment #1)

Please provide actual steps to reproduce the issue.
https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines

Save a website. Save more other websites. Return to the first site. Firefox won't open the save dialogue to the local directory the first site was saved to, but rather the last one. This used to be different when browser.download.lastDir.savePerSite is set to true.

  • The correct preference name is browser.download.lastDir.savePerSite

Yes, sure.

  • When creating the preference, it must be set to type boolean

This is so.

  • The default behavior has always been a value of true; creating the preference with that value will not affect anything. See bug 702748 for why this hidden preference was introduced.

Not quite true. The feature was lost at some time, but I configured every Firefox setup this way, and it worked for me. No more.

Hope this helps.

Flags: needinfo?(jfenn)
Summary: browser.download.lastdir.savepersite stopped working in Firefox 70.0 → browser.download.lastDir.savePerSite stopped working in Firefox 70.0

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
20191016161957

(In reply to schneeschmelze from comment #2)

Save a website. Save more other websites. Return to the first site. Firefox won't open the save dialogue to the local directory the first site was
saved to, but rather the last one.

Please provide actual steps to reproduce the issue. The following works for me:

  1. https://en.wikipedia.org/wiki/Main_Page
  2. Right-click the image under From today's featured article and choose Save Image As… then save the file to the desktop.
  3. In a new tab, open https://www.mozilla.org/en-US/
  4. Right-click an image and choose Save Image As… then save the file elsewhere (I picked the Music folder).
  5. Back in the Wikipedia tab, right-click the image under In the news and choose Save Image As…

Actual results:
Firefox offers to save the file to the desktop. Same result with Save Link As…

This is what I just tried to do:

  • Open https://www.vzbv.de/sites/default/files/downloads/2019/10/28/eu_newsletter_2019_19_tbo_ibu.pdf
  • Whenever I used to visit files from the site vzbv.de Firefox saved such pdfs to the same local directory I had selected the last time I saved a file from that website.
  • But this time Firefox returned to the last directory I had used for saving a file to.
  • So, Firefox does not remember the place to save a file to per domain or per website, as it used to.
  • This should please be fixed in order to make it work as it used to.

Works for me:

  1. https://www.vzbv.de
  2. Right-click an image and choose Save Image As… then save the file to the desktop.
  3. In a new tab, open https://www.mozilla.org/en-US/
  4. Right-click an image and choose Save Image As… then save the file elsewhere (I picked the Music folder).
  5. In a new tab, open the PDF from www.vzbv.de
  6. Click the Download button in the top right corner of the PDF viewer toolbar. At the "You have chosen to open…" prompt, choose to save the file, then click the OK button.

Actual results:
Firefox offers to save the file to the desktop. Same behavior if in about:preferences the action for PDF is set to Save File.

Well, as I've said before, this does not work for me.

If you followed the steps at comment 5 to the letter, please enter about:profiles into the address bar, create a new profile, then click the Launch profile in new browser button and try again there.

The priority flag is not set for this bug.
:mak, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mak)

When it doesn't work, do you see any errors in the Browser Console?

It's possible your database broke somehow, when Firefox is closed, you can try renaming content-prefs.sqlite to content-prefs.sqlite.corrupt and let Firefox generate a new one. There may be some minor dataloss (content preferences will be lost), but could solve the problem.

Flags: needinfo?(mak) → needinfo?(jfenn)

We are unable to reproduce this bug and we need more information to proceed.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE

There is a discussion on Mozilla Support today about using the Download button (or Save Page As) from the PDF viewer, and how it uses the value of the browser.download.lastDir preference in about:config/prefs.js rather than the value of the site-specific browser.download.lastDir for the host stored in content-prefs.sqlite. https://support.mozilla.org/questions/1386344

Steps to reproduce would be:

(0) On the Settings page, enable "Always ask you where to save files"

(1) To establish a per-site last download directory, save a PDF from a site to a specific folder using right-click > Save Link As...

For example: https://www.copyright.gov/circs/circ61.pdf

(2) Save any page, image, or download from a different site (such as this page) to a different folder

(3) Open the PDF from Step 1 in the built-in PDF viewer and use either Download or Save Page As...

BUG: Firefox opens the Save As dialog to the save folder from #2 rather than from #1

I don't know whether the code path for saving from the viewer is skipping a step, or it lacks database access, or something else is going on.

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INCOMPLETE → ---

Looking at content-prefs.sqlite after a few saves, it appears that the PDF viewer doesn't have the same host name as the source website. For example:

  • Save Page As for an HTML page or right-click > Save Link As... => groups.name = www.copyright.gov
  • Save from PDF viewer => groups.name = blob:resource://pdf.js/69ebee76-e8ef-4775-bec2-ad2e1cd186f8
Summary: browser.download.lastDir.savePerSite stopped working in Firefox 70.0 → Firefox doesn't use site-specific browser.download.lastDir when saving from PDF Viewer

Redirect a needinfo that is pending on an inactive user to the triage owner.
:mak, since the bug has recent activity, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jfenn) → needinfo?(mak)

Thank you for finding additional information about this.
That behavior may be a regression due to recent changes that made the pdf reader use blobs. Indeed the blob doesn't provide info about the source host, thus the download process can't use that info.

Blocks: 1744297
Severity: normal → S3
Flags: needinfo?(mak)
Priority: -- → P3
Summary: Firefox doesn't use site-specific browser.download.lastDir when saving from PDF Viewer → Firefox doesn't use site-specific browser.download.lastDir when saving PDF Viewer blobs

We actually found bug 1768383 that is exactly tracking the pdf.js problem and has more debugging info.

Status: REOPENED → RESOLVED
Closed: 5 years ago2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.