Is there a reliable way to determine if a browser tab or window is inactive or not in focus?

后端 未结 5 2188
一整个雨季
一整个雨季 2020-12-30 11:02

I\'ve got a javascript timer that is making XMLHTTP requests on a constant basis (once every 10 seconds). I\'d love to be able to pause the timer when the window or tab los

5条回答
  •  别那么骄傲
    2020-12-30 11:42

    My previous desperate attempts to find such a thing have led me to conclude that there is no such animal.

    Oh, how I would love to be wrong.

提交回复
热议问题