I wonder if we'd rather not register to window's online and offline events ?