register focus on top of visibilitychange