idle
找出用户系统何时处于空闲,锁定或活动状态。
要使用此 API,你需要具有“空闲”权限。
类型
idle.IdleState
-
描述设备空闲状态的字符串。
函数
idle.queryState()
-
如果系统被锁定则返回“已锁定”,如果用户未在指定的秒数内生成任何输入,则返回“空闲”,否则返回“活动”。
idle.setDetectionInterval()
-
设置用于确定系统何时处于
idle.onStateChanged
事件的空闲状态的时间间隔。
事件
idle.onStateChanged
-
当系统改变状态时触发。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
idle | |||||||
IdleState | |||||||
onStateChanged | |||||||
onStateChanged.locked | |||||||
queryState | |||||||
queryState.locked | |||||||
setDetectionInterval |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
备注:
此 API 基于 Chromium 的 chrome.idle
API。本文档源自 Chromium 代码中的 idle.json
。