Idle Detection
You can utilize chromes idle detection within OpenFin, to enable this feature you will need to add idle-detection
to webAPI permissions (as shown below).
"permissions": {
"System": {
"launchExternalProcess": true
},
"webAPIs": ["notifications", "audio", "video", "idle-detection"]
You can test idle detection when the machine goes to sleep or hibernates and resumes the session. A quick way to test is to plug the following into the devtool console:
const idleDetector = new IdleDetector();
const controller = new AbortController();
const signal = controller.signal;
idleDetector.addEventListener("change", () => {
const userState = idleDetector.userState;
const screenState = idleDetector.screenState;
console.log(userState, screenState);
});
await idleDetector.start({
threshold: 60000,
signal,
});
Further information on idle detection can be found here: https://developer.chrome.com/articles/idle-detection/
Comments
0 comments
Please sign in to leave a comment.