Skip to content

Latest commit

 

History

History
59 lines (36 loc) · 1.29 KB

File metadata and controls

59 lines (36 loc) · 1.29 KB

idle

Documentation: Chrome Idle API

A promise-based wrapper for the Chrome idle API to monitor user idle state.

Methods

Events


getIdleAutoLockDelay

getIdleAutoLockDelay(): Promise<number>

Retrieves the number of seconds before the system auto-locks due to inactivity.

queryIdleState

queryIdleState(detectionIntervalInSeconds: number): Promise<chrome.idle.IdleState>

Queries the user's idle state within the specified detection interval.

setIdleDetectionInterval

setIdleDetectionInterval(intervalInSeconds: number): void

Sets the interval, in seconds, used to detect idle state changes.

onIdleStateChanged

onIdleStateChanged(
  callback: (newState: chrome.idle.IdleState) => void
): () => void

Adds a listener that fires when the user's idle state changes. Returns an unsubscribe function.