You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
paramName
( optional enumerated Type array of paramType )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
Parameters

Google Chrome Extensions (Labs)

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

void chrome.idle.queryState(, integer thresholdSeconds, function callback)

Returns the current state of the browser.

Parameters

thresholdSeconds
( Type array of integer )
Threshold, in seconds, used to determine when a machine is in the idle state.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
callback
( Type array of function )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(string newState) {...};
newState
( enumerated Type array of string ["active", "idle", "locked"] )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

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.

Parameters

newState
( enumerated Type array of string ["active"] )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.