listen to browser tab visibilitychange and get inactive time