Page visibility check by abusing window.requestAnimationFrame