The dialog "Do you really want to leave this page?" shows only once in Safari

Question:

To display the dialog ( http://prntscr.com/co2um0 ), I use javascript:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Dialog</title>
  <script>
    window.addEventListener('beforeunload', function() {
      return false;
    });
  </script>
</head>
<body></body>
</html>

The dialog will not be displayed a second time (in the current domain during the session) if I click on the "Leave Page" button.

The dialog will be displayed a second time (in the current domain during the session) if I click "Stay on the page".

The "Do not show again" checkbox is missing in the dialog box.

Playback steps:

  • Add javascript to page A:
  • Open Page A in Safari;
  • Try to exit page A;
  • You see the dialog "Do you really want to leave this page?" ;
  • Click "Leave Page";
  • A; 7. A;
  • " ?" ;

:

  1. " , ?"

:

  1. " ?" .

Reprodused on:

OS X 10.11.6 Safari 9.1.2

:

, " " (, ), .

+4

Source: https://habr.com/ru/post/1656324/


All Articles