This code snap from this post works on latest Chrome (v58), but not on Firefox (v53):
window.onbeforeunload = function () {
return "Do you really want to close?";
};
On Chrome, when closing tab, an alert pops out. But on Firefox, tab just closes, no alert.
Why is that? And how to know window closing in Firefox?