Idle Detection
Tells a site when the person is away from keyboard and mouse or the screen is locked.
In one line
Can tell when you step away or lock your screen, if you allow it
Tells a site when the person is away from keyboard and mouse or the screen is locked.
Reveals when the person is present: active or idle (at least 60 seconds) and whether the screen is locked. Useful for chat presence; also shows daily schedule, sleep and work hours.
What it can and can't do
What the user does: You tap a button like Show my status and tap Allow
It can
- See whether you are active or idle for at least 60 seconds
- See if your screen is locked
- Show presence in chat or reset a shared kiosk
- Keep checking while the page is open
It cannot
- Work before you tap Allow in Chrome
- Work in Firefox, Safari or on iPhone
- Work on Samsung Internet
- See what you are doing, only whether you are active or away
How it differs between platforms: Chrome and Edge on computers and Android ask first. Firefox, Safari and iPhone browsers do not support it.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 94 | 2021-09-21 | None |
| Edge | Supported | 114 | 2023-06-02 | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 94 | 2021-09-21 | None |
| Samsung Internet | Not supported | Not available | Not listed | None |
How a site asks for it
| API | IdleDetector.requestPermission(); new IdleDetector().start({threshold: 60000}); userState, screenState |
| Permission name | idle-detection |
| Permissions policy | idle-detection |
| Browser compat keys | api.IdleDetector |
| How access is granted | prompt |
| What the user sees | Chrome prompt Know when you are actively using your device, Allow or Block; needs a user gesture. |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | Persistent per origin |
| How to take it back | Site settings, padlock |
| Inside an iframe | Needs allow="idle-detection" in iframes |
Typical flow
- User gesture
- IdleDetector.requestPermission()
- Prompt shown
- start({threshold}) then 'change' events fire
Data you get
What comes back: User and screen state
Shape: event
How often: on state change
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
userState | enum | none | active or idle | after threshold |
screenState | enum | none | locked or unlocked | event |
threshold | integer | ms | 60,000 minimum | 1 ms |
Technical limits
- 60 second minimum threshold
- Chrome only
- Needs gesture
The story
What it is
A site can learn when you step away from the keyboard and mouse or lock your screen.
For you
A prompt asks to know when you are idle. If you allow it, the site can show you as away in chat or pause things. You never see the checks themselves.
For makers
Makers use it to show presence in chat and team tools, and to save resources. It is also a window into when you are at your desk. That is why it needs a clear allow.
Where you see it
| Type | Example | Apps |
|---|---|---|
| messaging | A web chat shows a friend as Away after they leave their computer, so you know not to expect a reply. | Slack, Discord |
| enterprise | A shared support desk marks agents as idle and sends new tickets to those at their desks. | None named |
| games | A browser game lobby pauses a match search when you walk away, so teammates are not left waiting. | None named |
| live | A live auction site logs out an idle bidder to protect their account. | None named |
| security | A banking site locks the page when it sees the device screen is locked and idle. | None named |
| education | A test platform notes that a student has left their screen, as a sign of cheating risk. | None named |
| video | A video site pauses autoplay of the next episode when no one is there to watch. | None named |
Risks
- Shows when you are away
- Can feel like spying
What the platform says
- MDN Web Docs: Idle Detection API. Lets a page know when a user is idle or the screen is locked, after the user allows it.
Good uses and abuse
Legitimate uses
- Chat presence
- Kiosk reset
Known abuse
- Learning when the person is away from the computer
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2021-09, Chrome 94: Idle Detection ships
Sources
How well checked: Based on official documentation.