2018-11-20 window onfocus How to tell if app/page has focus (Example) Page Visibility API - ウェブデベロッパーガイド | MDN