What is happening here is that as Firefox is starting, something initializes nsIOService before libdbusservice.so has registered nsNetworkManagerListener. Because there is no compreg.dat at this state, nothing provides NS_NETWORK_LINK_SERVICE_CONTRACTID at the point that this code section is executed in nsIOService::Init
// go into managed mode if we can
mNetworkLinkService = do_GetService(NS_NETWORK_LINK_SERVICE_CONTRACTID);
if (!mNetworkLinkService) mManageOfflineStatus = PR_FALSE;
if (mManageOfflineStatus) TrackNetworkLinkStatusForOffline();
So, from this point, Firefox does no tracking of the network connectivity and nsIOService::GetOffline always returns FALSE (which is what ubufox is using to get the network status).
When you run Firefox for a second time, calling do_GetService(NS_NETWORK_LINK_SERVICE_CONTRACTID); from nsIOService::Init triggers loading of libdbusservice.so and automatic registration of nsNetworkManagerListener, because it exists in compreg.dat from the previous run
XPCOM component registration has changed quite a lot in Firefox 4.0, so I suspect this might not be an issue there.
What is happening here is that as Firefox is starting, something initializes nsIOService before libdbusservice.so has registered nsNetworkManage rListener. Because there is no compreg.dat at this state, nothing provides NS_NETWORK_ LINK_SERVICE_ CONTRACTID at the point that this code section is executed in nsIOService::Init
// go into managed mode if we can kService = do_GetService( NS_NETWORK_ LINK_SERVICE_ CONTRACTID) ; ervice)
mManageOffline Status = PR_FALSE;
mNetworkLin
if (!mNetworkLinkS
if (mManageOffline Status)
TrackNetworkLi nkStatusForOffl ine();
So, from this point, Firefox does no tracking of the network connectivity and nsIOService: :GetOffline always returns FALSE (which is what ubufox is using to get the network status).
When you run Firefox for a second time, calling do_GetService( NS_NETWORK_ LINK_SERVICE_ CONTRACTID) ; from nsIOService::Init triggers loading of libdbusservice.so and automatic registration of nsNetworkManage rListener, because it exists in compreg.dat from the previous run
XPCOM component registration has changed quite a lot in Firefox 4.0, so I suspect this might not be an issue there.
This isn't going to be fixed in Firefox 3.6.