idle.queryState()

Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.

Syntax

browser.idle.queryState(
  detectionIntervalInSeconds, // integer
  function(newState) {...}    // function
)

Parameters

detectionIntervalInSeconds
integer. The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
callback
function. The function is passed the following arguments:
newState
idle.IdleState. The idle state.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic support48.0

Examples

Acknowledgements

This API is based on Chromium's chrome.idle API. This documentation is derived from idle.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,