Closed Bug 426487 Opened 16 years ago Closed 6 years ago

Offline message kicks in when network interface is down

Categories

(Mozilla Labs :: Prism, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jjzhuang, Assigned: matthew.gertner)

References

Details

This has been observed on both windows and linux, so I assume Mac has the same issue.  Basically when there's no network interface other than loopback, prism simply refuses to connect with the following error message:

"This document cannot be displayed while offline. To go online, uncheck Work Offline from the File menu"

Except for our application which actually runs web service on localhost, all we need is the loopback.  This looks like the FF3 offline feature kicking in when network failure is detected.  We need a way to completely disable this.
You could try forcing the app back online. nsIIOService has a property to toggle offline state.

for example:
http://mxr.mozilla.org/seamonkey/source/browser/base/content/browser.js#5337
OK I'll try this.  Thanks Mark!
I see the same message even when there are other network interfaces besides loopback in [Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b4pre) Gecko/2008030208 Prism/0.9].

Local sites (e.g. http://locahost/test) may or may no load the first time, but subsequently I get the error message.

I'm not sure what to do with the example given above. Is there a one-liner I can run in the debug console to toggle the offline state?
OK, that's not bad.  Looks like all I need to do is to add this line:

this._ios.offline = false; //force online even no network

after this line:

this._ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);

Matt and Mark, rather than for me to keep patching webrunner.js, can we make forcing online either a preference setting or webapp.ini setting?

For now I'll just patch myself, but I'll leave this bug open.  Thanks!
I'll file a bug to fix the Mozilla bug but obviously that isn't going to happen any time soon with Firefox 3 in the oven.

In the meantime, Mark suggested a workaround that checks for localhost and turns off the offline flag accordingly. I'll submit a patch.
what do you mean by "there's no network interface other than loopback"?

Are you telling Necko to go offline, or do you really mean you used ifconfig to DOWN or delete all the non lo0 interfaces?

Is this related to the conversation in Bug 87717?
Sorry, I lost track of this. What is the current status? Is there still a Firefox issue that needs to be fixed? Do we need any Prism workaround in the meantime?
Matt, what I meant is that we can workaround this by setting this._ios.offline = false in webrunner.js.

We are fine with doing this, but ideally we want to eventually eliminate the need of patching webrunner.js.  So if prism provides a new setting that allow us to do this through prefs.js or webapp.ini we'll switch over.
Okay I'll see about filing a Mozilla bug.
Ben is right, this is a dupe of https://bugzilla.mozilla.org/show_bug.cgi?id=87717. Might be hard to get it fixed since it's been kicking around since 2001.
Depends on: 87717
Prism isn't maintained anymore. Mass closing of the bugs.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.