Freeze/Resume Detection
The Page Lifecycle API lets developers detect and respond to changes in a web page's visibility and lifecycle state, such as when a page is loaded, hidden, frozen, or about to be unloaded.
Demo
Switch to another browser tab, to see information about the page lifecycle below.
Use cases
The API complements the Page Visibility API but provides additional information. It also includes a wasDiscarded flag, which allows developers to detect when a frozen tab has been discarded (removed from memory) and requires a full page reload upon restoration. In such cases, the flag is set to true.
Code
Links & Documentation
Ready to generate your PWA?
Try our PWA toolkit free of charge and without limits for 14 days. No credit card required.
Generate PWA See plans