Firefox in Private Browsing Mode deletes downloaded files upon exit
Categories
(Firefox :: Private Browsing, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr102 | --- | unaffected |
firefox109 | --- | wontfix |
firefox110 | --- | wontfix |
firefox111 | --- | wontfix |
People
(Reporter: laurens, Unassigned)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: dataloss, regression)
Comment 6•9 years ago
|
||
Comment 7•8 years ago
|
||
Updated•8 years ago
|
I can confirm this bug as well. Upon exit, files that I downloaded during the session were deleted from my Downloads folder. All other files in the Downloads folder remained untouched. I've only encountered this bug 3 or 4 times. It seems to typically happen unpredictably so I have no clue how to reproduce it. It's very rare, but since I only use private browsing mode, I probably hit this bug more often than others.
It may also be worth mentioning that this is not always limited to deleting a single file - I've had multiple files deleted upon exit that were downloaded in a single session. I also have had .mkv files deleted, so this is not limited to just PDF or zip files. I suspect that the file type may be irrelevant.
I've also had this occur 2 times in a row. I downloaded some files, closed the session, and then saw that the files were deleted. I then reopened the browser, re-downloaded the files, closed the browser, and saw that they were deleted again! This leads me to believe that this is not entirely random.
I am also encountering this issue with Firefox 100.0.1. Downloaded a PDF file in private mode from Gmail, quit Firefox and the file disappeared. I was puzzled where the file went at first and downloaded the same PDF again in private mode and quit Firefox. Again, it was deleted. At first I thought it was some sort of self-deleting file.
It may be noteworthy that the PDF file was viewed in Firefox before being downloaded.
If this is an intended feature then it definitely needs to be made clear to the user to prevent confusion. Ideally, it should also be set as an option.
Comment 10•3 years ago
|
||
Just ran into this issue as well after doing an online purchase. Luckily I also received an e-mail with the PDF files, but to me this behavior is both unintuitive and undesirable. When closing a Private Browsing session, Firefox should give a pop-up asking whether it should delete the downloaded files (with a "Don't ask me again" checkbox).
Comment 11•3 years ago
|
||
Very well said, Anthony. Ran into it yesterday myself. Unintuitive and undesirable. Had to double check not that stupid Win Defender was flagging my PDF files as malicious or something for some unknown reason. Good to know I am not the only one. Also extremely strange that the PDF would auto-open after the download. I have my own program, thank you very much. I hit a direct download link. It was finished, present in my Download folder for a while. I could swear it was still there even after I closed Firefox. Strange.
Comment 12•3 years ago
|
||
I have also experienced this problem. I literally saw my downloaded files being removed before my eyes in windows explorer just after I had closed firefox.
However, I've unable to reproduce it. If I download a test file is in a private window and immediately close it, this behavior did not manifest. It may be noteworthy that it seems to happen with long firefox sessions, where the browser window is left opened after all files are downloaded.
version: Firefox 103.0.2
platform: win64
Comment 13•3 years ago
|
||
I've managed to reproduce the problem even in troubleshoot.
It manifests when a PDF is downloaded where the <a> tag has the download attribute set.
Steps to reproduce:
- Save an html file with the following contents:
"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
<a href="document.pdf" download="FileName">Firefox will remove it</a>
<p/>
<a href="document2.pdf">OK</a>
<p/>
<a href="data.zip">OK</a>
</body>
</html>
"
- Add in the same path the files "document.pdf" "document2.pdf" "data.zip". Any file will work.
- I launched a server with "python -m http.server" to serve all these files, so that the download attribute works with CORS.
- Launch firefox and open a private window.
- Open the html file and click on the link "Firefox will remove it".
- In my platform the file gets downloaded to "C:\Users{MY USERNAME}\Downloads". Then the file gets opened in firefox as usual.
- Close all firefox windows. The file gets removed.
The other files with the other links work as expected at least for me.
version: Firefox 103.0.2
platform: win64
Comment 14•3 years ago
|
||
I have dug into the source code and I think, considering that I have absolutely no experience with the Mozilla-Source Code, that I have found the gist of the problem:
In mozilla-central/toolkit/components/downloads/DownloadCore.jsm, line 606, in the function "_succed" within the object Download we have the following (some code ommited):
https://searchfox.org/mozilla-central/source/toolkit/components/downloads/DownloadCore.jsm#617
"
async _succeed() {
...
if (this.launchWhenSucceeded) {
...
if (this.source.isPrivate) {
lazy.gExternalAppLauncher.deleteTemporaryPrivateFileWhenPossible(
new lazy.FileUtils.File(this.target.path)
);
} ...
}
},
"
So, it seems that if the window is private and the file is supposed to be launched (for instance a PDF is opened with the integrated PDF reader), then the file shall be deleted later. It makes sense when a PDF file is downloaded in the temporary folder and then opened immediately.
But there is no logic to check that.
Also, the bug should be reclassified as NEW. It can be reproduced.
Comment 15•3 years ago
|
||
I also encountered this with PDF files, which were previously opened in a Firefox tab in the same private window.
And (using Windows here), these PDF files had a "Read-only" attribute.
I don't remember if this ever happened with non-PDF files, however. I definitely downloaded some ISO and RAR files that were not deleted.
Updated•3 years ago
|
Comment 16•3 years ago
|
||
I also encountered this after a recent update to Firefox.
I export emails from ProtonMail for easy access and backup, and they are downloaded as ".eml" files that can be viewed in Thunderbird. Prior to a recent Firefox update these files were downloaded to the Download directory without being opened immediately. After the update, however, the files are downloaded and are opened immediately in Thunderbird.
A few days ago I downloaded a bunch of these files, but when I tried to access them today they were missing from the Download folder. I am certain I had downloaded them and I had viewed them in Thunderbird. Some of them are already backed up in a zip archive I created, but were somehow deleted from the Download folder after Firefox was restarted after the latest update.
Current setup:
- Windows 10 x64.
- Firefox 106.0.3 (64-bit), running in private window mode.
Comment 17•3 years ago
|
||
I got the same error. I downloaded pdf file in the private mode and after I closed Firefox, my downloaded pdf file got deleted instantly.
It was saved on desktop, not any temporary folder.
Only happens to pdf files. I also downloaded a jpg file and nothing happened to it.
I use the latest version 106.0.5 (64-bit) of Firefox.
Windows 10.
Please fix this problem, it is crucial. I almost lost a very important document.
Comment 18•3 years ago
|
||
I'm experiencing this error as well. Mac OS Ventura 13.0.1, latest Firefox version 107.0 (64-bit)
Comment 19•3 years ago
|
||
This is utterly unexpected and destructive behaviour! I just lost a government's approval pdf that had a one-time download lock on it 😡
This should be opt-in if at all!
![]() |
||
Comment 20•3 years ago
|
||
also experiencing this issue:
Firefox 109.0 (64-bit) on Win10
downloaded a pdf file from firefox in a private window, upon closing the private window ff apparently deleted it from my downloads folder
only way to avert this is to copy the file to another directory before closing the window
Comment 21•3 years ago
|
||
This is very critical issue and needs to be acknowledged and fixed and priority. It should be at least P1 priority if not P0.
Version : 109.0 (64-bit)
OS: MacOS Ventura 13.0.1
Comment 22•3 years ago
|
||
This bug has been morphed to a recent regression which is different from a 7-years-old problem.
Steps to reproduce:
- Open https://125naroom.com/web/3985#s_02 (sorry Japanese site) in a private window.
- Click "クリックするとPDFがダウンロードされます" to download a PDF.
- Open the download folder and watch the downloaded file.
- Close the private window.
Actual result:
The downloaded file will vanish from the download folder.
Expected result:
The downloaded file should stay in the download folder.
Regression range: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=110862c2c4da9f9cb2b6ecc64668fac0b6275350&tochange=77e7d5bff788d193d37f486abe9a5eb1571ae540
Note: before the above regression range, the PDF will not appear in the download folder from the start. But it is an expected behavior.
Resetting priority/severity for re-evaluation.
Comment 23•3 years ago
|
||
Set release status flags based on info from the regressing bug 1772569
:enndeakin, since you are the author of the regressor, bug 1772569, could you take a look? Also, could you set the severity field?
For more information, please visit auto_nag documentation.
Comment 24•3 years ago
|
||
I found a second regression range: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=33d6ea7b0aadaa1fcdb03690d82cf9459764a9d7&tochange=6c01444e17210e96f5fb322c7b55a2e9f87ec0b0
Before this range, the download dialog appear and the problem does not happen even if I choose save from the dialog.
After this range, the download dialog will not appear and the problem happens.
Probably due to bug 1732347.
Updated•3 years ago
|
Updated•3 years ago
|
Description
•