Is there a method to determine if a browser is capable of registering the freeze
and resume
lifecycle events?
Even after checking with Modernizr, a reliable JS library, it appears that these events are not supported.
Although extremely beneficial, Safari and Firefox do not currently support these events based on CanIUse data.
Are there alternative approaches to achieve this?
document.addEventListener('onfreeze', (event) => {
console.log('Frozen');
});
document.addEventListener('onresume', (event) => {
console.log('Resumed');
});