Can I monitor the page refresh or leave this page on the mobile h5 page?
迷茫2017-05-16 13:36:58
You can use HTML5’s Page Visibility API
document.visibilityState: Values representing the following 4 possible states:
hidden: the page is in the background tab or the browser is minimized
visible: the page is in the foreground tab
prerender: the page performs pre-rendering processing off the screen document. The value of hidden is true
unloaded: The page is being unloaded from memory
Visibilitychange event: This event is triggered when the document changes from visible to invisible or from invisible to visible.