I'm trying to see if the freeze and resume events (from the Page Lifecycle API) would work for my application to handle the need to reload content after the window/tab has been frozen by the browser.
But I have no idea how to simulate or trigger manually the tab to be frozen. I've even tried to overload the browser with content to try to trigger the event.
I have simple event listeners to run a console.log when the either freeze or resume events are triggered.
Does anybody know a way to trigger a frozen state for a tab? I have so far been unable to find any mention of this.
window.addEventListener('freeze', (event) => {
console.log('freeze', event);
});
window.addEventListener('resume', (event) => {
console.log('resume', event);
});