3 messages in com.googlegroups.google-gearsRe: need for google.gears.isOnline ?
FromSent OnAttachments
geek11122217 Sep 2007 09:46 
Ben Lisbakken17 Sep 2007 13:43 
geek11122217 Sep 2007 21:24 
Subject:Re: need for google.gears.isOnline ?
From:geek111222 (geek@gmail.com)
Date:09/17/2007 09:24:49 PM
List:com.googlegroups.google-gears

Hi Ben,

I totally agree with you when you say : "it up to the user to decide when their application is offline"

An end user (who we can assume is non-techie) , will want to go into 'offline' mode when anything that prevents him from accessing a page/ server happens. An approach that I was trying out yesterday was 'pinging using AJAX'. I guess something similar to this can be implemented. I mean,Gears can have a property like 'google.gears.pingURL' and 'google.gears.pingInterval', it might be possible to detect a situation where the site is unreachable. I have heard something about 'Comet technology' and maybe something similar can be useful to maintain a connection. This is just one solution that comes to my mind.

My 'personal' opinion is that following two possibilities are important, because in this case the user could have voluntarily choosen to be offline: * the browser has the 'work offline' flag set [Switch to offline mode] * the network cable is unplugged [Out of office or something..in case of hardware problem..OS will notify him]

In other cases, being offline or online was controlled by external factors. The user still thinks he is online. Here, when he uses the application in 'online' mode, he would fail. Even with current implementations this would happen. Now somehow , say if Gears can detect this and have a provision of showing up a custom message like 'your website is unreachable ! would you like to go offline?' ... and then set a flag like 'google.gears.isSiteOffline'

I can imagine following additions in Gears: google.gears.isSiteOffline /google.gears.isSiteOffline(sitename) [site specific flag] google.gears.isBrowserOffline [cable unplugged AND/OR browsers offline mode..a global variable] google.gears.SiteOfflineCallback [points to javascriptcallback function] google.gears.BrowserOfflineCallback [might be useful for some ?]

-Ashish