At the moment, when you try to close the browser tab, it knocks out an alert (are you sure you want to close?), But you need to make sure that the alert does not knock out, the user closes the window, and a new one opens automatically (here - index.html). And will it work in browsers for android? Thank.
window.onbeforeunload = confirm; function confirm() { return window.open("index.html"); }
windowobject are called. 2. If the user wants to close the window, you must let him do it. - Igorwindow.onbeforeunload. - Igor