Is there any way I can handle the cancel and reload action of the window.onbeforeunload event of javascript something like this ...
window.onbeforeunload = function (e) {
if( e.cancelled ) {
console.log('user has not agreed to reload');
} else {
console.log('user agrees to reload');
}
return '';
}
I have searched for it on Docs but there is no mention about this