Idle
Idle
Manifest
You must declare the "idle" permission in your extension's manifest to use the idle API.
For example:
{
"name": "My extension",
...
"permissions": [
"idle"
],
...
}
API reference: chrome.idle
Methods
queryState
chrome.idle.queryState(integer
thresholdSeconds, function
callback)
Returns the current state of the browser.
Parameters
-
thresholdSeconds
(
integer
)
- Threshold, in seconds, used to determine when a machine is in the idle state.
-
callback
(
function
)
-
Undocumented.
Events
onStateChanged
chrome.idle.onStateChanged.addListener(function(string newState) {...});
Fired when the browser changes to an active state. Currently only reports the transition from idle to active.
Listener parameters
-
newState
(
enumerated
string
["active"]
)
-
Undocumented.