How to detect in iOS webapp when switching back to Safari from background?

后端 未结 7 715
栀梦
栀梦 2020-11-29 23:29

How can I build a webpage which is able to monitor when the page gets the focus, especially when Safari is in the background and the user switches Safari back to the foregro

7条回答
  •  爱一瞬间的悲伤
    2020-11-30 00:09

    Use the pageshow and pagehide events.

    
    

    https://developer.apple.com/library/mac/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html

提交回复
热议问题