The setImmediate is implemented in node and may have unexpected affects.
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
- setImmediate(function() {
+ setTimeout(function() {
require('remote').getCurrentWindow().emit('onbeforeunload');
- });
+ }, 0);
return false;
}
</script>
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
- setImmediate(function() {
+ setTimeout(function() {
require('remote').getCurrentWindow().emit('onbeforeunload');
- });
+ }, 0);
return false;
}
window.close();
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
- setImmediate(function() {
+ setTimeout(function() {
require('remote').getCurrentWindow().emit('onbeforeunload');
- });
+ }, 0);
return 'string';
}
window.close();
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
- setImmediate(function() {
+ setTimeout(function() {
require('remote').getCurrentWindow().emit('onbeforeunload');
- });
+ }, 0);
return true;
}
window.close();