Chrome onbeforeunload issue

Viewed 28

Trying to open the new site on close of the current tab/window, but the code is not getting executed neither alert or window.open.

window.onbeforeunload = function(e) {
  alert("Am i hidden");
  window.open("https://www.google.com");
  return "Does chrome allow me to see the light.";
};

0 Answers
Related