I need to detect if the is no user activity in the system (e.g. what screensaver does) – all from a web browser.
As far as i’m aware it is not achievable using pure JavaScript. There is a library for detective idle input within a browser though: jquery-idletimer-plugin
For system idle events I’m thinking ActiveX control or SilverLight.
Has anybody done this before? Any recommendations?
UPDATE: I think a sensible solution would be to have a helper app that’s running on user’s computer and sends idle events to the browser. So the new question is how can i send a message to an open browser (webkit based, with my web app open) from a Windows app so that it can be picked up from JavaScript?
If you really need to this, (I’m hoping its for a client who asked for a feature like this) you should write your own browser (C# allows you to just drop a web browser control on a form with only a little customization needed) and have your users use that browser (which you can then use to detect idle status using the operating system features.
Again this is under the assumption that you have a client that asked for this and not for a project that will be out in the wild, otherwise what Ivo said is completely true, I wouldn’t want to download a brand new browser just to run a simple website.