Added support for session timeouts and also detect if the top-most
window is fullscreen (sometimes HTML5 is a fullscreen top-most window
but does not have the focus).