I want to prevent the tab from closing using the onbeforeunload
event by doing this:
window.onbeforeunload = function () {
return confirm("Are you sure you want to go out?")
}
But it works only when reloading the page in the tab, or when trying to follow a link, but not when closing the tab.
Can anyone help me figure this out? Thanks!