OS Integration

Idle Detection

Probing…

Idle Detection is a web platform capability in the OS Integration category. Detect when the user goes idle or locks the screen. Supported in Chromium 94+; not available in Firefox and Safari. Requires a secure context (HTTPS or localhost) and a user gesture such as a click or tap.

Secure contextUser gesture

Permission idle-detection: unknown

Try it

Loading demo…

Code

await IdleDetector.requestPermission() // needs a user gesture

const controller = new AbortController()
const detector = new IdleDetector()
detector.addEventListener('change', () => {
  console.log(detector.userState, detector.screenState)
})
await detector.start({ threshold: 60000, signal: controller.signal })

Browser support

Chromium
94
Firefox
No
Safari
No

Frequently asked questions

Which browsers support Idle Detection?

Supported in Chromium 94+; not available in Firefox and Safari.

Does Idle Detection require HTTPS?

Yes. Idle Detection needs a secure context, so it only works over HTTPS (or on localhost during development).

What is Idle Detection used for?

Detect when the user goes idle or locks the screen.

Can I try Idle Detection in my browser?

Yes. shwcs.net runs a live Idle Detection demo that probes your current browser and lets you try the API. Everything runs locally — nothing is sent anywhere.

MDN reference ↗ Specification ↗