Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2008-05-28 23:58:53 (GMT)
committer Chris Ball <cjb@laptop.org>2008-05-28 23:58:53 (GMT)
commit6a13ac53b718783286548d0c6e9c0209c00443cb (patch)
treefc5eacea97fa026fb0fe7592aaaa01aee5f8bb7b /activity.py
parentdfafd88d7554da5242308f693190d52903b6e39e (diff)
Use xpcom to turn off "offline mode" detection, which disables access
to localhost for no good reason. (Trac #6250.)
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/activity.py b/activity.py
index 9125e72..951670d 100644
--- a/activity.py
+++ b/activity.py
@@ -50,11 +50,18 @@ class WikipediaActivity(webactivity.WebActivity):
# Use xpcom to set a RAM cache limit. (Trac #7081.)
from xpcom import components
+ from xpcom.components import interfaces
cls = components.classes['@mozilla.org/preferences-service;1']
- pref_service = cls.getService(components.interfaces.nsIPrefService)
+ pref_service = cls.getService(interfaces.nsIPrefService)
branch = pref_service.getBranch("browser.cache.memory.")
branch.setIntPref("capacity", "5000")
-
+
+ # Use xpcom to turn off "offline mode" detection, which disables
+ # access to localhost for no good reason. (Trac #6250.)
+ ios_class = components.classes["@mozilla.org/network/io-service;1"]
+ io_service = ios_class.getService(interfaces.nsIIOService2)
+ io_service.manageOfflineStatus = False
+
self.searchtoolbar = SearchToolbar(self)
# WTB: Hacked to use hardcoded Spanish localization for WikiBrowse release.
self.toolbox.add_toolbar('Buscar', self.searchtoolbar)