beforeunload handler causes app to close on refresh from DevTools
See original GitHub issueI tracked it down to this: bc7b401
window.addEventListener('beforeunload', (e) => {
// See http://electron.atom.io/docs/api/browser-window/#event-close
e.returnValue = false;
this.app.close();
});
We should find a better way to do this.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Window: beforeunload event - Web APIs | MDN
The beforeunload event is fired when the window, the document and its resources are about to be unloaded. The document is still visible...
Read more >unload And beforeunload Events And How To Debug Them ...
The answer is no. There are some types of actions that by spec are not allowed to be executed within a beforeunload /...
Read more >beforeunload and unload do not fire when closing a window ...
When I navigate a BrowserView to a page that has beforeunload and unload handlers, I expect that closing the window will cause them...
Read more >Is it possible to detect what action causes page reload?
Try opening the Network panel, enabling Preserve log (which saves the network activity log between page loads) and then recreating the behavior.
Read more >window.onbeforeunload and Cypress - Gleb Bahmutov
The application · The strange behavior · Chrome browser · Use the DevTools console · Solution 1: remove window.onbeforeunload · Solution 2: prevent ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

yep, it would call
BrowserWindow.hide()and notminimize()though.If the option is not checked in the admin, it will close the app.
You’ll need to edit some file like
js/actions/AppActions.jsjs/main-process/tray.jsI think this is broken again/still. Dev flow like fix->refresh->check does not work for me. It either errors or minimizes the app.