[whatwg] HTML extension for system idle detection.

David Bennett wrote:



On Mon, Aug 31, 2009 at 5:30 PM, Drew Wilson <atwilson at google.com> wrote:


This would be my inclination as well. I'm not entirely convinced that "every
web app should define their own idle timeout" is such desirable behavior
that we should build our API around it by forcing every caller to specify
their idle timeout - having a standard event that's fired with an exposed
state for apps that need it seems like a cleaner approach. 


The trouble with this is it doesn't allow any experimentation on the part of
the app/entity to figure out what is the best idle time for it's purposes.
In terms of chat it might be that a 3 minute or 5 minute idle time works
best in terms of people's attention.  For something like watching a video
perhaps a 15 minute idle would be a better length of time, or for an online
game a longer idle time is probably useful before being signed out.
Different purposes have different requirements for the idle time so it makes
sense to allow them to specify the different timeouts.

This requirement could be solved in several other ways, f ex making sure
that the "standard" timeout period is short enough to not be longer than
what any app wants. Then (as was previously suggested) an app that wants a
longer timeout can do setTimeout and trigger its own idle stuff if status
has not come back to "active" during that time.
 
Another alternative is to have no event, and just a property:
    window.lastUserActionTime
which is kept updated with the "msec since epoch" for the latest user input
on the desktop. Then an app can implement its own idle functionality with
totally own rules. This API has the drawback of maybe exposing too much
information (the rate of input events to other apps), but may spawn some
ideas.
 
Best regards
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090901/6e696b22/attachment-0001.htm>

Received on Monday, 31 August 2009 23:53:41 UTC