User activation and idle inference
Tells whether the person has clicked or typed recently, and in Chromium whether they are idle.
In one line
Can see if you recently clicked or typed, and in Chromium if you are idle
Tells whether the person has clicked or typed recently, and in Chromium whether they are idle.
navigator.userActivation shows if a click or key happened. IdleDetector (permission gated, Chromium) reports user active or idle and screen locked. Without it, sites infer idle from the absence of input events.
What it can and can't do
What the user does: You click or type on the page. Idle checks need you to tap Allow
It can
- Tell if you clicked or pressed a key lately
- In Chromium, learn if you are active or idle, after you allow it
- In Chromium, learn if your screen is locked, after you allow it
It cannot
- See what you typed or clicked, only that you did
- Get idle checks in Firefox or Safari
- Get idle checks without your Allow
- Learn why you are idle or what you are doing
How it differs between platforms: The idle permission works in Chrome and Edge only. The simple click check works in every browser.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 94 | 2021-09-21 | None |
| Edge | Supported | 114 | 2023-06-02 | None |
| Firefox | Supported | 120 | 2023-11-21 | BCD lists no support; agent research says otherwise |
| Safari | Supported | 16.4 | 2023-03-27 | BCD lists no support; agent research says otherwise |
| Safari on iPhone | Supported | 16.4 | 2023-03-27 | BCD lists no support; agent research says otherwise |
| Chrome on Android | Supported | 94 | 2021-09-21 | None |
| Samsung Internet | Supported | 17.0 | 2022-05-04 | None |
How a site asks for it
| API | navigator.userActivation.hasBeenActive/isActive; new IdleDetector().start({threshold}) |
| Permissions policy | idle-detection |
| Browser compat keys | api.IdleDetectorapi.UserActivation |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Check userActivation
- For IdleDetector, request permission
- Listen to change events
Data you get
What comes back: userState: active or idle, screenState: locked or unlocked
Shape: event
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
userState | string | None | active, idle | 60 s minimum threshold |
Technical limits
- IdleDetector is Chromium only, 60 s minimum threshold, requires permission
- Never shows which apps are active
The story
What it is
A page can tell if you recently clicked or typed, and in Chromium, with permission, whether you are idle.
For you
Some features, like opening a popup, only work right after you tap or click. For the idle check, Chromium asks first, then a chat app can mark you as away or active.
For makers
User activation stops pages from playing sound or opening windows without you. Idle detection helps chat and collaboration apps show real presence and send notifications to the right device.
Where you see it
| Type | Example | Apps |
|---|---|---|
| messaging | A work chat web app marks you away after you leave the computer, then sends alerts to your phone. | Slack, Microsoft Teams, Google Chat |
| productivity | A shared document editor shows who is active right now so teammates know who is working. | Google Docs, Figma |
| games | A browser game only starts sound and video after your first click, because browsers require it. | None named |
| video | A video site pauses or lowers quality when you step away, to save data. | None named |
| security | A banking site logs you out when you are idle, after a few minutes without activity. | None named |
| ads | An ad site only counts a video as viewed if you interacted, which stops bots that play videos. | None named |
| education | An online exam page notes long idle gaps to review for possible cheating. | None named |
Risks
- Presence is personal
- Can feel like watching
What the platform says
- Google Chrome: Idle Detection API. Chrome says it lets apps like chat know when you are away from the device, with your permission.
- MDN: User activation. Explains that some features only work right after a real click or key press.
Good uses and abuse
Legitimate uses
- Chat presence, kiosks
Known abuse
- Attention surveillance, proctoring
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 3 of 5 | How much the user has to do |
| Fingerprint bits | 2 | Rough identifying entropy, when known |
History
- 2021-09, Chrome 94: IdleDetector ships (permission prompt)
Related capabilities
Related
- Page Visibility, focus and blur. Can tell when you switch tabs, minimise the browser or lock the screen
Sources
How well checked: Based on official documentation.