chrome idle api

415 views
Skip to first unread message

noam

unread,
Jan 6, 2011, 6:39:19 AM1/6/11
to Chromium-extensions
When calling chrome.idle.queryState there are two arguments that can
be passed to the function - a threshold (which determines when the
machine is idle) and a callback.

when calling chrome.idle.onStateChanged.addListener you can only give
this function a function which is called when the state changes from
idle to active. But how is idle defined here? By that I mean after how
many seconds or minutes does the machine go into the idle state? Is
there any way to change this?

I would think it makes sense if this would accept a threshold argument
as well. Or perhaps I'm missing something obvious.

Noam

Jochen Eisinger

unread,
Jan 6, 2011, 4:34:58 PM1/6/11
to noam, Chromium-extensions
On Thu, Jan 6, 2011 at 12:39 PM, noam <hell...@gmail.com> wrote:
> When calling chrome.idle.queryState there are two arguments that can
> be passed to the function - a threshold (which determines when the
> machine is idle) and a callback.
>
> when calling chrome.idle.onStateChanged.addListener you can only give
> this function a function which is called when the state changes from
> idle to active. But how is idle defined here? By that I mean after how
> many seconds or minutes does the machine go into the idle state? Is
> there any way to change this?

The event only fires onf transitions from IDLE to ACTIVE. The poll
interval used is 15 seconds. To detect changes to the other states,
you need to poll.

See for example this extension:
http://code.google.com/chrome/extensions/examples/api/idle/idle_simple.zip

> I would think it makes sense if this would accept a threshold argument
> as well. Or perhaps I'm missing something obvious.
>
> Noam
>

> --
> You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
> To post to this group, send email to chromium-...@chromium.org.
> To unsubscribe from this group, send email to chromium-extens...@chromium.org.
> For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages