Detect when user is away from the OS?

I wonder if there is some clever modern javascript API to detect when a user is away from the system? And I mean the system, not the browser tab or window, so that I can know that the user has not been using the computer for 2 minutes, for example. By not using the computer I mean not using the mouse or keyboard, similar to how screensavers detect user inactivity.

I’d like to use this information for a browser based chat that I’ve made. So far the best I can do is detect whether the user is logged in and is interacting with the web page by using mouse and key events. But if he minimizes the browser window and is using other programs on the system the traditional events will not report any activity - but I’d like to treat such situation as if the user is available, regardless if he is using my application in the browser or other applications in his system.

I know traditionally this has not been possible but some new features are coming up constantly so I’m wondering…

This sounds like a major security violation. Why on earth would a website need to know whether or not I’m at my computer actively using another app or away from my desk?

1 Like

Maybe you are right, I haven’t thought of that. I don’t know how sensitive this kind of information is for different people but probably some of them would like not to share it. However, people share this information whenever they use any installed chat client like Skype and possibly any other application that connects to the internet.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.