teh bigbro blog(tm)
Bigbro's foray into the scary world of blogging
01 07 2008

Tue, 01 Jul 2008

Firefox 3 Offline Mode in Ubuntu

Since upgrading to Ubuntu Hardy Heron (8.04) I've noticed that Firefox on my laptop drops into 'Work Offline' mode every time I suspend and resume my laptop or change connectivity type. While offline mode is indeed useful, I'd much rather I had to manually select this mode, rather than have the hassle of having to repeatedly tell Firefox it's online. I use a combination of wired, wireless (802.11b/g/n) and 3G connectivity throughout my average day, so perhaps this affects me more than it would others.

It appears that Firefox 3 on Ubuntu queries Network Manager to see if it's online or offline, and sets its status according to this. A neat feature, but it appears to only indicate an offline state, forgetting to turn it back online again afterwards. The internet suggests that this might be due to a bug though it seems there's some debate as to whether it's a Network Manager bug or a Firefox bug.

In order to fix this, I specifically disallowed Firefox from conversing with Network Manager (over dbus), with the net result that Firefox always chooses it's default mode of being online.
Edit the /etc/dbus-1/system.d/NetworkManager.conf file and replace each instance of
<allow send_interface="org.freedesktop.NetworkManager"/>
with
<deny send_interface="org.freedesktop.NetworkManager"/>

You will have to restart dbus for this to take effect, and I noticed some slight strange effects until I rebooted. Firefox now appears to be firmly convinced it's always online, which was the aim; and probably not far from the truth on my laptop. Note that other applications that query Network Manager in a similar fashion, such as Pidgin will also assume they are online all the time, since they are also denied access to query Network Manager.

Thanks to Nikitas350 for his helpful post detailing this solution.

posted at: 10:39 | path: /technical | permanent link to this entry


copyright © 2005-2008, Gareth Eason