Offline mode prevents access to localhost




11 years ago
2 years ago


(Reporter: Darin Fisher, Assigned: bagder)


(Blocks: 1 bug)

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [Advo])


(1 attachment)



11 years ago
Offline mode prevents access to localhost

Right now, we just have a global online/offline boolean to control whether or not we have the ability to open sockets and make DNS requests.  This prevents us from browsing localhost while "offline".

With auto-detection of offline mode, I think this bug will end up getting more visibility.
Seconded. Since Novell is shipping autodetection of the network status there are some reports that local webapplications are not accessible.
This is nothing new.
Bug 87717 is about the same problem.
Depends on: 87717

Comment 2

10 years ago
-> reassign to default owner
Assignee: darin.moz → nobody

Comment 3

9 years ago
is there anything that could be done about not being able to access localhost when there is no Internet connection? it is really anoying...! Because of this I HAVE TO use M$$ browser (or Opera...) :((((  and I like my Firefox very much... 
You can manually uncheck "work offline".

Comment 5

9 years ago
It is darned annoying to have to manually uncheck "work offline" every time I start FF when I'm disconnected from the local network!  Please provide an option to disable automatic switching to offline mode.

once you uncheck work offline, firefox no longer automatically switches between offline and online (until you restart it)

Comment 7

9 years ago
(In reply to comment #6)
> once you uncheck work offline, firefox no longer automatically switches between
> offline and online (until you restart it)

This is true.  But I don't keep FF open when I'm not using it, and as I stated it's darned annoying to have to uncheck the box each time I start it.

As a Linux user, I find it quite unusual that a Linux app with the quality of FF is lacking a configuration option to disable having the app automatically make decisions like this for me.

Comment 8

9 years ago
In my case, "work offline" comes up selected whether I'm connected to a network or not.  I have to un-check it every time I start Firefox in order to browse the web.

The only thing I found that sort of fixed it was to have Network Manager running first, turn off offline mode there, then start Firefox.  But that is only a per-session solution.

Here is a list of discussions of the topic:

Comment 9

9 years ago
Darin: isn't this a dupe of Bug 87717?

Comment 10

9 years ago
Hello, Im using Firefox 3.0.1 and Windows XP and I use a lot local websites with no internet connection. I have the Offline problem all the time and I have to uncheck the work offline option. But everytime I restart Firefox I have to do the same again.

I tried with localhost and with and everytime happens the same. Why this option is not saved and how I can solve this problem? Is that a bug?

Comment 11

9 years ago
Have there been any updates to this? This is also driving me crazy. 

Comment 12

9 years ago
We need to break out the user data by platform. I have a feeling linux users feel it more because they have some new network-detection features...

Comment 13

9 years ago
The problem has largely gone away for me.  Firefox still gets into offline mode, but only when I start it with the network down, which makes more sense.  

I've changed a lot of stuff, and I don't know what change improved the situation.  Here is what I can think of:

I'm now running Ubuntu 8.04 Hardy Heron; when I reported before, I was at 7.10 Gutsy Gibbon.  I also updated Firefox from 3.0 to 3.0.1.

Besides that, I did a sort of purge of files from my ~/.mozilla/firefox/ directory, that seemed no longer to be used.

But... Windows users are reporting a similar problem with FF 3.0.1... the common denominator would be the .mozilla/firefox directory...
benc is right: on Linux, Firefox now responds to dbus messages from Network Manager, which means that if you disconnect the network cable, Firefox goes offline and you can't access your locally-served resources.

I think an exception for and localhost would cover 99% of the cases. We could even make the list of exceptions a pref for the tiny number of people who have other local aliases for their own machine.


Comment 15

9 years ago
I experienced this when travelling by train. After booting my Ubuntu Hardy Heron system, it detects no wired (default) or wireless networks and therefore Firefox 3 is set to normal mode. When the train stops at a station that has a wireless network, even though I don't (try to)access it, the system is not really influenced by this. However when the wireless network goes out of reach, Firefox detects the network has gone when accessing localhost and switches to 'working offline'.

In short, like many other argue, Firefox accessing localhost should not be effected by this. I would like to propose, like others, that accessing localhost is considered like accessing an URL on the local file system.

If one really needs the behaviour that localhost is considered an external URL, it should be possible to enable this functionality somewhere in the preference menu's.

Comment 16

9 years ago
Perhaps another issue, but slightly related to this is, is caching for localhost. Should caching be used for local files and localhost usage? For developers it is desirable to have caching disabled in these cases. For normal users and in general, not using cache in these cases is probably faster anyway.


9 years ago
Duplicate of this bug: 461156

Comment 18

9 years ago
Firefox (and other Gecko apps) on OS X now has auto-detection of network link and go into offline mode when you lose network connectivity. 

This bug is extremely annoying if you're developing something with a local server.
This bug has now increased with recent upgrade to 3.0.5 using windows vista after upgrade I can't even use localhost as it is blocked in both offline and online mode. I have downloaded and installed opera but I am a FF Fanboy and don't like to have other browsers on my computer. I think you need to fix this bug asap as I have been looking at other browsers as an alternative to firefox. If I am I know other people are also. I run Apache webserver with php and mysql and use dreamweaver to develop websites. I have come to rely on Firefox as a primary web development tool and this just flat out makes me disgusted that the problem has been known about for a long time and not addressed and now it is worse.

Comment 20

9 years ago
Problem came back in an upgrade to Ubuntu 8.10 Intrepid.
Solution (again): un-install Networkmanager (no big loss there).

Comment 21

9 years ago
Seems resonable to have cache disabled for anything that gets translated into After all it's almost like loading a file from disk anyway.

Comment 22

9 years ago
Just a thought, but maybe there could be something like:

(similar to network.proxy.no_proxies_on)
(In reply to comment #21)
> Seems resonable to have cache disabled for anything that gets translated into
> After all it's almost like loading a file from disk anyway.

I don't agree. If web developers want to test their cache headers on localhost server the behavior will be different from what is expected normally when address of the same configured server is not localhost.

(In reply to comment #22)
> Just a thought, but maybe there could be something like:
>  browser.cache.offline.disable_on='localhost,'
> and/or
>  browser.offline.never_offline_on='localhost,'
> (similar to network.proxy.no_proxies_on)

To fix this bug is not that simple and have option like this as well. When necko gets to offline mode DNS and socket service get shutdown. It means we cannot resolve localhost to (ipv4) or ::1 (ipv6) and even we could we cannot run any connections to it. This would mean complex rebuild of the necko infrastructure. There is workaround for this described in comment 6.

Comment 24

9 years ago
Perhaps an intermediate solution would be to add a button to the error message -- right next to "try again".  I'm bitten by this bug every single day, since I run Sage from localhost (math software with an html interface) on my laptop, and I'm frequently on the move.

Comment 25

9 years ago
Checkout this extension:
After few months of testing this I can say it works-for-me :-).
(In reply to comment #25)
> Checkout this extension:
> After few months of testing this I can say it works-for-me :-).

I don't think this fixes this bug somehow.
Group: mozilla-confidential
Would a sensible, quick first step for this problem be to allow users to completely turn off offline mode all the time, in an about:config setting?  (I don't see one right now).   This would allow people to not have to hit "uncheck work offline" each time they fire up the browser.  

It's a blunt hammer, but it may be better than the current behavior for the small subset of users who are getting bit by this bug every day.
Sorry, my wild mouse click set this to be a "confidential" bug.  Removing.
Group: mozilla-confidential

Comment 29

8 years ago
Also run into this annoying behavior :(

IMHO with HTML5 and its offline modes coming into play soon, this might be more then annoyance. Offline mode should be triggered per site when there is no connection with the site (after a request has failed) and this will solve the localhost problem as well, and the wifi stability people are complaining on


8 years ago
Duplicate of this bug: 535734


8 years ago
Duplicate of this bug: 440527


8 years ago
Duplicate of this bug: 529861


8 years ago
Duplicate of this bug: 539541


7 years ago
Blocks: 546640
Depends on: 565517
Blocks: 565517
No longer depends on: 565517
Blocks: 583386


7 years ago
No longer blocks: 583386

Comment 34

6 years ago
Work around is having a 3g stick. It's been 2 years that bug is reported but no action. Do you live in a place where everywhere covered with wifi? Don't you bother 33 bug reports.


5 years ago
Whiteboard: [Advo]
is this a dup of 87717 (which was fixed in ff18)?

Comment 36

4 years ago
It would seem sensible for Firefox to see if a connection to a site is possible each and every time one is typed into the URL bar - and come out of automatic offline mode if one is. I use XAMPP to run a local wiki and a wordpress journal, and I often do so with my laptop's WiFi turned off to save energy. Firefox starts in offline mode whenever WiFi is disabled and so refuses to attempt a connection to even local sites even if I type their address into the URL bar several times. Only going onto that page and specifically pressing 'Try Again' brings it out of offline mode and allows it to access local sites.

Comment 37

3 years ago
I believe automatically switching to offline mode is a bad idea in general and that's what's causing problems such as this.

If "offline" means don't try to resolve anything nor use any sockets, then switching on offline mode should only be done by a more active decision from a user (or script or whatever).

This is related to bug 939318

Comment 38

3 years ago
Created attachment 8467544 [details]

Contents of my /etc/hosts is as follows:      amidea

Firefox is NOT in Offline Mode, however with the network disconnected I'm unable to access a local site using Firefox v30. Firefox requires network connection to even browse local sites resolving to

Chrome (v35) can access the site normally as depicted in the screenshot.

Occurs in Linux Mint 17 64-bit.

Should I report a new bug? Because this happens irrespective of Work Offline checked or not. Bug 339814 seems to only cater to when Work Offline is checked.

Comment 39

3 years ago
I've found another bug that is exactly as my issue, which is Bug 698302 (almost similar but different than this one), reported 3 years ago (!!!).


3 years ago
Depends on: 1140284

Comment 40

3 years ago
The problem with using "localhost" that occurs when in offline mode should be fixed with the fix from bug 1140284 (inbound just now). If someone still suffers from this problem even after using that fix, I would like to know how to repeat it!

Problems with accessing local hosts while in offline mode using _other_ hostnames than "localhost" is the problem mentioned in Bug 698302 and is not covered by this specific bug report.


3 years ago
Assignee: nobody → daniel

Comment 41

3 years ago
I consider this closed as well with the fix from bug 1140284.
Last Resolved: 3 years ago
Resolution: --- → FIXED


2 years ago
Duplicate of bug: 1140284
You need to log in before you can comment on or make changes to this bug.