close-beforeunload-undefined.html 265 B

1234567891011121314
  1. <html>
  2. <body>
  3. <script type="text/javascript" charset="utf-8">
  4. window.onbeforeunload = function() {
  5. setTimeout(function() {
  6. require('electron').remote.getCurrentWindow().emit('onbeforeunload');
  7. }, 0);
  8. }
  9. window.close();
  10. </script>
  11. </body>
  12. </html>