I am trying to create an app which does some work when it becomes visible, and does other work when it goes away. This is typically accomplished with the page visibility api (http://css.dzone.com/articles/using-html5s-pagevisibility) but this is not currently supported in windows 8: http://msdn.microsoft.com/en-us/library/ie/hh673553(v=vs.85).aspx
There are callbacks onactivated and oncheckpoint but these are for the process lifecycle and are not necessarily related to app visibility. Specifically, an app can go to the background for quite some time before it is suspended.
Any help would be appreciated.
-- Henry
I think you want the visibilitychange event. See the
Document
documentation here. More on application lifecycle events here.If you want to track app focus switches you could use
window.onblur
andwindow.onfocus
. Especially in multimon environments that's helpful.