Documentation: Chrome Idle API
A promise-based wrapper for the Chrome idle API to monitor user idle state.
- getIdleAutoLockDelay()
- queryIdleState(detectionIntervalInSeconds)
- setIdleDetectionInterval(intervalInSeconds)
getIdleAutoLockDelay(): Promise<number>
Retrieves the number of seconds before the system auto-locks due to inactivity.
queryIdleState(detectionIntervalInSeconds: number): Promise<chrome.idle.IdleState>
Queries the user's idle state within the specified detection interval.
setIdleDetectionInterval(intervalInSeconds: number): void
Sets the interval, in seconds, used to detect idle state changes.
onIdleStateChanged(
callback: (newState: chrome.idle.IdleState) => void
): () => void
Adds a listener that fires when the user's idle state changes. Returns an unsubscribe function.