Firefox blocks/chokes on download from localhost
When I start Firefox with 'offline' option and connect to a server on the localhost, the browser does not seem do send any download requests to the server.
For example, if I click a link on pdf file, nothing happens. The (local) server does not receive the request. Mysteriously, when I restart Firefox, the document requested in the previous session downloads!
Is this by design or a bug or something that I am doing wrong? I would like (and expected) that while in offline mode, I am still able to have a fully functional/normal connection to a server on the localhost. Is this not correct?
Thanks!
Cheers; 'best, shankar swamy
Ndryshuar
Krejt Përgjigjet (12)
Is your http://localhost/ mapped to http://127.0.0.1/ or similar at the system level (e.g., Windows hosts file)?
If so, does the IP address work in offline mode?
I ask because in an old bug I saw mention that in offline mode, DNS resolution stops, so unless you had very recently cached the IP address for localhost before going offline, Firefox will not be able to resolve it.
But also, there is this preference that sounds as though it should work around the issue in my first comment:
(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.
(2) In the search box above the list, type or paste OFFL and pause while the list is filtered
(3) If the network.dns.offline-localhost preference is bolded and "modified" or "user set" to false, double-click it to restore the default value of true
Does that make any difference?
Thank you for looking into this and your response.
On further testing - the problem is worse.
The issue as I understand now: 1. This happens whether or not I am in offline mode.
2. Firefox version: 63.0.3 (64-bit) on Windows 10 64-bits. I have a local server which I access as: localhost:port# running node.js/express.
When I click on a hyperlink to a pdf file, normally it should open the pdf file.
What is happening: sporadically it works as expected. But most times, the document is not opened. When the document does not open, if I close Firefox following happens: 1. Firefox asks me if I want to close it while a download is pending. (If I say 'no' and wait, nothing happens. I say 'yes' and close it.) 2. and I open Firefox again, the documents I had requested in the previous open up!
I did check "network.dns.offline-localhost " for whatever it was worth - and they are set to default.
Again, my earlier contention was wrong: it does not happen JUST in offline mode. It is sporadic and happens irrespective of whether it is offline/online.
Thanks!
swamyshankar said
When I click on a hyperlink to a pdf file, normally it should open the pdf file. What is happening: sporadically it works as expected. But most times, the document is not opened. When the document does not open, if I close Firefox following happens:
1. Firefox asks me if I want to close it while a download is pending. (If I say 'no' and wait, nothing happens. I say 'yes' and close it.)
2. and I open Firefox again, the documents I had requested in the previous open up!
Does this only occur with PDFs you open from localhost, not from the web? Does the download arrow show progress, or stalled progress, if you click it and check the panel?
1. Only on the local server. We have not seen this happen on the remote docs.
2. Download arrow does not show any progress. There is no sign of even the request having left the client. Not sure what gives.
What is more surprising is that the system works seamlessly with Chrome and with Old version of Firefox, for example with: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0".
Thanks!
I don't know why the downloads don't show up in the UI as expected.
What's more frustrating is, if I open the Firefox debugger and try, it just works fine!
When I try to close Firefox, it asks: "If you exit now, 3 downloads will be canceled. Are you sure you want to exit?'.
Would you know where/how I can check where these downloads are recorded and where they are stuck? In other words, how does Firefox know I have pending downloads? May be that could give me some clues. Thanks!
After I rebooted the system and started from scratch, now I see the download arrow! That is some progress!!
But the download arrow shows the animation but constantly shows "unknown time left 0 bytes (0 bytes/sec)" and sits there for ever.
Again, if I close down Firefox and restart it, as soon as I restart, the document automatically opens itself!
To close the topic, for now, here is the summary:
Problem: Frequently, but not always, the Firefox browser 64.0 does not receive pdf documents from the server on the localhost. This is happening only with the localhost. This happens roughly 50% of the times. The 50% of the time it works, if it downloads the document the first time, then it continues to work throughout the session.
When it does not work, if we close the browser, the browser warns about pending download and the download bar shows 0 bytes received and download speed of 0 bytes/sec. If we go ahead & close the browser, and then reopen. On reopen, the previously requested document shows up!
Chrorme, Edge do not have this problem. Very old <= 54 version of Firefox does not have this problem either.
So, for now, we have concluded that this is an issue with the recent versions of Firefox and will keep checking with future releases.
Do all the downloads have different file names?
If you discover a pattern, or to get tips on more detailed logging than we are aware of, you could file a bug:
We'll do that.
We are still not able to exactly nail down the issue here. But it seems right now, that it is an issue with the browser. If/when we have a test case that can reproduce this consistently, we will post it here.
We will also keep checking with future browser releases and will post a update, if this issue disappears.