window blur/​focus/​pageshow/​visibilitychange tester by robocat

Detect foreground within iOS/UIWebView or Android/WebView: 1. click [restart], 2. open another tab or open another app or lock device or open another page. 3. Wait say 10 seconds. 4. Go back to page. Note that animationend event occurs - check milliseconds. webkitRequestAnimationFrame would cause performance issues.
seconds
tab
000.000s 000.000s start timeout #1 for 5s
000.001s 000.002s document.load capture
000.021s 000.022s document.load capture
000.024s 000.024s document.DOMContentLoaded capture
000.024s 000.025s document.DOMContentLoaded
000.026s 000.027s monkey.animationstart
000.061s 000.062s window.pageshow
000.061s 000.062s window.pageshow capture
Edit in JS Bin